I need to place the selected taxonomy term from drop down list into my custom search path. [key] token is replaced only by what is entered in basic search box, which in my case is hidden. Is there any way to get [key] replaced by the value of selected option ?

BTW I changed the code from custom_search_taxonomy_form_alter function so it prints the values for options just as $term->tid, without the "c-" prefix, so I could use it as argument for my view search ...

Thanks,
Michal

CommentFileSizeAuthor
#3 terms_as_pattern.jpg141.04 KBathanor
#3 terms-id_as_pattern.jpg157.88 KBathanor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

athanor’s picture

I have three blocks with custom search boxes and each one has the same value of "custom_search_blocks_form" in inputs named "form_id" ...

Is this the correct way of how it should be done ?

jdanthinne’s picture

Status: Active » Needs review

Please download the DEV version, I've just added a [terms] token for the custom path.
Please review.

athanor’s picture

FileSize
157.88 KB
141.04 KB

I tried with [terms] and [terms-1] for vocabulary number 1 without success. When using [terms-1] i'm getting %252F value instead of the "c-3". [terms] aren't replaced by anything ...
I'm still concerned about same value of a form_id input. All three of them have "custom_search_blocks_form", without any IDs
Thank you,
Michal

jdanthinne’s picture

I've just committed changes to the DEV version.
I've reworked the whole process, not easy... just enter the [terms] token, and chose the terms separator below, and tell me if it works.

For the form_id value, that's normal, it's an internal (and hidden) input value created by Drupal (kind of "which module created this?" -> answer : "custom_search_blocks"). Don't worry about that.

athanor’s picture

I'm afraid it still does not work, at least for me ;) [terms] are replaced with %252F instead of selected taxonomy term id when path is defined like this: search/category/[terms]/[key]

And is empty when path looks like: search/category/[key]/[terms] ...

Thanks anyway ;)

jdanthinne’s picture

Status: Needs review » Needs work

Strange, it seems to be working on my side.
Do you have a test url where I can check your config?

jdanthinne’s picture

Status: Needs work » Active

I think that you were right about this form_id... can be a part of the problem, and opened a new issue for that (#971456: Blocks settings not submitted with multiple blocks).

jdanthinne’s picture

I think I've fixed #971456: Blocks settings not submitted with multiple blocks
Please download the new DEV version, and tell me if things are better for you.

athanor’s picture

Thanks jdanthinne. [term] replacement works fine, but [key] only in first block, in 2nd and 3rd returns empty values ...

jdanthinne’s picture

Strange. With my latest version, all blocks behaves as expected.
Can you tell me, for each block, what is the resulting url and what is written in the results page's search box.
Additionnaly, can you send me a copy of the source code generated for a page where all the blocks are included and what is their respective configuration, so I can try with the same settings.

jdanthinne’s picture

Status: Active » Closed (fixed)