Pushpendra Singh Chauhan Posted September 16, 2021 Share Posted September 16, 2021 I want to show a custom block on Blog App only. what is the correct way to select Blog app ? All I need to add a fluid block/template just below the header of Blog App. For pages I used this {{if $home = \IPS\cms\Pages\Page::$currentPage->id == 5}} {block="custblock1"} {{else}} {{endif}} Link to comment Share on other sites More sharing options...
Daniel F Posted September 16, 2021 Share Posted September 16, 2021 This should work inside your template: {{if \IPS\Dispatcher::i()->application->directory == 'blog'}} Your code to show only inside blogs {{endif}} IPCommerceFan 1 Link to comment Share on other sites More sharing options...
Pushpendra Singh Chauhan Posted September 16, 2021 Author Share Posted September 16, 2021 1 hour ago, Daniel F said: This should work inside your template: {{if \IPS\Request::i()->app == 'blogs'}} your code {{endif}} Hi @Daniel F I tried this in custom template, also tried to put this into global template too but this is not working the else condition is working everywhere including Blog App {{if \IPS\Request::i()->app == 'blogs'}} {template="customblog" app="blog" group="view" location="front" params=""} {{else}} test {{endif}} Link to comment Share on other sites More sharing options...
Solution Daniel F Posted September 16, 2021 Solution Share Posted September 16, 2021 Apologies, this was the wrong code. That's the correct one: {{if \IPS\Dispatcher::i()->application->directory == 'blog'}} Your code to show only inside blogs {{endif}} Link to comment Share on other sites More sharing options...
Pushpendra Singh Chauhan Posted September 16, 2021 Author Share Posted September 16, 2021 Link to comment Share on other sites More sharing options...
Recommended Posts