2

I'm having a problem with setting filter value from the URL. What I want to do is to list all terms in a taxonomy node, so I list all terms whose parent ID equals what's provided by URL. I have the relation set, I have the contextual filter set, but unfortunately when I enter %1 as the parent term ID value to be matched by the filter, it's treated literally and returns nothing. That's because no term has the ID of '%1'. However, when I expose the filter and type in the term ID, works as expected.

How do I use the placeholders in the filter definition?

3
  • Please clarify your question. List your fields, and filters, your path and any contextual filters you have set up and I should be able to help.
    – Ashlar
    Commented Dec 17, 2011 at 2:37
  • the setup can be as trivial as: path = taxonomy/term/%/list and I want to show only those taxonomy term whose parent term's tid == %1. I have set up (a) the contextual filter to capture the % in the url as the term id, (b) a relation to parent term (c) a filter criterion that says term id = %1, using the parent relation. While the view is executed, the (c) filter is filled with '%!' instead of the value captured from the url. Commented Dec 17, 2011 at 15:06
  • I've run into a site problem I need to address ASAP. In the meantime, Can you add an export of your view to your question? I am trying to duplicate your problem, but I am not sure I've got the same setup.
    – Ashlar
    Commented Dec 17, 2011 at 18:28

1 Answer 1

0

Since that moment I have messed with my views to a fubar state. But looks like I pinpont the rule of thumb that I haven't heard anywhere: when you set up a context filter, eg. for "Content: nid", you don't add it to the regular filter list on the left hand side. And you don't have to bother with %-style placeholders. At any rate, thanks JoeS for your readiness to help. I bet you will have a bunch of chances to help me out, as I seem to attract all kind of Drupal surprises ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.