Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Yesterday 14:39:30

astick360
Member
Registered: 2022-05-05
Posts: 24

Search only in the running section and only visible articles

I need information on how to limit search engine search only to articles on visible status and only for the running section. In the code I have a section given as a relative, and I would like to universally to check the system how the consuming is and searched for it only.

I will add the search engine as a form in different sections but it is always to be limited to articles in a given section, so I can not give relative values.

Offline

#2 Yesterday 16:27:00

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

Re: Search only in the running section and only visible articles

astick360 wrote #338873:

I need information on how to limit search engine search only to articles on visible status and only for the running section. In the code I have a section given as a relative, and I would like to universally to check the system how the consuming is and searched for it only.

I will add the search engine as a form in different sections but it is always to be limited to articles in a given section, so I can not give relative values.

Not sure about how to limit search to a section, although the idea cropped up before without any solution. The search only returnes live articles on the front end, unless you specifically use the searchsticky attribute.


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

Offline

#3 Yesterday 16:35:33

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,773
Website

Re: Search only in the running section and only visible articles

Hi, in addition to what colak mentioned, you can use the attribute searchall="0" in your txp:article tag to restrict the search results to the current section. Your search results need to be output in that section, of course. See the txp:article docs for information on both tag attributes.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB