Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: etc_query: all things Textpattern
Then weird again. It should only generate a list of attributes from adi_gps
variables. What if you delete the linebreaks:
<txp:etc_query globals="variable" data="{?Color,Model,Price}">
<txp:article_custom {$?({?Model}|Model='<txp:variable name="Model" />'|)} {$?({?Color}|Color='<txp:variable name="Color" />'|)} {$?({?Price}|Price='<txp:variable name="Price" />'|)}
/>
<txp:else />
<txp:article />
</txp:etc_query>
Offline
#38 2012-08-01 21:51:00
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: etc_query: all things Textpattern
etc.
Here is what I have determined, it is based on the first item in this list: data={?Color,Model,Price}
The first variable allows the other two to work — but that is it — I can swap around the order and the functionality still works, but only if you use the first variable. (ie change Model to Color and you will then be forced to select Model to make the other two function.
progre55
Last edited by progre55 (2012-08-01 21:52:47)
Offline
Re: etc_query: all things Textpattern
Ah yes, I see, that’s because adi_gps
assigns it an empty value. Try to replace it with data=”{?Color}{?Model}{?Price}”
Last edited by etc (2012-08-01 21:55:00)
Offline
#40 2012-08-01 21:57:20
- progre55
- Member
- Registered: 2006-05-02
- Posts: 668
Re: etc_query: all things Textpattern
etc.
Success! Thank you for all your help. I shall now plow ahead and let you know what if anything else I discover. Thank Yuou again.
progre55
Offline
Re: etc_query: all things Textpattern
You are welcome, but it’s midnight in Paris, I’m falling offline :)
Offline
Re: etc_query: all things Textpattern
Hi, with txp 4.5 beta I am getting an error message now with the code used here (Actually my code is a bit different but the essentials are the same.)
Tag error: <txp:etc_query data='<txp:variable name="imgnav" />' query="a[@data-id='{?pic}']"> -> Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given while parsing form “None” on page “pic”
Error both on v.0.9 and 0.98
Offline
Re: etc_query: all things Textpattern
Hi Peter, are you sure to have the minimal required php version (5.3.8 – 5.3.10)?
Offline
Offline
Re: etc_query: all things Textpattern
I have no MAMP to test at hand, sorry. You need at least 5.3.8 (5.3.10 on WAMP), is it possible to upgrade? etc_query
uses very little of txp
functions, it works on 4.5 for me.
Offline
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!
Offline
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