2

I declared a block to display the 3 most recent articles published and I would like to display it on a specific page so I added /my-page/ into the block page list but it didn't worked. I then changed it to /my-page* and it worked but I ended up getting my block on /my-page/other-content which is not what I wanted.

Moreover if I declare a list of page and a content type, my content type is not taken into account.

Am I doing something wrong ?

leymannx
  • 5,138
  • 5
  • 45
  • 48
Tibo
  • 523
  • 1
  • 8
  • 20

1 Answers1

2

Could you first of all simply try /my-page without the trailing slash, please.

Apart from that you may have a look a the following module:

Block Exclude pages

Then you'd say Show for the listed pages

/my-page*
!/my-page/*

And regarding the content types there was a bug with ctools which still seems to be unfixed. So you may have a look at:

Block Visibility Groups

Here you can configure a visibility group which hides blocks for a specific content type.

The visibility groups also are reusable, that means you can apply the same settings on multiple blocks.

leymannx
  • 5,138
  • 5
  • 45
  • 48
  • I tried /my-page, I forgot to mention it, but it doesn't work (which surprised me ...) – Tibo Mar 29 '18 at 12:08
  • @Tibo – I see. Then try Block Exclude Pages with these rules: `/my-page*` and `!/my-page/*`. – leymannx Mar 29 '18 at 12:10
  • I will try that. Do you know if it's the expected behaviour that by adding a page in the list, all my selected content types does not show the block anymore ? – Tibo Mar 29 '18 at 12:13
  • @Tibo – Yes that's intended. You may find a different rule than that matches your needs. Maybe you use the brilliant Pathauto module and give every content type a default URL pattern like `contenttypename/[node:title]` and then add or exclude them by their URL aliases one by one in your block settings. You could also do that programmatically but that's a totally different story. – leymannx Mar 29 '18 at 12:15