Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2009-09-26 12:07:19

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

Version 0.2 released

New features:

  • per-page and/or per-section file loading
  • use soo_required_files as a container tag containing additional files/forms to load
  • use the above in combination with per-article loading

Docs and downloads


Code is topiary

Offline

#14 2009-09-26 12:39:46

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: soo_required_files: per-article loading of JavaScript and CSS files

Thanks Jeff!

If I’ve understood well with the per-section feature I can load only a specific script for section, can’t I?

Last edited by candyman (2009-09-26 16:21:58)

Offline

#15 2009-09-26 14:11:41

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

Correct: only section.css and/or section.js (where “section” is the section name). However, if you wanted to load multiple files and/or forms for one section and that section shares a page with other sections you could do something like this:

<txp:soo_required_files>
	<txp:if_section name="this_section">
		this_file.js, that_file.js, this_form
	</txp:if_section>
</txp:soo_required_files>

Tag contents get loaded first, then per-page files, per-section files, finally per-article files/forms.


Code is topiary

Offline

#16 2009-10-04 11:00:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

Version 0.2.1 released

Fixed per-page/section loading in sub-directory installations


Code is topiary

Offline

#17 2009-11-30 15:46:39

Sunfoot
Member
From: Felanitx
Registered: 2009-02-07
Posts: 16
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

I have installed the soo_plugin_pref. But I have no access to the preferences, because there is no Options link showing up in the plugin list. I have never seen such an Option link there. What I have done wrong? If someone could give me a cue, I would be thankful.

Felix

Offline

#18 2010-07-11 14:51:32

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

Sunfoot wrote:

I have installed the soo_plugin_pref. But I have no access to the preferences, because there is no Options link showing up in the plugin list. I have never seen such an Option link there. What I have done wrong? If someone could give me a cue, I would be thankful.

Sorry I missed this when it appeared. To see a plugin’s Options link the plugin must be activated, and you must be running Txp 4.2.0 or later.


Code is topiary

Offline

#19 2010-07-11 14:54:21

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

Version 0.2.2 now available.

Tag contents can now include other Txp tags, allowing e.g. Txp conditional tags for further automation options.

So you can add files to the soo_required_files loading queue based on category, custom fields, etc.

Last edited by jsoo (2010-07-11 14:55:01)


Code is topiary

Offline

#20 2011-07-08 21:32:17

catnip
Member
From: Sydney Australia
Registered: 2006-07-29
Posts: 58
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

Jeff, can this plugin be used to load one of the styles in the Textpattern Styles tab, or only css files?

Offline

#21 2011-07-16 16:05:32

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

Sorry for not replying sooner; been on the road much lately. Currently no, the plugin just does Txp forms and external files. But I’ll give it some thought.


Code is topiary

Offline

#22 2011-07-17 09:27:53

catnip
Member
From: Sydney Australia
Registered: 2006-07-29
Posts: 58
Website

Re: soo_required_files: per-article loading of JavaScript and CSS files

Thanks!

Offline

#23 2013-08-20 17:59:44

dewyatt
New Member
Registered: 2013-08-20
Posts: 7

Re: soo_required_files: per-article loading of JavaScript and CSS files

I noticed soo_required_files doesn’t work on pages with the Draft status.
It seems to consider them to be Admin pages and throws the error “Tag error: <txp:soo_required_files /> -> Warning: extract() expects parameter 1 to be array, null given while parsing form None on page archive”.
I think it’s a bit counter-intuitive, is there are way to fix this?

Offline

Board footer

Powered by FluxBB