Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-12-18 14:31:46

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

how to limit the search to section, category and/or custom field?

hi,

how to limit the search to section, category and/or custom field?

I know article_custom can display articles limited to section, category and/or custom field. But that’s the story when we use the tag article_custom when designing a page. for example, if i have http://localhost/textpattern/sectionA/, in this case, i could use articles_custom tag display articles limited to section, category and/or customfield.

but i want it in form of search url? could i do that using TXP’s default search?

i have:
http://localhost/textpattern/sectionA/ <- display sectionA
http://localhost/textpattern/sectionA/?c=categoryA <- display category A in sectionA

but they are not flexible! how about custom_field?

thank you.

Last edited by HAC (2009-12-18 14:35:15)

Offline

#2 2009-12-18 16:00:00

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: how to limit the search to section, category and/or custom field?

i have read the tips for limit the search to a section, but that is not in my case, i want an url to reflect the search

bc.<txp:article searchall=0 /> on the page template for the section you want to search, and <txp:search_input section=“mysection” /> to display the form.

Offline

#3 2009-12-20 07:26:10

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: how to limit the search to section, category and/or custom field?

You can use txp if in the search form.

You put in search form some input to record custom_field or/and category to limit, then in form search get thoses informations (using adi_gps for ex) and use them like this:

<txp:if_category name='<txp:variable name="thecategory/>' >
<txp:title />
</txp:if_category>

Cheers

Offline

#4 2009-12-20 13:44:02

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: how to limit the search to section, category and/or custom field?

wow, tks so much! problem solved!

Offline

Board footer

Powered by FluxBB