Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#46 2012-08-02 09:45:26

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,475
Website

Re: etc_query: all things Textpattern

I’m confused re MAMP/WAMP versions. I thought that 5.3.5 came after 5.3.10 and that 5.3.10 came before not after 5.3.8 (because I thought 10 = 1 in these versions).

Anyway, I upgraded MAMP, now using PHP 5.4.4, and etc.query works fine and my problem is solved :-) Thanks!


Dozy P My attempt at music

Offline

#47 2012-08-02 13:56:15

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

Re: etc_query: all things Textpattern

Version 0.98: respects php scripting settings and user levels. Enhanced range generation.

{Edited to move the plugin code to the first post – Uli}

Last edited by uli (2012-08-07 19:36:54)

Offline

#48 2012-08-02 14:00:20

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

Re: etc_query: all things Textpattern

etc:

Thanks again for your help. I am hoping you can assist one more time. The above works great, but now I am looking to include not only drop down selections, but also a multi select option for the end user. I use glz_custom_fields for the back end.

With drop downs, the url returns this: .../search?Color=Blue&Model=Honda&Price=25000

When I add a multi select field called “Features”, I get the following url: .../search?Color=Blue&Model=Honda&Price=25000&Features=XMRadio&Features=Moon+Roof

For the multi select, I am using this in the search form:

dropdowns ... drop downs ... drop downs ...

<INPUT NAME="Features" TYPE="CHECKBOX" <txp:if_variable name="Features" value="XMRadio">selected</txp:if_variable>value="XMRadio"> XMRadio<BR>2
<INPUT NAME="Features" TYPE="CHECKBOX" <txp:if_variable name="Features" value="Moon Roof">selected</txp:if_variable>value="Moon Roof">Moon Roof<BR>

The problem is that the the multi select returns nothing if I just select that and nothing else. If I use a drop down in combination with a multi select it also returns nothing. If I just use drop downs without the multi select everything works fine.

I am using the following form for the search results:

<txp:etc_query globals="variable" data="{?Model}{?Color}{?Price}{?Features}?">
  <txp:article_custom
    {$?({?Model}|Model='<txp:variable name="Model" />'|)}
    {$?({?Color}|Color='<txp:variable name="Color" />'|)}
    {$?({?Price}|Price='<txp:variable name="Price" />'|)}
    {$?({?Features}|Features='<txp:variable name="Features" />'|)}
  />
<txp:else />
  <txp:article />
</txp:etc_query>

I tried multiple variations, but it seems to ignore the multi select field.

Any suggestions would be great.

Thanks.

progre55

Last edited by uli (2012-08-07 19:33:33)

Offline

#49 2012-08-02 14:16:28

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

Re: etc_query: all things Textpattern

Could you please show me the output of <txp:variable name="Features" /> for .../search?Color=Blue&Model=Honda&Price=25000&Features=XMRadio&Features=Moon+Roof?

Offline

#50 2012-08-02 14:29:43

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

Re: etc_query: all things Textpattern

Can do, but where do I place this to show you — do I put it in my Search Form or my Search Results Form —-

Offline

#51 2012-08-02 14:33:56

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

Re: etc_query: all things Textpattern

Just before the <txp:etc_query /> block. You can do it with <txp:php>global $variable; dmp($variable['Features']);</txp:php>.

Offline

#52 2012-08-02 14:36:55

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

Re: etc_query: all things Textpattern

What gets returned is the word Moon Roof

Offline

#53 2012-08-02 14:39:28

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

Re: etc_query: all things Textpattern

Then XMRadio is ignored? What it gives with the php code above?

Offline

#54 2012-08-02 14:42:54

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

Re: etc_query: all things Textpattern

Yes. The only word that gets displayed when both items are selected is the second item which in this case is Moon Roof. If I just select XMRadio and not Moon Roof then thatt gets returned.

Offline

#55 2012-08-02 14:49:40

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

Re: etc_query: all things Textpattern

Could you try it on .../search?Color=Blue&Model=Honda&Price=25000&Features[]=XMRadio&Features[]=Moon+Roof? And please give me the exact output of <txp:php> above.

Offline

#56 2012-08-02 14:57:57

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

Re: etc_query: all things Textpattern

The word Array pops up —-

Offline

#57 2012-08-02 16:51:20

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

Re: etc_query: all things Textpattern

The problem is that I know nothing about glz_custom_fields, and extract data with <txp:article_custom /> for multiple selection seems tricky. We need help from someone acquainted with glz_custom_fields: where to find its doc?

Offline

#58 2012-08-02 17:03:20

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

Re: etc_query: all things Textpattern

I was hoping that we may be able to use something like this esq_glzcfvallist in combination to what we have to assist with the efforts or I was thinking possibly what we have in combination with this solution

Last edited by progre55 (2012-08-02 17:03:39)

Offline

#59 2012-08-02 17:12:57

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

Re: etc_query: all things Textpattern

If you do not think the above are helpful — I can put a shout out and layout much better where things stand to see if anyone has some suggestions/guidance. Your assistance has been tremendiously helpful so please let me know.

Offline

#60 2012-08-02 17:36:45

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

Re: etc_query: all things Textpattern

I only need to know how and where glz_custom_fields stores its data, the rest is relatively easy. Does it add custom fields to textpattern table? How the multiselection values are represented?

Offline

Board footer

Powered by FluxBB