0

I am trying to create a view displaying a description of the current taxonomy term. This view will be a block in the taxonomy/term/% page, so the idea is that it uses the argument passed to pick the description in the database.

My view works fine in the Views' preview but does not display any result on the pages which probably means that the argument is not passed to the block. Can someone help me fix my view?

enter image description here

EDIT

Contextual filter

enter image description here

The URL is /taxonomy/term/% and I am using pathauto aliases.

1
  • Could you please share your contextual filter settings? Also can you post the url you are trying to embed block to? Commented May 4, 2012 at 3:17

1 Answer 1

0

The URL is /taxonomy/term/% and I am using pathauto aliases.

If you're using aliases I assume that your URL is something like some/path/your-term-name.

In that case I had exactly the same issue a while ago. You should try setting Filter Value Type to "Term name converted to term ID and check "Transform dashes in URL to spaces in term name filter values".

Also make sure that proper value is provided to the filter.

In the WHEN THE FILTER VALUE IS NOT AVAILABLE section select Provide default value and then select Raw value from URL and specify url component to provide as a default value. Unfortunatel "Term ID from URL" option doesn't work as you might expect in case of aliases so you need either provide default value from URL using Raw value option or even using PHP Code option. If you choose this option, you might find the following piece of code useful:

$get = explode('/', $_GET['q']);
return $get[2]; //the "2" constant assumes that your term name is a third path component 

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.