Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2012-09-04 19:30:08

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

Adi:

Sorry for the delayed response. Will be working on this project next week and will let you know. Another project took priority and reason for the delay.

progre55

Offline

#12 2012-09-25 21:14:22

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

Adi:

Quick question — have been working on the project now — was about to make the change to the Beta and associated updates — if things go south — can I upload the old one without any issues. Just want to check before doing it since the rest of the porject or most of it is set and working with the old set up.

progre55

Offline

#13 2012-09-25 22:24:11

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,226
Website

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

adi_gps-0.2 is still available

Offline

#14 2012-09-28 20:36:25

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

etc:

Quick question, I have been unsuccesful in getting anything to come up if the search results come up empty. I removed the ? but am I missing something else. To test, I replaced <txp:article /> with garbage text — but nothing comes up —-

Just not sure what I am missing and to be honest I think everything to this point I tested always had something returned —-

progre55

Offline

#15 2012-09-28 21:11:14

etc
Developer
Registered: 2010-11-11
Posts: 3,287
Website

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

You mean, if some search criteria are set, but there is no match? Normally, you should modify article_custom inside etc_query:

<txp:article_custom
  {$?({?Model}|Model='<txp:variable name="Model" />'|)}
  {$?({?Color}|Color='<txp:variable name="Color" />'|)}
  {$?({?Style}|Style='<txp:variable name="Style" />'|)}
  {$?({?Features}|Features='<txp:variable name="Features" />'|)}>
    <txp:title /> and so on
<txp:else />
    no match
</txp:article_custom>

but it does not support <txp:else />, it’s pity. Try to replace it by a second etc_query:

<txp:etc_query globals="variable" data="{?Model}{?Color}{?Style}{?Features}">
  <txp:etc_query markup="raw"
    data='<txp:article_custom {$?({?Model}|Model="{?Model}"|)} {$?({?Color}|Color="{?Color}"|)} {$?({?Style}|Style="{?Style}"|)} {$?({?Features}|Features="{?Features}"|)} />'>
    {{?}}
  <txp:else />
    no match
  </txp:etc_query>
<txp:else />
  <txp:article />
</txp:etc_query>

Edit: sorry, you need double braces in {{?}}.

Last edited by etc (2012-09-28 21:25:31)

Offline

#16 2012-09-28 21:24:02

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

etc.

Weird — first time it returned a blank screen with the word “Nice Try.” — since then it has returned what I placed into it — so I think it is working fine now.

progre55

Last edited by progre55 (2012-09-28 21:25:59)

Offline

#17 2012-09-28 21:29:47

etc
Developer
Registered: 2010-11-11
Posts: 3,287
Website

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

As reedited, it works for me. If you have no luck with it, try to find some if_empty plugin.

Offline

#18 2012-09-28 21:30:32

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

Thanks.

Offline

#19 2012-09-29 08:52:14

etc
Developer
Registered: 2010-11-11
Posts: 3,287
Website

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

progre55 wrote:

Weird — first time it returned a blank screen with the word “Nice Try.”

Very strange, even with single braces in {?} I have no idea on which door it might have knocked to get this welcome. All it outputs for me in this case are concatenated values of {?Model}{?Color}{?Style}{?Features} variables, i.e. the data of the external etc_query tag.

Offline

#20 2012-10-11 20:37:24

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: [howto] Front End Search: Filter Articles With Drop-Down and Multi-Select Menu

etc:

The “Nice Try” I figured out is a TXP default when you have very long url’s. In advanced options, you can adjust the length, which removed that message.

I have tried numrous variations to try to get something to return if the serach resulst are empty. trying your above I thought worked, but what happens is that it tacks the message onto the end of all searches — not just blank one. I was unable to locate an empty plug in — any chance you could throw something together — I would be willing to pay for your time —-

Thanks.

progre55

Offline

Board footer

Powered by FluxBB