rsanchez / dynamo

Makes Dynamic Parameters behave more like the Search module.
http://devot-ee.com/add-ons/dynamo/
10 stars 2 forks source link

Using & delimiter rather than | #3

Closed iankhoughton closed 12 years ago

iankhoughton commented 13 years ago

Hi, I need to limit search results by posts belonging to ALL categories rather than ANY selected category. Is this possible with Dynamo? If not, would it be possible to modify the plugin relatively simply? I'm not a PHP coder by any means - I tried a search and replace for | characters with & characters in mod.dynamo.php, but it wouldn't return any results.

Cheers!

rsanchez commented 13 years ago

On line 149 of mod.dynamo.php

change

$_POST[$key] = implode('|', $value);

to

$_POST[$key] = implode('&', $value);
iankhoughton commented 13 years ago

Thanks Rob - I tried changing that on its own as well, but I don't get any entries returned at all, no matter what categories I select (single or multiple). Any thoughts?

rsanchez commented 13 years ago

Here's what I recommend trying: add a standard channel:entries tag to the page for testing purposes, put your category selection in there manually as a parameter:

{exp:channel:entries channel="some_channel" category="7&8&9"}

And see if that returns any entries. This way we can tell if dynamo is causing the problem or not.

iankhoughton commented 13 years ago

Hi Rob - did just so. The regular entries tag pulled results, the Dynamo entries tag with pipe characters pulled results, but Dynamo with the modified mod.dynamo.php couldn't find anything. I've sent you an email with my template code - I'd really appreciate it if you could take a look, but I understand that this is not an officially supported plugin.

jamestflynn commented 12 years ago

Just an FYI if anyone else runs into this. If you want to limit by all you change to & as Rob says above but you also need to add urlencode around it for it to work properly. So:

implode(urlencode('&'), $value);