Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-10-29 09:40:36
- castanet
- Member
- From: Oxford
- Registered: 2005-03-19
- Posts: 97
Category browse not working
Ok, I’m stuck. I moved the search and category browse features from the front page to a section and, of course, they wouldn’t work. After extensive forum research, I’ve got the search working by creating a separate Search section and Search Page template (with an <txp:article /> tag) and changing the search tag to:
<txp:search_input section=“search” label=“Search” wraptag=“p” />
It works, not brilliantly, but good enough for now. With the drop-down category box it’s not so easy.. I created a new form that looks like this:
<form action=”/index.php” method=“get”>
<input type=“hidden” name=“s” value=“search” />
<p>Sort by Location<br /><select name=“c” onchange=“submit(this.form)”>
<option value=”“></option>
<option value=“town”>Town</option>
<option value=“country”>Country</option>
<option value=“State”>State</option>
</select></p><noscript><input type=“submit” value=“go” /></noscript></form>
and replaced <txp:popup type=“c label=“Sort by budget (€) or by Location” wraptag=“p” /> with <txp:output_form form=“new_search” />
Selecting a category brings up the search page but no results. I think I’ve gone word blind trying to work this out. Thanks in advance for any help
The tag trace for the search section is:
<code><!— txp tag trace:
<txp:css />
<txp:page_title />
<txp:article />
<txp:permlink><txp:title /></txp:permlink>
<txp:title />
<txp:search_result_excerpt />
<txp:permlink><txp:permlink /></txp:permlink>
<txp:permlink />
<txp:posted />
—></code>
The tag trace for the section with the Browse Category form (just in case) is:
<code><!— txp tag trace:
<txp:css />
<txp:page_title />
<txp:search_input section=“search” label=“Search” wraptag=“p” />
<txp:output_form form=“new_search” />
<txp:article_custom form=“mainarticle” limit=“100” section=“ventas_archive” sortby=“Posted” sortdir=“desc” listform=“mainarticle” />
<txp:if_individual_article>
<h3><txp:title /></h3>
<txp:body />
</txp:if_individual_article>
<txp:if_article_list>
<h3><txp:title /></h3>
<p><txp:excerpt /></p>
<txp:permlink>Details…</txp:permlink>
</txp:if_article_list>
<txp:title />
<txp:excerpt />
<txp:permlink>Details…</txp:permlink>
—></code>
Offline
#2 2005-10-30 00:39:48
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Category browse not working
You’re using a txp:article_custom tag inside an article form, not a page template? That could be the problem.
Alex
Offline
#3 2005-10-30 08:58:56
- castanet
- Member
- From: Oxford
- Registered: 2005-03-19
- Posts: 97
Re: Category browse not working
No. The txp:article_custom tag is on the page template in which my customised Browse Category form also appears. The form is
<code><form action=”/index.php” method=“get”>
<input type=“hidden” name=“s” value=“search” />
<p>Sort by Location<br /><select name=“c” onchange=“submit(this.form)”>
<option value=”“></option>
<option value=“town”>Town</option>
<option value=“country”>Country</option>
<option value=“State”>State</option>
</select></p><noscript><input type=“submit” value=“go” /></noscript></form></code>
The line input type=“hidden” name=“s” value=“search” calls up the Search section which uses the search page template.
Offline
#4 2005-10-31 09:19:00
- castanet
- Member
- From: Oxford
- Registered: 2005-03-19
- Posts: 97
Re: Category browse not working
Anybody? Is there a thread I’ve missed?
Offline
#5 2005-11-03 16:08:42
- castanet
- Member
- From: Oxford
- Registered: 2005-03-19
- Posts: 97
Re: Category browse not working
Solved. Just to tie this thread up, the answer to my problem was the following piece of code placed on the default page template.
<code><txp:if_category>
my code for a category list
<txp:else />
my front-page code
</txp:if_category></code>
Thanks to Stuart for the help
Offline
Pages: 1