Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-06-28 13:24:39

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

A predefine search

Hi at all.

I’m writing a multilanguage website and i need to search into a website only into defined section.

My website ha 5 section for each language, so i must search only in 5 section with the same language of search form.

There is a solution?

Offline

#2 2012-06-29 10:48:29

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: A predefine search

With one section per language you could probably use section='<txp:section />' attribute of <txp:search_input />, in combination with <txp:if_section name='<txp:section />'> in search_results form. With 5 sections it seems tricky without much code replication.

Last edited by etc (2012-06-29 10:49:06)

Offline

#3 2012-06-29 15:53:06

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

Re: A predefine search

Yes but in this case i can searh only in one section at time. I must search in 5 sections at time but not in 6.

Offline

#4 2012-06-29 18:10:13

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: A predefine search

You could combine many

<txp:if_section name="en_1,en_2,...">
<txp:if_article_section name="en_1,en_2,...">
...

in search_form. But this is a bad solution anyway, since it breaks pagination.

I would use five categories instead of five sections, if possible, and put searchall="0" in <txp:article />.

Offline

#5 2012-06-30 17:32:24

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,007
Website GitHub Mastodon Twitter

Re: A predefine search

MarcoK wrote:

Hi at all.

I’m writing a multilanguage website and i need to search into a website only into defined section.

My website ha 5 section for each language, so i must search only in 5 section with the same language of search form.

There is a solution?

Hi Marco

I would go for one section/language and categories as it would make your search much easier.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB