1

I have created block and i want to give the only listed paths

i.e user/user_id ex: user/123

i have given user/* but it displays all pages where users pages are there.

i tried below waysenter image description here

and enabled PHPFILTER and tried this

enter image description here

2 Answers 2

1

Try "extended_block_visibility" module, install it and then on block setting page select last option "pages on which this php code will return true" and then you can write php code inside php tag like :

<?php
if(arg(0) == 'user' && is_numeric(arg(1))){
return TRUE;
}
return FALSE;
?>

But remember this code will save inside the DB and will break site if write wrong code. Alternatively you can define theme specific visibility using this module.

2
  • ok will try and let you know.
    – RaMeSh
    Commented Apr 7, 2016 at 11:44
  • That will definitely work if you will face any problem then let me know :) Commented Apr 11, 2016 at 12:09
0

As an option you can use path alias, for example If my user's page alias is /users/myusername then you can set users/* in Visibility settings. So it will be available on user/* page, but not on user/*/* pages.

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.