Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
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
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
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
Pages: 1