I have a joomla site. Bootstrap grip.css is loaded from a component.
But on pages where the component is not used the css file is not loaded and i need it to for styling.
How do create a code strip with IF not loaded then load /file in my index.php?
I'm not aware of any way to test whether a CSS file is loaded but you could use unset to unload grip.css (see https://joomla.stackexchange.com/a/4986/120 for details) and then use addStyleSheet or similar to load grip.css (see https://docs.joomla.org/J3.x:Adding_JavaScript_and_CSS_to_the_page for details).
Using this method can ensure grip.css is loaded exactly once on each page.
Related
I have a php page that is just a page I am linking to, from index.php.
When I try to use jdoc include to place the module, it doesn't work.
Should I do something special to make this php page a part of the Joomla template? Should I make it an article? Or is there just another way to load this module?
You can use this extension https://extensions.joomla.org/extension/jumi/ and on it you can put the path of your php file.
I want to add/link boostrap CDN to my concrete5 (v. 5.6) block. I want it to be specific to this particular block only.
I tried to search in the old documentation at
https://legacy-documentation.concrete5.org/developers
but couldn't find anything. I found something in new documentation using assets
https://www.concrete5.org/community/forums/5-7-discussion/how-exactly-do-we-use-asset-registering
but this doesn't seem to work in old version.
Thank You
As said in the legacy-docs (version 5.6.x) under Blocks / Directory Setup / Stylesheets, JavaScript and Other Assets:
The following named items will be automatically added to a page's
header, if the block in question has been added to that page:
view.css
view.js
Additionally, this behavior also applies to any files of any name
within the following directories, should they exist:
css/
js/
So the block's CSS folder (under /application or in a package) is as follows:
blocks/block_handle/css/
You can also use the addHeaderItem call from your view function in the block's controller if you wanted to do something like the CDN, keep in mind that any CSS added will be applied to the whole page unless the classes are specific to the block.
I've got a custom theme running on the latest stable Concrete5 version.
It's all working great - but tonight I've come to create a variation of an existing template.
Inside the theme/themename/ folder I copied the PHP file for the template.
In the theme/themename/css folder I copied the CSS file used by the existing template.
In the CMS itself I created a new pageType with the alias to match both the php and css file's filename I'd created by copying the previous files.
The PHP / template file is loading fine when chosen as the template for a page, but it's now loading in the associated CSS file.
Cache cleared but to no avail.
Can anyone give me any clues what I'm missing?
This usually is because the css and/or js is hardcoded in the header.
Check the html head (in the template) if the path to the css/js is correct.
I'm trying to use the uaparser.php library to detect the operating system, but when I use the following it just loads the github page for the library. This is the github page https://github.com/tobie/ua-parser/tree/master/php
<?php
require('uaparser.php');
?>
I've placed the file in my includes folder which resides in the Views directory. Perhaps, that is the source of the problem? Where would be an appropriate place to put this file?
I assume when you downloaded uaparser.php you clicked File->Save Page As... (or something simular). That is why the page loads when you require/include it.
Open up the local file uaparser.php and confirm that it is actually the php code and not the html of the page.
Doing this is fine anywhere you need it.
You can place this anywhere, but for codeigniter it should be in the 3rd party folder, but it doesn't matter.
Is it possible to load a single plugin from outside the cake root using App::build()?
If I do:
App::build(array(
'Plugin' => array('/full/path/to/plugin_dir/')
));
..I can load a whole directory of plugins but what if I only want to use one of them? Is this possible? (I get errors when using a path to the specific plugin directory).
(P.s. This is cake version 2.1)
From the bootstrap.php in a baked application:
CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
You have to add the directory with the plugin in it via App::build() and then the plugin itself with the method above.
While using "App::build()" you are not "loading" all the files in there. You are defining the paths where cake searches for php to include in case it has to.
Nothing will be loaded if it is not need since Cakephp 2.0. Everythings is about lazy loading ^^
How this is, what you are searching for ;)