Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2013-08-27 21:40:22

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

Re: Help with Advanced Search

wauterboi wrote:

is there a way to make it check to see if any results come back so I can alert the user if nothing comes back?

The usual if_search_results won’t do it in your case. Check if this convenes (don’t mind an eventual warning):

<txp:etc_query name="article" globals="_GET,_POST"><txp:article mapsize="{?size|%}" /></txp:etc_query>

<txp:if_variable name="article" value="">
	Nothing to see here.
<txp:else />
	<txp:variable name="article" />
</txp:etc_query>

Edit: removed specials="content" attribute, for security reasons. Actually, you don’t need a plugin for this little:

<txp:php>
	if(!($size = htmlspecialchars(gps('size')))) $size = '%';
	parse("<txp:variable name='size'>$size</txp:variable>");
</txp:php>

<txp:variable name="article"><txp:article mapsize='<txp:variable name="size" />' /></txp:variable>
...

Last edited by etc (2013-08-28 08:10:54)

Offline

Board footer

Powered by FluxBB