Jump to content

need to add script in head of every page


carplu

Recommended Posts

Ok, so think about this for a minute.

 

If you change a smarty template (header.tpl), then that has to be recompiled for the changes to take effect.

Now you have smarty re-compile disabled (never re-compile templates).

 

So what do you think would occur?

Link to comment
Share on other sites

Ok, so think about this for a minute.

 

If you change a smarty template (header.tpl), then that has to be recompiled for the changes to take effect.

Now you have smarty re-compile disabled (never re-compile templates).

 

So what do you think would occur?

When i switch on force compile i just see a blank page... if i change it back again i see the page but no script

Link to comment
Share on other sites

nah... when i add it to header or footer it was nowhere in the source code neither in bottom, when added to the html block it is in bottom so i think i'll leave it there... if it works it works :-)

 

and this way i won't have to remember putting it back when an update will be executed

Link to comment
Share on other sites

nah... when i add it to header or footer it was nowhere in the source code neither in bottom, when added to the html block it is in bottom so i think i'll leave it there... if it works it works :-)

 

and this way i won't have to remember putting it back when an update will be executed

 

is this included in CCC'ed .js files or is it standalone, i.e. called by itself at bottom?  (see source code)

Link to comment
Share on other sites

i don't know

 

i have added it to the themes header.tpl and also tried footer.tpl

 

when viewing source code using cmd +f to find the script it was not there

 

when i do it by using the html block it is in footer

 

i have all options in admin/advanced/performance regarding ccc etc. set to yes

Link to comment
Share on other sites

i don't know

 

i have added it to the themes header.tpl and also tried footer.tpl

 

when viewing source code using cmd +f to find the script it was not there

 

when i do it by using the html block it is in footer

 

i have all options in admin/advanced/performance regarding ccc etc. set to yes

 

it's simple to check, simply turn off java CCC and check source.  or click on the CCC'ed java call it will show you the java inside.

Link to comment
Share on other sites

When i switch on force compile i just see a blank page... if i change it back again i see the page but no script

thats good, it means your change is now being applied.  The blank page means you are receiving an error.  Most likely you are using javascript code that needs to be 'cleansed'. 

 

try placing your code within smarty literal tags...

{literal}
...your javascript goes here
{/literal}
  • Like 3
Link to comment
Share on other sites

×
×
  • Create New...