addStyleSheet fails on J3.0 - joomla

I'm migrating some of my modules to J3.0 from J2.5 and suddenly I cannot add stylesheets to the document in J.30.
I've tried the following code with no success:
JHTML::stylesheet('style.css', 'modules/mod_instagallery/assets/css/');
$document = JFactory::getDocument();
$document->addStyleSheet('/modules/mod_instagallery/assets/css/style.css');
$document->addStyleSheet(JUri::base().'/modules/mod_instagallery/assets/css/style.css');
JHtml::stylesheet('modules/mod_instagallery/assets/css/style.css');
The CSS is located at MYROOT/modules/mod_instagallery/assets/css/style.css and the file is there in the file system. According to the page source, no css is added whatsoever.

See http://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_3.0_and_Joomla_Platform_12.1
JHtml::stylesheet() doesn't support a string as the second parameter anymore. This used to be the path to the file in Joomla 1.5 and has been removed now.
So the first one will fail due to this.
The others still work.

Problem solved. The CSS files appeared to not be loaded due to output buffering on the webserver.
Solved this by editing the php.ini file from
output_buffering = 4096
to
output_buffering = Off

Related

Magento is ignoring my changes in html files

I am trying to update cart page in Magento, and more specifically files from web/template/cart. I copied all these files to my custom theme, but somehow all changes are ignored and Magento still using files from vendor. It only happens to html file - phtml are updating correctly.
Tried to clear cache etc. but without any success.
Any ideas?
What file are you editing? Put some example for the name and directory. If the changes not applied so donĀ“t rewritting the files.

Bigcommerce uploading theme error

I downloaded the current theme, unzipped it, put some custom html, then zipped it, then reuploaded it. The uploading is successful however the processing failed. It showed a message:
There was a problem processing your theme
I tried renaming it and removing the html I inserted but it still happens.
If you are using a Stencil theme, you will need to bundle it with Stencil CLI before uploading:
https://stencil.bigcommerce.com/docs/bundling-submitting
If you are using a Blueprint theme, it should be uploaded to the template folder in WebDAV as described in this article: https://support.bigcommerce.com/articles/Public/Transferring-a-Custom-Theme-from-One-Bigcommerce-Store-to-Another
I ran into a similar issue last night. What resolved it was making sure none of my config.json strings were over the 64 letter limit for URLs. Once I removed these, my theme was able to be uploaded successfully.
UPDATE:
The urls that affected my bundle were located in the 'settings' section of my config.json. Don't worry about the meta section (your 'documentation_url' can be left how it is). I began getting the error after building out my schema.json file. After I connected my ID's in my schema.json file to the correlating ID's in my config.json file I started getting errors. I tracked down the ID that was causing the problem and it happened to have a string that was over 64 characters long. Once I removed the string my errors went away and the theme uploaded correctly.

Joomla cannot unset mod_languages/css/template.css

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!

Local host isnt working as soon as i include smarty file....MAMP

i have installed php storm ide, now i have download smarty, and followed this tutorial
https://memohnish.wordpress.com/2009/05/19/smarty-installation-on-wamp-and-xampp/
now i have created a test project in PHP storm, then created a php file.
As soon as i include a smarty file, browser shows an error
i have tried everything, nothing works, previously i have used the same method and everything used to work fine. Now, browser shows error.
second image shows php.ini file, please tell me if there is any error....
i have included the smarty libs directory as well.
dont know what to do...
Add this to the php file just before requiring Smarty and you probably will be able to see the problem description
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

Joomla opting out "~username/", so CSS, images, etc. are pointed in the wrong spot. Please help

I've made a clean install of Joomla and all settings were done correctly. However I'm not using a domain, instead I'm using a temp URL (http://IP.ADDRESS/~username/) with Joomla installed in the root public_html directory. But when I visit, no images or styles show up... and I noticed in the source all URL's are trying to use JUST http://IP.ADDRESS without the /~username/ ... so nothing is pointed in the right place.
How can I fix this?
Open configuration.php located in the web root.
Find the row that says var $live_site = '';
If the var is not empty, try making it so and save it.
If it's already empty, try typing in http://ip.address/~username/

Resources