Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted May 21, 20222 yr How can I create a unique sidebar html block or widget for each sidebar? I want to add unique content into the sidebar for each club. Also, the current forum in my club doesn't have a sidebar at all. How do I add the sidebar? Thank you.
May 21, 20222 yr Author Just now, Adriano Faria said: You can’t. Is it possible with custom coding? Is custom coding something that can be done with invision communities forums?
May 21, 20222 yr Just now, Lucas Thompson said: Is it possible with custom coding? Is custom coding something that can be done with invision communities forums? Yes and yes.
May 21, 20222 yr Author 2 minutes ago, Nathan Explosion said: Got Pages? What do you mean? Can you put a club in a page somehow so I can have a unique sidebar for each club? Thanks
May 21, 20222 yr Do you have the 'Pages' app? If so, create a custom block (with a custom template) which detects the Club ID and then presents your unique content. Then drag the block in place in Clubs. Edited May 21, 20222 yr by Nathan Explosion
May 22, 20222 yr Author 9 hours ago, Nathan Explosion said: Do you have the 'Pages' app? If so, create a custom block (with a custom template) which detects the Club ID and then presents your unique content. Then drag the block in place in Clubs. Thanks, but how do you make the custom block "detect the club id and then presents your unique content"?
May 22, 20222 yr This would be for the Club's 'homepage', using 'Manual HTML' for the Content Editor: {{if \IPS\Request::i()->id == '5'}} Unique content for Club with ID 5 {{elseif \IPS\Request::i()->id == '6'}} Unique content for Club with ID 6 {{endif}} This would be for the Club's topic listing, using 'Manual HTML' for the Content Editor: {{$forum = \IPS\forums\Forum::load(\IPS\Request::i()->id);}} {{$clubId = $forum->club()->id;}} {{if $clubId == '5'}} Unique content for Club with ID 5 {{elseif $clubId == '6'}} Unique content for Club with ID 6 {{endif}} This would be for the Club's topic view, using 'Manual HTML' for the Content Editor: {{$topic = \IPS\forums\Topic::load(\IPS\Request::i()->id);}} {{$clubId = $topic->container()->club()->id;}} {{if $clubId == '5'}} Unique content for Club with ID 5 {{elseif $clubId == '6'}} Unique content for Club with ID 6 {{endif}} Do not enable the 'Cache this block' setting Edited May 22, 20222 yr by Nathan Explosion