Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2012-10-12 07:43:28

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

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

progre55 wrote:

what happens is that it tacks the message onto the end of all searches — not just blank one.

That’s weird, I will check it. You can try to replace the internal etc_query by variable/if_variable combination:

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

Just be sure not to introduce extra spaces or linebreaks in value.

Edit: I have checked and found nothing in etc_query that could explain this behavior, at least in the latest version.

Last edited by etc (2012-10-12 13:47:23)


etc_[ query | search | pagination | date | tree | cache ]

Offline

#22 2012-10-12 19:57:57

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

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

progre55 wrote:

what happens is that it tacks the message onto the end of all searches — not just blank one.

I think I have spotted this behavior once, but am not able to reproduce it anymore. The only scenario I can imagine is a wrongly detected data markup, though I do not see how it’s possible. If so, the variable solution would be affected too, but appending markup=“raw” attribute to the external etc_query should solve the problem. Please let me now how it goes.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#23 2012-10-12 19:59:19

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

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

etc.

I will be testing over the wekekend and will get back to you on Monday to let you know. Thanks for the guidance.

progre55

Offline

#24 2013-01-08 18:00:25

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

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

I apologize to etc. for not commenting back — I was finally able to get this to work using by replacing the internal etc_query by variable/if_variable combination

Again — thank you etc. for all the assistance.

progre55

Offline

#25 2015-09-07 19:00:19

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

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

Hello People. First of all thanks for this incredible tutorial and plugins. I followed it and works as I expected.

I just wondered if there is a workaround to enter new default values to custom fields in order to the user doesn’t have to access to Custom fields on extension tabs. Also, I’d like the search form retrieves automatically all possible values and not to have modify this form every time there are a new values.

I mean, let’s suppose we add an new value to ‘color’ field or a new feature. I wouldn’t like to have modify the search box every time these default values change. I thought that it could be through using the categories as an alternative way to enter new values and to use the parent category as variable’s name. For example, to create the “color” parent category and its child categories as values (red, blue, white, etc).

I guess we would have to depend on an script to transform the values from categories into values for custom fields and set up what kind of input tag we want for them (checkbox, radiobuttons, select, etc).

Does it have sense this idea I propose?
Best regards
Fernando

Offline

#26 2015-09-07 19:50:34

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

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

Sorry, I don’t remember all the details of this tip, but “automatic” lists should be fairly easy to construct. Say, you store colors in custom_11, then this will give you all available options:

<txp:etc_query data="SELECT value FROM custom_fields WHERE name='custom_11_set'">
<option <txp:if_variable name="Color" value="{value?}">selected</txp:if_variable> value="{value?}">{value?}</option>
</txp:etc_query>

etc_[ query | search | pagination | date | tree | cache ]

Offline

#27 2015-09-08 18:20:32

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

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

Hey Oleg.
Just would be missing the way how our client would load new values without accessing into Custom Field tabs extension. I suppose it is not so simple in TXP. For example in Wordpress, each ‘Custom Post Type’ (in the example of this tutorial would be ‘vehicles’) can have its own page of categories (taxonomy) in the Admin and it’s ideal for a better UX.
Anyway, thanks a lot for this tip. I’ll try it later.
Best regards

P/d: I am subscriber to this topic but I am not receiving notifications. :/

Offline

#28 2015-09-08 20:04:55

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

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

gfdesign wrote #294546:

Hey Oleg.
Just would be missing the way how our client would load new values without accessing into Custom Field tabs extension. I suppose it is not so simple in TXP. For example in Wordpress, each ‘Custom Post Type’ (in the example of this tutorial would be ‘vehicles’) can have its own page of categories (taxonomy) in the Admin and it’s ideal for a better UX.

Hola Fernando,

I’m not sure transforming categories into cf is natural. From UX pow, what if we had some “Edit” button aside each cf on “Write” tab, which would open a modal window à la glz_cf? That could be doable, but would probably not survive to Stef’s upcoming cf paradise.

P/d: I am subscriber to this topic but I am not receiving notifications. :/

If I remember it well, that has something to do with language settings of your old account, was it Spanish?


etc_[ query | search | pagination | date | tree | cache ]

Offline

#29 2015-09-08 20:48:58

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,195

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

etc wrote #294548:

If I remember it well, that has something to do with language settings of your old account […]

Yup, you’re right. I hoped the issue was remedied forever. Fernado, can you please add a post with your problem to the topic linked here?

And did you receive an email from this topic? Please report to Robert about the outcome of that test, too. I.e. whether it’s related to this topic here or whether your problem is a general one.

Last edited by uli (2015-09-08 20:59:20)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#30 2015-09-08 21:10:15

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

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

Ok. Oleg.
Yes, I do understand what you mean. You know I am not a programming guy, but I understand a little about the TXP logic. Maybe, I am suggesting some incompatibles ideas but I’d like they are consider for future versions of Textpattern.
Many thanks for replying.
Best regards :)

Hi Uli
Unfortunately I haven’t received any message from that topic neither.
Meanwhile, I solved it using RSS subscription in this topic.
I’ll post a message in the topic you say.
Thanks for your concerns.

Offline

Board footer

Powered by FluxBB