Joomla cannot unset mod_languages/css/template.css - joomla

Joomla 3.x
The following code is not working
unset($doc->_styleSheets[JURI::root(true).'/media/mod_languages/css/template.css']);
thank you

The code is correct and I tested it, it's working fine.
Possibly you are running it in a plugin event after the head is rendered, or you have cached the page and the code is not really running.
In either case, try to put it at the component level, clear cache, and it should work
Update
to identify the component: turn SEF off, and look at the URL it shows as option=com_componentname;
to identify the module, simply rename the modules folder, and update the site; if it works, it's a module.
For plugins, rename the plugins/system and plugins/content first, then drill down until you spot it.
Alternatively, but much slower, you can turn modules and plugins on and off from the backend, until you find the culprit.

A variation which I've used with success in the past:
unset($doc->_styleSheets[$this->baseurl.'/media/mod_languages/css/template.css']);
Update
Here's an alternate method using a module override which should work for you.
if it doesn't already exist, create a new directory titled html in your template's folder, ie: /templates/your-template/html/
inside this, create an new mod_languages folder, ie /templates/your-template/html/mod_languages/
copy the file from joomla-site-root/modules/mod_languages/tmp/default.php to the folder above, ie /templates/your-template/html/mod_languages/default.php
open this file with a text editor and around line 12 look for the line where JHtml is loading the mod_languages CSS, and comment it out.
// JHtml::_('stylesheet', 'mod_languages/template.css', array(), true);
That's it, hopefully, this will do the trick for you.
Overriding Joomla core output using this method is safe and you won't loose your work with future Joomla updates.
More info about Joomla overrides:
https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
Good luck!

Related

Opencart 2 caching

Has opencart 2.1 a cache system apart from modification?
I'm trying to restyle an opencart 2.1 site.
I've modified catalog/view/theme/my-theme/template/product/product.tpl
but I'm not able to see my updates.
The site has only 1 modification that affects Admin area...I've also tried to disable it and update cache, but without success.
I've tried to open site in another browser, but nothing.
Finally I've tried to rename product.tpl to product111.tpl (also in view/theme/default/product)... but the original product page is still loaded.
Does someone know why this happens?
UPDATE : I haven't found a solution, so I made a fresh installation, applied custom theme and then copied modified files... everything is Ok now. If I modify product.tpl, all changes are visible in product page.
If you have vQmod installed there is a vqcache also.
You can check to see if you have vQmod installed like this:
yoursite.com/vqmod/install
It should usually clear itself, but if it doesn't then you can safely rename the vqcache folder to clear it.
The reason I say rename rather than delete is that sometimes a change to the cache will show an error which wasn't spotted when the original change was made and might prevent orders until it's fixed. If you rename then you can place the folder back and it will work again but of course you should fix the error when you can.

Lazy load CKEditor 4

Currently finding issue lazy loading CKEditor 4, appreciate any advice. What I tried:
Including ckeditor_basic.js but this already needs a CKEDITOR
instance
Loading ckeditor.js on click but this complains
'Synchronous XMLHttpRequest on the main thread is deprecated because
of its detrimental effects to the end user's experience.' as well as
some others errors, fails badly.
Any advice appreciated!
If you would like to insert CKEditor script dynamically you can use technique from this code pen - https://codepen.io/j_swiderski/pen/qPGRGb. It is important to wait for ckeditor.js to load before creating editor instance thus using setInterval to check if CKEDITOR object is available seems like a good idea.
In your comments you have written, you don't want editor to load every time you load the page. One of the reasons for that might be the size of ckeditor.js file.
If you think editor.js is too big it is important to answer yourself how much plugins you really need and then create editor accordingly to your needs using the online builder. Please have a look at below samples using dev-tools and notice the difference in ckeditor.js size: Full package has 600KB while Basic Package has only 400KB. If you just need the basic formatting then your ckeditor.js could get even smaller and should not be a problem when loading the page.
If you have created some custom plugins then recommended practice is to get CKEditor source code from Githhub, fork it, make changes/add custom plugins, build your editor. That way you will get minified and obfuscated editor instance which includes your custom plugins and again should not be a problem when loading the page.

Add javascript to only one theme/layout not the whole site

Please believe me I have tried to search and I only get more and more confused.
I have in the past changed the default prototype reference to my Magento site for a particular theme/layout so that when I am in that particular theme/layout my prototype file is version 1.72 instead of ( i think 1.6) - I can see these changes in the source when I switch between them.
Now I need to add another set of js to the same theme/layout ( only) but I just can't find it anymore where I changed this for that theme.
My theme is defualt/default ( main) and my custom theme is defualt/vod
I thought I was in luck when I found head.phtml in the vod folder but this was only for layouts that I am not using, I want the layout empty... I am so confused and no money to pay people.
Hope you can help
Use local.xml file (app/design/frontend/defualt/vod /layout/local.xml).

Magento javascripts where are they loading from?

I'm working on Magento installation that is causing me frustration.
I CAN find what seems to be the correct page.xml file loading the theme's Javascript (i.e prototype, scriptaculous, etc) in the header, but editing this file and removing scripts does not do ANYTHING for me. When I try and remove/add any new scripts, nothing happens.
Maybe a cache issue? But I have deleted all files from the cache folder. I also tried to find the "Cache Management" menu in Admin, but there is not one there.
I'm 99% confident that I have looked in all of the folders that would call all Javascript.
I am new to Magento, so maybe I've missed something completely.
Any suggestions on where I could find where the basic scripts would be loading from?
I do not know if I got it right. But what you want to know is the directory where the file .js is located, correct?
Try looking in: yourdomain/skin/frontend/yourtheme/default/js/
or: yourdomain/skin/frontend/default/yourtheme/js/
Page.xml is the correct file you need to modify. If not a caching issue, the only other thing I can think of is you have a theme installed but trying to modify the default(base) page.xml.

JOOMLA, Best way to make alternate layouts for articles?

I can't find a answer for this, I want to know what is the best way to have an alternative layouts for articles in Joomla.
If I understand you correctly you are looking for a way to create additional Alternative Layouts for articles. Under parameter tab "Article Options":
If that is the case, its very close to the other provided answers here. Its just that you got to rename the copied default.php file to something else. If you rename it to custom.php it will end up with the text "custom" like the image above.
Here goes my shot for a step by step:
Find the default layout file(s). You could use the ones provided by the com_content component. They can be found at components/com_content/views/article/tmpl. Copy both default.php and default_links.php.
Now you need to rename and copy the file(s) into a template. The target template can be any of the installed templates. Using beez_20 the new path for the copied file(s) should be templates/beez_20/html/com_content/article/custom.php and templates/beez_20/html/com_content/article/custom_links.php.
Goto to edit article using the backend. Expand the Article Options tab and find Alternative Layout. Select your new layout.
Your template might already provide a article override. If so, you might want to use the files of that template instead (instead of the ones in step 1). So if you are using beez_20, you could copy templates/beez_20/html/com_content/article/default.php and templates/beez_20/html/com_content/article/default_links.php.
Helpful links:
Using Joomla’s Template and Layout Override
Layout overrides in Joomla 1.6
The best way to do this would either to install another content component - such as k2 which is highly customizable. Or any other content component on JED.
Alternatively you could create a template override on the existing Joomla Template. This is preferable to editing the files directly in com_content component as the template overrides will never be overwritten whereas the core files will be in any Joomla Updates. I should add, hopefully unnecessarily that this requires Joomla 1.5, 1.6, 1.7, 2.5 or 3.0 (although this is still in beta as of present). So make sure you're not using 1.0.
To create an alternative layout for the built in articles component the best way to do it is probably to create a template over-ride.
See this article on docs.joomla.org on "How to override the output from the Joomla! core"
Creating an alternative for an article layout is pretty straight forward. You can achieve this by using the core layout override with your published template(s).
First you want to get/copy the core article layout file:
components/com_content/views/article/tmpl/default.php
Then place it into your published template:
templates/YOURTEMPLATE/html/com_content/article/default.php
If the template you are using doesn't have the html folder, then you will have to create that folder and each folder to make that path correct.
Once you have this in place, all you need to do is make changes to that default.php file you have just place in the template and that is it!

Resources