Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
flat scripts in 4.7.2
I am changing our site to use the flat files but javascripts seem not to be working when using <script src="<txp:output_form form="jquery.js" context="flat.url" />"></script>
in spite of the fact that the source shows them just fine.
These include the videos, especially when they are under a jquery script which loads a number of them, and the slideshow on the top of most pages. Sample url demonstrates both issues. Any advice would be very much appreciated.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: flat scripts in 4.7.2
Hi Yiannis,
that should be format
<txp:output_form form="jquery.js" format="flat.script" />
Offline
Re: flat scripts in 4.7.2
Hi Oleg,
Thanks so much for the response. Unfortunately it does not seem to be it. I have changed all instances with your suggestion but it did not make any difference.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: flat scripts in 4.7.2
I am also checking the console which seems to be giving me these errors which were not there before. All I did was to copy/paste all the js scripts from spf_javascript to the forms under the JS (Application/Javascript)
form type.
SyntaxError: missing ) in parenthetical jquery.js:4:1250
ReferenceError: jQuery is not defined[Learn More] responsiveslides.js:8:1
<anonymous>
http://www.neme.org/themes/neme960/forms/js/responsiveslides.js:8:1
ReferenceError: $ is not defined[Learn More] the-idea-of-the-avant-garde:583:1
<anonymous>
http://www.neme.org/events/the-idea-of-the-avant-garde:583:1
ReferenceError: jQuery is not defined[Learn More] bxslider.js:1:1
<anonymous>
http://www.neme.org/themes/neme960/forms/js/bxslider.js:1:1
ReferenceError: $ is not defined[Learn More] the-idea-of-the-avant-garde:602:1
<anonymous>
http://www.neme.org/events/the-idea-of-the-avant-garde:602:1
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: flat scripts in 4.7.2
To make it work, I had to delete all scripts in the themes js folder, replace them with the original flat files and am still calling them with <txp:output_form form="jquery.js" format="flat.script" />
. Would this imply that there is something wrong with the way the JS is saved?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: flat scripts in 4.7.2
colak wrote #315742:
Would this imply that there is something wrong with the way the JS is saved?
I hope no, I had no problem as far with any of my scripts. But storing a globally used third-party jquery.js
as form is rather unusual. Do you really need to modify it, ever?
Offline
Re: flat scripts in 4.7.2
etc wrote #315743:
I hope no, I had no problem as far with any of my scripts. But storing a globally used third-party
jquery.js
as form is rather unusual. Do you really need to modify it, ever?
I do not remember ever modifying it but isn’t the idea of the themes that we can just take that folder and distribute it as a complete site template? The problem with adding the jquery or any other such scripts afterwords is the otherwise very useful Delete unused templates from disk on export
in the themes tab.1
1 Admittedly I did not test Update from Disc
yet.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: flat scripts in 4.7.2
colak wrote #315748:
isn’t the idea of the themes that we can just take that folder and distribute it as a complete site template?
It suffices to include <script src="path/to/cdn/jquery.js"></script>
in your templates. Chances are, this (widely used) script is already in users cache, saving them extra download. Or put it in some separate directory not overwritten by themes manager.
Offline
Re: flat scripts in 4.7.2
etc wrote #315749:
Or put it in some separate directory not overwritten by themes manager.
Does the manager override the whole of the themes directory or could I just have a folder in there, call it javascripts, and serve the large scripts from it?
Also:)… I am trying to phase out the rah_external_output
plugin. To my question in this post you wrote:
Yes, jointly with
<txp:header />
tag.
But I’m not sure how to make it work.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: flat scripts in 4.7.2
colak wrote #315750:
Does the manager override the whole of the themes directory or could I just have a folder in there, call it javascripts, and serve the large scripts from it?
AFAIK, only forms
, pages
and styles
folders are synced. Everything else inside themes folders is kept intact.
But I’m not sure how to make it work.
In rah_external_output
forms you can set headers this way:
;Cache-Control: no-cache, no-store, must-revalidate
In 4.7.2 this is done with
<txp:header name="Cache-Control" value=" no-cache, no-store, must-revalidate" />
Offline
Re: flat scripts in 4.7.2
So let me get this right as I know I am doing something wrong:)
I created a miscellaneous form and called it hello
.
In the form I added
<txp:header name="Cache-Control" value=" no-cache, no-store, must-revalidate" />
<p>Hello world!</p>
I guess that the url of the form is http://www.domain.tld/?f=hello
but nothing seems to be parsing as visiting the url I only get an empty page.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline