Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#76 2012-08-02 20:26:07

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

Re: etc_query: all things Textpattern

Ok. Definitely moving in the right direction :)

Now what happens — if I select XMRadio and Moon Roof it returns the articles that have both of them selected in the features field but ONLY those two items can be selected. If another item is also checked, it will not return that article even though it has those two also checked.

FYI, it does appear to be working with a combination of both pull downs and check boxes but for the above issue.

Offline

#77 2012-08-02 20:33:10

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

Re: etc_query: all things Textpattern

Ok, replace

<txp:variable name="Features"><txp:etc_query globals="_GET" data="{?Features||doarray($,htmlspecialchars).implode(|,$)}" markup="raw" argsep="," /></txp:variable>

by

<txp:variable name="Features"><txp:etc_query globals="_GET" data="%{?Features||doarray($,htmlspecialchars).implode(%,$)}%" markup="raw" argsep="," /></txp:variable>

Offline

#78 2012-08-02 20:46:25

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

Re: etc_query: all things Textpattern

SUCCESS!

Everything appears to be functioning as expected. Thank you for all of your assistance. I truly appreciate your time and efforts. If you do not mind, so that hopefully what has been done can be used by others — I had planned on creating a “How To” thread so that others will have a road map shhould they also need the ability to filter articles using drop downs and multi-selects —- and also know your skills …

Let me know if you have any type of Amazon Wish List to send something your way —-

progre55

Offline

#79 2012-08-02 21:13:46

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

Re: etc_query: all things Textpattern

Fine! You have helped me in debugging etc_query, so I am rewarded, thank you. Feel free to share, that’s the txp essence.

You may have problems with apostrophized Features like rock'n'roll, then remove doarray($,htmlspecialchars)., it should be safe.

Offline

#80 2012-08-02 21:25:11

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

Re: etc_query: all things Textpattern

progre55 wrote:

I had planned on creating a “How To” thread so that others will have a road map shhould they also need the ability to filter articles using drop downs and multi-selects

Yes, please do so. I could follow along to a certain point, hoping that I could trace back what was left out from the beginning once I’d have to build such a monster, but had to throw in the towel pretty soon.

It’ll certainly become a topic that’ll be visited regularly. Try googling this forum for “real estate” ;)


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

Offline

#81 2012-08-02 21:26:34

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

Re: etc_query: all things Textpattern

Uli:

I will do one either tonight or tommorrow so that we can get it up and everyone will be very pleased with its simplicity and results.

progre55

Offline

#82 2012-08-02 21:36:40

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

Re: etc_query: all things Textpattern

Cool, thanks!

(I’ll now shovel a heap of posts over to the etc_query topic where they belong to make it easier for the adi_gps readers and to promote etc_query a tad ;)


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

Offline

#83 2012-08-03 12:50:17

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: etc_query: all things Textpattern

TXP Tip for this please….!

Offline

#84 2012-08-03 21:22:18

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

Re: etc_query: all things Textpattern

For anyone interested, the tip – Front End Search: Filter Articles With Drop-Down and Multi-Select Menu was posted this morning.

Offline

#85 2012-08-04 13:29:46

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

Re: etc_query: all things Textpattern

Hi Jonathan, as soon as I get a decent internet connection (but this could take 3 weeks)! I couldn’t do better than progre55 on multi-select, but will try to find another example of conditional txp tag construction.

Offline

#86 2012-08-07 19:21:46

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

Re: etc_query: all things Textpattern

etc wrote (in adi_gps):

Everything between the problem statement and the final 4-5 posts can be safely trashed, I think.

progre55 linked right amidst one of these posts from his tutorial, so I thought it’s better to leave the thread readable and link from before the cluster to its end.


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

Offline

#87 2012-09-09 13:59:05

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

Re: etc_query: all things Textpattern

New version is out, with enhanced replace attribute for easy nodes insertion, more convenient syntax and new name attribute, to assign the output to a variable. Ready to go on the admin side if needed.

Many thanks to all who have tested it. Everything seems to work fine, so let it be version 1.0.

Offline

#88 2012-09-18 20:59:25

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: etc_query: all things Textpattern

I’m posting here because the comment form at TXPTips (on the archive tree with article counts tip) is marking my comment as spam:

Nice tip!
One thing: on the etc_query line, I’ve had to remove the $[ and the ]$.
If not, I would get the output as this:

2012 ([$7$])

Not sure why…


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#89 2012-09-18 21:16:14

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

Re: etc_query: all things Textpattern

Thank you for the report, Julian. The etc_query syntax has a little changed since, these $[]$ are not needed anymore.

Offline

#90 2012-09-18 21:39:55

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: etc_query: all things Textpattern

You are welcome. Thank you for this crazy plugin.
Here’s another one (while trying to wrap my head around this plugin, its syntax and XPath syntax):

Following the tip (the one linked above), I’ve tried putting the wraptag="ul" directly into txp:article_custom (and removed it from txp:etc_query), while keeping query="li".
But then, it didn’t work… why?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB