Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-11 19:23:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,122
Website GitHub Mastodon Twitter

use js script in the head of a particular post

Is there a way to include external js documents in particular articles?
The js if very long and it is not going to be needed in most pages and the structure of the site does not allow me to create a new section for it.
I know of <code><txp:article_id /></code> but that does not help.

<i>Maybe this should go in either the feature requests or the plugin requests.</i>
Trying to make my self clear: Is there a method that I can do something like:
<br/>
<code><txp:if_article_id=“60”><script src=“javascriptdocument.js” type=“text/javascript”></script></txp:if_article_id><code>
<code><txp:if_article_id=“38”><script src=“javascriptdocument.js” type=“text/javascript”></script></txp:if_article_id><code>
<code><txp:if_article_id=“212”><script src=“javascriptdocument.js” type=“text/javascript”></script></txp:if_article_id><code>

or even better, is there a way for:

<code><txp:if_article_id=“60,38,212” ><script src=“javascriptdocument.js” type=“text/javascript”></script></txp:if_article_id></code>

Last edited by colak (2006-02-12 06:55:19)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2006-02-11 22:11:19

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: use js script in the head of a particular post

Colak,
Could you use this plugin for the if_article id list?

Matthew

Also, note that one of your code tags must not be closed?

Last edited by ma_smith (2006-02-11 22:11:57)


Offline

#3 2006-02-12 08:22:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,122
Website GitHub Mastodon Twitter

Re: use js script in the head of a particular post

matthew
thanks for that! I guessed I’ve missed it as it did not have a thread of its own


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB