Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-13 15:01:42

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Is there an "if URL" for the "head"?

I need to place 4 chunks of javascript into the “head” of the txplib_head.php file. Each chunk is used in a specific tab. Is there a way of saying something like “if_page_url=http://site_url/textpattern/index.php?event=page” then use this <script></script>?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#2 2007-12-13 15:09:53

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Is there an "if URL" for the "head"?

Yes there is:

if(gps('event') == 'page')

or just

if($event == 'page')

Cheers!

Last edited by Gocom (2007-12-13 15:11:19)

Offline

#3 2007-12-13 15:12:41

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Is there an "if URL" for the "head"?

Thanks Jukka. :)

Does that go inside or outside the <script> tags?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2007-12-13 15:41:17

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Is there an "if URL" for the "head"?

if(gps('event') == 'page') echo '<script></script>';

Offline

#5 2007-12-13 15:51:45

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Is there an "if URL" for the "head"?

Ok got it. Thanks Jukka. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2007-12-13 16:08:15

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Is there an "if URL" for the "head"?

no problem ;)

Offline

#7 2007-12-13 20:30:08

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Is there an "if URL" for the "head"?

Stuart, if you’re using messy URLs, wouldn’t chs_if_urlvar do the job?

Offline

#8 2007-12-13 22:24:13

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Is there an "if URL" for the "head"?

Els – this is part of my “A Bit Blue” admin style mixed in with some other stuff. The code I’m adding goes into the txplib_head.php file and is not “front-end” stuff. It needs to be there during “setup”. I’m working with Bert (hcgtv) on a couple of things and when v4.0.6 arrives we may have something special to put out there.

In the mean time I need to get on top of some code. :(

Last edited by thebombsite (2007-12-13 22:26:38)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#9 2007-12-13 23:29:34

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Is there an "if URL" for the "head"?

I should have read your post better…

BTW, your posts about this are making me curious ;)

Offline

#10 2007-12-13 23:33:44

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Is there an "if URL" for the "head"?

Well I could send you a file and you could try it out if you want but it must be a new install. Don’t overwrite anything. Try it on MAMP or XAMP or whatever. I need an email address though.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#11 2007-12-13 23:41:06

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Is there an "if URL" for the "head"?

LAMP it is. You’ve got mail :)

Offline

#12 2007-12-14 00:01:56

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Is there an "if URL" for the "head"?

As soon as I sort this Base64 stuff out it will be on it’s way. Say nothing. Mum’s the word. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB