Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-04-10 05:37:02
- TheWorkingchair.com
- Member
- Registered: 2006-04-10
- Posts: 12
Search Box and Categories do not work.
I have just recently installed textpattern on my new website, and I was attempting to clean up some of the sections, categories and forms that I didn’t need, but I think in the process of my doing that, I may have deleted something that I needed. Whoops!
I was kinda stupid and didn’t backup anything when I did this, so I am thinking that is where the problem lies, but I could be wrong. If you go to theworkingchair.com, and try to do a search, it just takes you back to the index page. (I have taken the categories list off the frontpage for the time being, but you can see them on an article page)
I don’t really understand how the search function works, and I saw that on my default layout it has <txp:search_input /> or whatever but I couldn’t find this under forms or anything.
Does anyone know what I need to do to solve this problem?
Offline
#2 2006-04-10 15:54:00
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search Box and Categories do not work.
Look if you’ve still got the search_results form, if not, you can get it here.
Offline
#3 2006-04-10 15:55:29
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search Box and Categories do not work.
TheWorkingchair.com wrote:
I don’t really understand how the search function works, and I saw that on my default layout it has
<txp:search_input />
or whatever but I couldn’t find this under forms or anything.
(Just quoting this to show your code.)
The tag <txp:search_input />
displays the search input area, like the one on top of your left column.
Last edited by els (2006-04-10 15:58:06)
Offline
#4 2006-04-10 19:07:39
- TheWorkingchair.com
- Member
- Registered: 2006-04-10
- Posts: 12
Re: Search Box and Categories do not work.
I do have the search_results form and this is what is in it:
<code><h3><txp:permlink><txp:title /></txp:permlink></h3>
<p><txp:search_result_excerpt /><br/>
<small><txp:permlink>#<txp:permlink /> · <txp:posted /></small></p></code>
How does the search_input form know to access the search_results form? I would think that is where the problem lies, because I can’t tell what page, much less what forms search_input accesses or whatever.
Offline
#5 2006-04-10 20:18:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search Box and Categories do not work.
By default the search results use section ‘default’, i.e. your home page, and the search_results form. All you need is a <txp:article />
tag on your default page, is it possible that you don’t have one? Otherwise try adding this
<code>
<txp:if_search>
<txp:article />
<txp:else />
here your code for displaying ‘normal’ articles
</txp:if_search>
</code>
Offline
#6 2006-04-11 01:06:35
- TheWorkingchair.com
- Member
- Registered: 2006-04-10
- Posts: 12
Re: Search Box and Categories do not work.
Okay, that worked like a charm. Thanks a million!
I tried clicking on a category on an article page, and I still have the same problem. I am assuming this is because the category selections revert to the default page as well.
Is there any way to change the page that the categories link to?
Last edited by TheWorkingchair.com (2006-04-11 01:06:48)
Offline
#7 2006-04-11 06:37:10
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search Box and Categories do not work.
You’ll have to handcode the links to achieve this. See this example.
Offline
Pages: 1