How to load js/css file in external_form


I'm making my original form by using external_form blocks.

I need to include js/css files ( put in /var/www/mysite/public_html/concrete5/concrete/blocks/external_form/forms/controllers ).

But I couldn't find the way to include these my js/css files into page's html head.

How can I do that?

Please tell me...

Sorry for my poor English...

Thank you


View Replies:
AcruxFarmer replied on at Permalink Reply
Try tracking the header file down here

That is if you are using the default theme. If you have loaded a custom theme go here


Good luck
ScottC replied on at Permalink Reply
add the js in the elements/header.php in your theme.

If this is some bloated javascript, I would probably write a new controller for that block that does addHeaderItem('js script src here');

That way it isn't being loaded when the visitor first hits the page without having to do some sort of "if" statement to see if the url is index.php with no querystring appended.
zurcxer replied on at Permalink Reply
1. Add your javascript/css file on your blocks/external_form/forms

2. Create a constructor on your form cotroller and add the following lines.
public function __construct($obj = null) {
            $html = Loader::helper('html');
            // add advanced tooltips to every page
            $v = View::getInstance();
            $v->addHeaderItem($html->javascript(BASE_URL. '/blocks/external_form/forms/js/contact_form.js'));

3. View source on your web browser. You can see that contact_form.js is added.