Loading an external CSS file

More
2 years 7 months ago #80659 by nikitagupta2106
Hi,

My URL to show the profile is: http://localhost/jj/content_page/item/6-xxx

I would like to load this line of code to load external CSS file media print: 
Code:
<link href="[url=http://localhost/jj/templates/protostar/css/print.css?1.0]/jj/templates/protostar/css/print.css?1.0[/url]" rel="stylesheet" media="print" />

How do I go about doing this? I understand this is Joomla's templating problem but since it doesn't have a menu ID, I'm unable to detect the page and load it.

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #80663 by ggppdk
Replied by ggppdk on topic Loading an external CSS file
Hello

you can add this line at the very top of layout files
item.php and item_html5.php

of the FC template assigned to the item TYPE of this item
if it is a core template, remember to duplicate it and then modify the files

e.g. duplicate "default" FC template as "mytype"
and then edit type to set the layout parameter
and then modify files item.php and item_html5.php


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago - 2 years 7 months ago #80665 by nikitagupta2106
Thank you.

What is the difference between item.php and item_html5.php?

I got it working. For anyone who might want to do the same, here's the code I used to load the print.css:
Code:
JFactory::getDocument()->addStyleSheet(JUri::base(true).'/path/css/print.css', array('version' => '1.0', 'relative' => true), array('media' => 'print'));
Last edit: 2 years 7 months ago by nikitagupta2106.

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #80733 by micker
Replied by micker on topic Loading an external CSS file
use item_html5 for last html markup (we will remove other)

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.266 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline