Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-11-08 02:29:11

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Retrieving URL vars

Anyone know if there’s a different way of retrieving GET/POST vars?

I know <txp:php>echo gps('var_name');</txp:php> works, but having to notextile it in articles can stuff up the layout.

Thanks,

Adi

Offline

#2 2008-11-08 04:02:19

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

Re: Retrieving URL vars

You can always write alias function for gps() and pack it as a plugin :D

if there isn’t already one, there should be. Possibly smd_SomeMegaPlugin1000GTX can do it, for sure ;D Surely some of those “library” kind Bloke badass plugins, do consist alias for that too :P

But anyway, write a little alias.

Other way is to use that php line as it is.

<txp:php>echo gps('var_name');</txp:php>
==<txp:php>echo gps('var_name');</txp:php>==
notextile. <txp:php>echo gps('var_name');</txp:php>

Depending, in which part of article it’s mentioned.

Offline

#3 2008-11-08 10:06:39

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Retrieving URL vars

Gocom wrote:

You can always write alias function for gps() and pack it as a plugin :D

I was hoping not to have to.

if there isn’t already one, there should be. Possibly smd_SomeMegaPlugin1000GTX can do it, for sure ;D Surely some of those “library” kind Bloke badass plugins, do consist alias for that too :P

I was surprised I couldn’t find one too. I’ll Google “smd_SomeMegaPlugin1000GTX” just in case.

But anyway, write a little alias.

No need, because the bit of trickery that works for me is:

==<txp:php>echo gps('var_name');</txp:php>==

because Textile generates the data inline – the other options end up on new lines, which break the paragraphs.

Thanks.

Offline

Board footer

Powered by FluxBB