Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2005-06-30 20:19:47

dmeehan
New Member
Registered: 2005-06-24
Posts: 9

Re: search only one section?

wait….I think I found it….

Current Version

Last edited by dmeehan (2005-06-30 20:23:08)

Offline

#14 2005-06-30 20:43:24

dmeehan
New Member
Registered: 2005-06-24
Posts: 9

Re: search only one section?

Hmmm…I can view the source there, but it would take an awful lot of cut and pasting to get it.

Any ideas about a zipped archive?

Offline

#15 2005-06-30 21:39:23

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: search only one section?

http://textpattern.net/wiki/index.php?title=Advanced_Topics
“Using Subversion (SVN) with a Textpattern Site” is the area to look.

Offline

#16 2005-07-01 01:30:44

dmeehan
New Member
Registered: 2005-06-24
Posts: 9

Re: search only one section?

awesome. thanks!

Offline

#17 2005-07-11 15:12:54

Ray
Member
Registered: 2004-03-02
Posts: 150

Re: search only one section?

Got it working (no problem) as per Zem and Mary’s instructions.

I’d like to take this to the next step by replacing the
<code>
<txp:search_input section=“mysection” />
</code>
with my own txp form called search_news.

I’ll use the following in my page template
<code>
<txp:output_form form=“search_news” />
</code>

And my TxP form (saved as Misc) will look like this…
<code>
<div id=“searchbox”>
<form action=”/” method=“get”>
<input type=“hidden” name=“s” value=“search” />
<p><label for=“searchbox”>Search Recent News Articles</label></p>
<input type=“text” name=“q” class=“searchfield” size=“10” />
<input type=“submit” class=“button” value=“Find” />
</form>
</div>
</code>

My question is, where should the [section=“mysection”] go? In my txp form to call my seacrh form or in the search form itself?

Last edited by Ray (2005-07-11 15:25:46)

Offline

#18 2005-07-11 17:03:04

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: search only one section?

This is great. Also is it possible to search links or images? It seems that you can only search articles currently.

Offline

#19 2005-07-12 00:33:01

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: search only one section?

Jeff: I don’t believe so (yet, anyway).

Ray: You’d point your form to the section url in question (action="/section-name"), that’s what that section parameter does.

Offline

#20 2005-07-12 00:35:17

Ray
Member
Registered: 2004-03-02
Posts: 150

Re: search only one section?

I’m just in the process of typing out how I got it to work. BRB

Offline

#21 2005-07-12 00:53:34

Ray
Member
Registered: 2004-03-02
Posts: 150

Re: search only one section?

I thought I had it working but no.

Yes, I understand the section parameter (that was a quick copy and paste… my bad).

OK, here are the tags and forms I using.

Call the search form on the news page
<code><txp:output_form form=“search_input” section=“news” /></code>

The news page article tag
<code><txp:article limit=“5” searchall=0 /></code>

The search_input form
<code>
<form action=”/news” method=“get”>
<input type=“hidden” name=“s” value=“search” />
<label for=“searchbox”>Search News Archives</label>
<input type=“text” name=“q” class=“searchfield” size=“10” />
<input type=“submit” class=“button” value=“Find” />
</form>
</code>

But it AIN’t werkin’! WHAT am i doing wrong here. I want to search the news section only and have the search results show up on a custom page.

Offline

#22 2005-07-12 01:12:47

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: search only one section?

You might try

form call
<txp:output_form form="search_input" />

form
<code><form action=”/search” method=“get”>
<label for=“searchbox”>Search News Archives</label>
<input type=“text” name=“q” class=“searchfield” size=“10” />
<input type=“submit” class=“button” value=“Find” />
</form></code>

search page
<code><?php $s = ‘news’; ?>
<txp:article limit=“5” searchall=0 /></code>

Offline

#23 2005-07-12 01:25:29

Ray
Member
Registered: 2004-03-02
Posts: 150

Re: search only one section?

I’m outta ideas here. I can not get both a section only search AND custom search results page cooperating.

Mary, Thanks for your input…. but I’m at a stand still here. Can’t figure it out.

Offline

#24 2005-07-12 01:55:12

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: search only one section?

But it AIN’t werkin’!

Care to elaborate?


Alex

Offline

Board footer

Powered by FluxBB