where to add <link> to css for category layout

More
13 years 2 months ago #18880 by ViveLeFlexicontent
Dear Flexicontent friends,

I have a table in category view for which I use an stylesheet
Code:
<link media="print, projection, screen" type="text/css" href="components/com_flexicontent/assets/xxxxx.css" rel="stylesheet" />
so this way I can use an external stylesheet, and I can choose the layout I want for the tables of each separate category. Now the problem I'm having is html validation, the code belongs in the <head> tag.

I've been trying to find the right place to put it for so long, but I can't seem to succeed.
Can anyone help me by telling me where the <head> is for the category view?
I tried adding it in the index.html <head> but it didn't work.
And I can't use it in my templates head tag cause I use different versions depending on the table and the layout I want for it.

This is the error im getting when I validate the html:

document type does not allow element "link" here

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


Thanks in advance

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

More
13 years 2 months ago #18886 by kenmcd
.
The FLEXIcontent templates only affect a portion of the page.
There are no <head> or <body> tags allowed, it is all in the body.

You can add CSS files to the Joomla page head with some PHP code in your template.
It is probably a good idea to keep the CSS file with the FLEXIcontent template.
Code:
// add a custom CSS file to page head <?php $doc =& JFactory::getDocument(); $doc->addStyleSheet( JURI::root( true ).'/components/com_flexicontent/templates/my_template/css/my_category.css' ); ?>

Add the code near the top of your template file.
Obviously change the path for your actual file name and location.
.

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

More
13 years 2 months ago #18901 by ViveLeFlexicontent
:D Awesome, it worked, and so easily.
Thank you so much!

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

More
13 years 2 months ago #18915 by micker
great tips

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.

More
13 years 1 month ago #19194 by igcorreia
This works perfectly, how about a .JS file?

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

More
13 years 1 month ago #19196 by ggppdk
Try something like:
Code:
<?php // add a custom Javascript file to page head $doc =& JFactory::getDocument(); $document->addScript('components/com_flexicontent/templates/mytemplate1/js/myscript.js'); ?>


-- 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.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.362 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