SPIP

[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [ru] [sk] [sv] [tr] [uk] [vi] [zh] Espace de traduction

Download
Home > English documentation > Webmasters > A few examples of loops > Presenting the results of a search by sector

Presenting the results of a search by sector

November 2010

All the versions of this article:


All that’s needed is to include the search loop inside another section loop that select the top level sections only; inside the search loop itself, we then add in the "id_secteur" criterion to limit the search to the current sector.

Note that the sector title is only displayed if the search provides successful results for the sector in question. Aside from that, each sector is restricted to displaying only the top five classed articles in decreasing order of relevancy.

It is important, however, to note that the search will be performed as many times as there are sectors (at the root level), so the processing time could be quite long.


Show the template of this page Site powered by SPIP | Translation area | Private area