Forums

Add js and css to custom listings

Popkorn 07 May, 2014
Hey guys!
I do a one custom listing but i dont where i can add my code JS and my css, where i can add this?
GreyHead 08 May, 2014
1 Likes
Hi Popkorn,

In CCv4 I did it like this (I imagine that v5 is the same). In the Custom Header box use code:
<?php
$doc = JFactory::getDocument();
$script = "
// add your JS here
";
$doc->addScriptDeclaration($script);
$style= "
// add your CSS here
";
$doc->addStyleDeclaration($style);
?>

Bob
Popkorn 08 May, 2014
Thanks for reply bob!
But one more question, i have 3 records with js.. i can add all this records in this code?
GreyHead 08 May, 2014
1 Likes
Hi Popkorn,

What do you mean by 'three records with JS' ???

Bob
Popkorn 09 May, 2014
Hi bob,
Not a simple archive with JS i have 3 archives with code JS. I can put the 3 archives in the same line?
Sorry for my english!
GreyHead 09 May, 2014
1 Likes
Hi Popkorn,

If you need to load files then you can use this code
<?php
$doc = JFactory::getDocument();
$doc->addScript(JUri::root().'some/file/url/file_name.js');
$doc->addStylesheet(JUri::root().'some/file/url/file_name.css');
?>
repeat the $doc->add . . . for each file.

Bob
Popkorn 09 May, 2014
I dont know why dont work for me..I'll be doing something wrong
And the last question.. The custom list is this http://www.datatables.net/examples/api/multi_filter.html
This model work on ccv4?
GreyHead 09 May, 2014
Hi PopKorn.

Sorry, I've never see datatables.net before and I have no idea if you can get it to work with ChronoForms.

Bob
Popkorn 12 May, 2014
Thanks for all bob, i will try to add this🙂
This topic is locked and no more replies can be posted.