Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Search problem with static page
Hi all,
I have a problem getting the search to include my new About (static) page.
The section and article names are “about”. The page name is “static”.
I am using a vanilla install of 4.2.0. The search works for the article “Welcome to Your Site!”.
I have the Textpattern Solutions book, have searched this forum, google etc, but still can’t get my head around where to insert the relevant search code. Should I put code in the page, article, or a form (misc or article) etc…
I would really appreciate if someone could point me in the right direction.
Many thanks in advance.
“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower
Offline
Re: Search problem with static page
Hi speeke
in the article tag add searchsticky="1"
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Search problem with static page
Colak,
Thanks for the tip. But would you mind giving me a bit more help?
How should I format the article tag, and where should I place it?
“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower
Offline
#4 2009-10-31 14:36:33
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: Search problem with static page
Speeke, have you set “Include in site search” to “yes” in the sections tab?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Search problem with static page
@uli, yes I have.
“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower
Offline
#6 2009-10-31 20:51:05
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search problem with static page
speeke wrote:
How should I format the article tag, and where should I place it
Search results are being displayed on the ‘default’ section (front page), so you need to look at your article tag on page template ‘default’. If you didn’t make changes to it, it looks like this:
<txp:article listform="article_listing" limit="5" />
Just change it to
<txp:article listform="article_listing" limit="5" searchsticky="1" />
Offline
Re: Search problem with static page
Good-oh, will give this a try soon. Thanks again Els.
BTW: I couldn’t find any reference to searchsticky at TextBook
Perhaps it could be added for future reference?
“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower
Offline
Re: Search problem with static page
speeke wrote:
BTW: I couldn’t find any reference to searchsticky at TextBook
Perhaps it could be added for future reference?
Bookmark Tag Reference. And see <txp:article />. Yes, it’s there.
Offline
Re: Search problem with static page
oops!
I was looking in the Search Tags Category
“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower
Offline
Re: Search problem with static page
OK, I’m still having problems with this.
Here’s what I have, and I hope someone can tell me where I’m going wrong:
Section
Name: About
Treat as a static section? Yes
Uses page: Static
Include in site search: Yes
Article
Name: About
Status: Sticky
Section: About
Search is the default installation (ie results for a search of text in Welcome to Your Site! article currently show up on the home page)
Page
Name: Static
Includes the following code:
<txp:output_form form="nav_top" />
<txp:article limit="1" form="static_article" status="sticky" searchsticky="1" />
Form
Type: Article
Name: static_article
Includes the following code:
<div id="intro">
<h2><txp:title /></h2>
<txp:excerpt />
</div>
<txp:body />
Form
Type: Misc
Name: nav_top
Includes the following code:
<div class="searchform">
<form method="get" action="<txp:site_url />">
<h2><label for="search-box">Search</label></h2>
<div>
<input type="text" value="" name="q" id="search-box" class="txt" />
<input type="submit" value="Go" class="btn" />
</div>
</form>
</div>
Please let me know if you need any further info/details.
Thanks in advance,
from frustrated newbie!!! :(
Last edited by speeke (2009-11-01 00:53:53)
“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower
Offline
Re: Search problem with static page
I also found the following code on the default page:
<txp:article form="article_listing" limit="5" />
(not <txp:article listform="article_listing" limit="5" />
as per Els’ comment #6)
which I’ve also changed to:
<txp:article form="article_listing" limit="5" searchsticky="1" />
BTW: My About article markup is set to “Leave text untouched”. Would this have any bearing on the search results?
Last edited by speeke (2009-11-01 01:00:10)
“People who value their privileges above their principles soon lose both.”
Dwight D. Eisenhower
Offline
#12 2009-11-01 01:20:33
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Search problem with static page
speeke wrote:
Section
Name: About
Treat as a static section? Yes
??? Is that a plugin?
Offline