Jump to content

Sometimes you want to show a block only on the start page of a database and since if you add a block to the template it show up everywhere in the database, that can be annoying. Don't worry though, there is an easy fix for this.

In your block add this as the first line:

{{if \IPS\Request::i()->app == 'cms' and \IPS\cms\Databases\Dispatcher::i()->categoryId == 0}}

Then close it with {{endif}} on the last row.

This little snippet will check to see if you are in a category or not. On the start page you are not in a category yet, so the result will be 0. On all other pages this check will not be true, so it will not show there.

You can use this to target specific categories as well, or show things everywhere else but on the start page.

 

User Feedback

Recommended Comments

There are no comments to display.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now