Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-03 13:18:54

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

Using <txp:q />

Is there a more correct method to using the <txp:q /> tag in a search results header?

Last edited by thebombsite (2007-12-03 13:19:37)


Stuart

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

Offline

#2 2007-12-03 17:58:27

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Using <txp:q />

<txp:page_url type="q" />

Offline

#3 2007-12-03 18:07:58

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

Re: Using <txp:q />

The output of <txp:page_url type="q" />, when on a section page, is /section/?q=query_string. So I suppose the only way to just display the query string is still <txp:q />?

Offline

#4 2007-12-03 18:14:26

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Using <txp:q />

Can you add this to the template for that page:

<txp:php>
  global $pretext;
  dmp($pretext);
</txp:php>

Because <txp:page_url type="q" /> outputs $pretext['q'] which is exactly what <txp:q /> does.

Offline

#5 2007-12-03 19:14:24

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

Re: Using <txp:q />

Mmmm. Well using Ruud’s first suggestion <txp:page_url type="q" /> does in fact work without the extra PHP.

Els – your suggestion might be correct for the URL you show but on a search results page using section “search” the actual URL is /section?q=query_string and one less forward-slash might be what makes the difference.


Stuart

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

Offline

#6 2007-12-03 19:44:40

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

Re: Using <txp:q />

I should learn to copy and paste instead of typing too fast and then overlooking typos :-! typ="q" of course won’t work…
My apologies.

Offline

#7 2012-07-30 22:49:41

dylan-c
Member
From: Maine
Registered: 2012-07-09
Posts: 13

Re: Using <txp:q />

I am using theme Orange Crush and replaced that txp:q tag so that I don’t get an error.
I used <txp:page_url type=“q” /> instead (just stuck it right where the txp:q tag was previously) and got the following error:

Tag error: <txp:page_url type=“q” /> -> Textpattern Warning: Attribute values must be quoted on line 1060

Enclosing “page_url” in quotation marks removes the error:

<txp:“page_url” type=“q”>

Last edited by dylan-c (2012-07-30 22:53:31)

Offline

Board footer

Powered by FluxBB