SimplePortal

Support => English Support => Topic started by: Tarista on May 28, 2016, 06:34:00 PM

Title: Custom block display, hide block on all topics in board unless topic=xyz
Post by: Tarista on May 28, 2016, 06:34:00 PM
So I'm trying to use the advanced Custom block display, I've added it to one page (using select page) and also board 4, 5 and 6 (using select board) and now I want it to show up when posting in the boards mentioned, viewing message index, and while reading the stickied topics with IDs 79-82 but not on any other topics in those board (or other boards).

I added this after looking at http://simpleportal.net/index.php?action=docs;area=custom_blocks_display
Code: [Select]
~topic|79; ~topic|80; ~topic|81; ~topic|82; -~topic
But it seems to show up on any topics in the boards 4, 5 and 6, how should I write it instead?

Thanks for any help offered.
Title: Re: Custom block display, hide block on all topics in board unless topic=xyz
Post by: emanuele on May 29, 2016, 07:17:40 AM
I don't think that one is easily possible.
First little mistake is you have to use commas to separate different conditions and not semi-colons, but that won't affect the outcome.
As far as I can see, the negation of "topic" take priority over "allowing" in a specific topic.

The only way I see is to create a duplicate of the block and make it show in the topics you want.
Title: Re: Custom block display, hide block on all topics in board unless topic=xyz
Post by: Tarista on May 29, 2016, 03:05:47 PM
I'll change the semicolons, I was looking at the documentation and only read the part about:

Quote
A parameter (and its value, if it has one), can be followed by a semi-colon (;). The semicolon is followed by another parameter, and so on, until the end of the query string.

I now realize that part was talking about how SMF has built up the structure of the url not how to create a string in the block.

Oh, thats too bad. I'll make a php-block grabbing the block using the block-in-block method for just the topics so I don't have to manage two bbc-blocks and remember to change them both all the time.
SimplePortal 2.3.8 © 2008-2024, SimplePortal