-
AuthorPosts
-
March 15, 2017 at 12:18 pm #1018609
We installed a component with plugin and modules but the js files of this component are not added in the head section
I tried :
$doc = JFactory::getDocument();
$doc->addStyleSheet(+++++++++++);
$doc->addScript(+++++++++++);but it not works
can you help me?
Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
March 16, 2017 at 1:50 am #1018778Hi
Have consulted the extension developer how they defined their file in the extension?
In template if you want to load external script you have options in the template options > Custom code Tab.Regards
March 16, 2017 at 9:46 am #1018981Hi Pankaj, Thanks for your reply.
I’m the developer of the extension and I have the possibility to customize my component to loads the js and css files with the php/Joomla code that you tell me.
I can’t use the options > Custom code Tab because every page of my component load different css/js files, in other way I have to load all files for all the webside pages.
Please, feel free to reply for any questions
I’m waiting from your reply soon.Pankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
March 16, 2017 at 9:53 am #1018988Hi
I am not sure about your extension how it developed. In template you have option to add custom code via custom tab or you can open Template folder /etc/assets.xml file and define your js file.
RegardsMarch 16, 2017 at 11:49 am #1019057Thanks again Pankaj,
So You are telling me that for every new components, modules etc that I will install in the website, that use your template, I have to check all css and js file that the item(components, modules) try to include in the website and add them in the the custom tab -> custom code ?
RegardsPankaj Sharma ModeratorPankaj Sharma
- Join date:
- February 2015
- Posts:
- 24589
- Downloads:
- 144
- Uploads:
- 202
- Thanks:
- 127
- Thanked:
- 4196 times in 4019 posts
March 16, 2017 at 1:05 pm #1019082Hi
Each component, extension comes with their own style and js file.
You was asking for how to add additional js file in this template. So these are two ways.
I never saw any popular component does not comes with template.
As you said yoy are also a developer i think you should add it in your extension rather than define it in template. -
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by Pankaj Sharma 7 years, 9 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum