You are not logged in.
This plugin, in combination with a custom field, allows you to load JavaScript and CSS files in the document <head>, on a per-article basis. Useful if you use a JavaScript/CSS package such as Slimbox and only want to load the relevant files on pages where you actually need them.
Version history
0.2.2, released 2010/07/10
0.2.1, released 2009/10/04
0.2, released 2009/09/26
soo_required_files tag now works either as single or container tag
0.1.1, released 2009/09/18
Documentation, download, and examples
Last edited by jsoo (2010-07-10 22:40:03)
Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.
Offline
Jeff
thanks for your plugins!
— Steve
Textile | My plugins on GitHub | @netcarver
Offline
Thanks Steve — great to see you’re still around the forum. I won’t read too much into this, though ;)
Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.
Offline
jsoo wrote:
This plugin, in combination with a custom field, allows you to load JavaScript and CSS files in the document
<head>, on a per-article basis. Useful if you use a JavaScript/CSS package such as Slimbox and only want to load the relevant files on pages where you actually need them.
Hi J Soo… apologies for not getting this. I’m not sure why this cannot be achieved with <txp:if_article_id ="1,2,5" >... or with <txp:if_custom_field name="javascript" val="js">
neme.org | neme-imca.org | hblack.net | LABS
Offline
colak wrote:
I’m not sure why this cannot be achieved with
<txp:if_article_id ="1,2,5" >...
It can. It just becomes terribly awkward if you’re talking about more than one or two files.
or with
<txp:if_custom_field name="javascript" val="js">
Only allows one value in the field.
Last edited by jsoo (2009-05-15 18:07:26)
Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.
Offline
It’s nice to have this functionality as a plugin.
Thanks, jsoo.
I also think it could be done (not so) easily using custom fields + built-in tags (as colak posted) mixed with smd_each (yes, it requires a plugin too…, althought smd_each can also be used for other tasks in a site…).
Offline
Good pointer. It’s hard to keep up with all of Bloke’s plugins! It could definitely be done as you say, although I suspect would involve some <txp:php> to get the preg_match() stuff I do to differentiate between files and form names. (I could easily be overlooking something, though.)
Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.
Offline
Version 0.1.1 just released. The only change is compatibility with the soo_plugin_pref plugin preference management system.
Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.
Offline
The plugin is very interesting but, at least, one article must be published to load JavaScript or CSS for a custom page. Is there a way to choose the relevant files without any article?
Offline
candyman wrote:
The plugin is very interesting but, at least, one article must be published to load JavaScript or CSS for a custom page. Is there a way to choose the relevant files without any article?
No, the plugin is intentionally article-based. Can you give me an example of the situation you have in mind?
Txp tags not doing what you expect? Learn to use a tag trace. And the Tag Reference.
Offline