Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted April 10, 20177 yr Is there a way to choose when sidebar blocks are displayed? For instance, let's say I want a specific sidebar block to show in forum-x and in my articles database, but not in forum-y. Does anyone know how to accomplish this?
April 10, 20177 yr On 4/10/2017 at 12:38 AM, PrettyPixels said: Is there a way to choose when sidebar blocks are displayed? For instance, let's say I want a specific sidebar block to show in forum-x and in my articles database, but not in forum-y. Does anyone know how to accomplish this? A.f.a.i.k. this can not be accomplished with the current sidebar. It will require custom developement.
April 10, 20177 yr On 4/10/2017 at 12:38 AM, PrettyPixels said: Does anyone know how to accomplish this? It will require a custom widget to check if you're on a forum view and grab the ID and based on it, display or not the widget content.
April 10, 20177 yr This is what I planned to do but the problem is that you can't disable the widget cache setting when creating a plugin-based widget otherwise user could see forum topics they are not allowed to see.
April 10, 20177 yr I've made something like this where I display other blog entries from same user. I used \IPS\Widget\PermissionCache.
April 26, 20177 yr Can anyone point me in the right direction to accomplish this if I'm not a developer? I need the calendar widget to be unique to each sub forum, but when using the block manager it makes it change for all sub forums. Announcements have a setting to display in chosen forums, calendars do not. How can I find a developer that knows how to do this??
April 26, 20177 yr On 4/26/2017 at 7:12 AM, NAZMtnMan said: Can anyone point me in the right direction to accomplish this if I'm not a developer? I need the calendar widget to be unique to each sub forum, but when using the block manager it makes it change for all sub forums. Announcements have a setting to display in chosen forums, calendars do not. How can I find a developer that knows how to do this?? If you have Content Management (pages) and can handle a bit of php this works: $forum_id = 0; if (\IPS\Request::i()->controller == "forums") { $forum_id = \IPS\Request::i()->id; } if (\IPS\Request::i()->controller == "topic") { $topic_id = \IPS\Request::i()->id; $topic = \IPS\forums\Topic::loadAndCheckPerms($topic_id); $forum_id = $topic->forum_id; } if ($forum_id == 35) { print \IPS\cms\Blocks\Block::display('feed_template_key'); } You put that in a custom php block and then need to create a plugin calendar feed block (simple fill in the options no coding) and use its template key in above. Above only works on forum/topic pages. I got the forum detection code from here:
Archived
This topic is now archived and is closed to further replies.