Jump to content

How to setup unique sidebars in clubs?


Recommended Posts

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"?

Link to comment
Share on other sites

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 by Nathan Explosion
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...