How does one get taxonomy term contextual filters with varying levels of depth to validate from the URL? I have a block of dynamic content, and its display is dependent upon taxonomy term hierarchies appearing in the URL. I have output the title field of my nodes as a link: [path]/[name]/[name_1]/[name_2]/[name_3]

This is working well for terms which possess all levels of depth: united-states/new-york/new-york-city/manhattan, but not for those which have fewer: united-states/new-york/buffalo or united-states/rhode-island. I am finding that terms as in the latter two examples are appended to the URL with extra slashes: mysite.com/articles//united-states/new-york/buffalo andmysite.com/articles ///united-states/rhode-island. Presumably this is because of the empty values. Notice also that the slashes precede the highest level terms ([name]/[name_1]) despite my having designated them to appear first after the path. I tried configuring a new block to appear when validating taxonomy terms from later path components, but had no success.

Comments

svouthi created an issue. See original summary.

svouthi’s picture

After consulting with a Drupal developer, I decided to output the taxonomy term path (using Extended Path Aliases and Views Term Path modules) with the term id prepended to the URL. For my taxonomy, my path pattern now looks like: [term:tid]/[term:parent:parent:parent:name]/[term:parent:parent:name]/[term:parent:name]/[term:name] I set my contextual filter to validate on the tid to get around the varying depth issue.

MustangGB’s picture

Status: Active » Closed (outdated)

Closing this as outdated to tidy up a bit around here. If you're still having problems with the latest release please create a new issue.