Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited title
Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

How tocan I show/hide a block on a specific urltaxonomy URLs depending on term depth?

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182
added 102 characters in body
Source Link
Justme
  • 1.3k
  • 1
  • 10
  • 30

I need to show blocks on different url's.

Block1 
Should be displayed on:
branches/taxonomytermlevel1
But not on
branches/taxonomytermlevel1/taxonomytermlevel2

Block2 
Should be displayed on
branches/taxonomytermlevel1/taxonomytermlevel2
But not on
branches/taxonomytermlevel1

WatThe terms /taxonomytermlevel1/taxonomytermlevel2 are variables (elements in some taxonomy list)

What is the most easiest way to do this? I think a php script in the block display visibility setting would be the trick and so I tried some code there but I did not succeed.

Some code I have now is e.g.:

<?php
if (empty(arg(3))) {
  return TRUE;
}else {
  return FALSE;
}
?>

Any suggestions?

I need to show blocks on different url's.

Block1 
Should be displayed on:
branches/taxonomytermlevel1
But not on
branches/taxonomytermlevel1/taxonomytermlevel2

Block2 
Should be displayed on
branches/taxonomytermlevel1/taxonomytermlevel2
But not on
branches/taxonomytermlevel1

Wat is the most easiest way to do this? I think a php script in the block display visibility setting would be the trick and so I tried some code there but I did not succeed.

Some code I have now is e.g.:

<?php
if (empty(arg(3))) {
  return TRUE;
}else {
  return FALSE;
}
?>

Any suggestions?

I need to show blocks on different url's.

Block1 
Should be displayed on:
branches/taxonomytermlevel1
But not on
branches/taxonomytermlevel1/taxonomytermlevel2

Block2 
Should be displayed on
branches/taxonomytermlevel1/taxonomytermlevel2
But not on
branches/taxonomytermlevel1

The terms /taxonomytermlevel1/taxonomytermlevel2 are variables (elements in some taxonomy list)

What is the most easiest way to do this? I think a php script in the block display visibility setting would be the trick and so I tried some code there but I did not succeed.

Some code I have now is e.g.:

<?php
if (empty(arg(3))) {
  return TRUE;
}else {
  return FALSE;
}
?>

Any suggestions?

Source Link
Justme
  • 1.3k
  • 1
  • 10
  • 30
Loading