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?

  • 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 Dec 17 '11 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. – Artur Dec 17 '11 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 Dec 17 '11 at 18:28
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 ;-)

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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