Pushpendra Singh Chauhan Posted September 16, 2021 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}}
Daniel F Posted September 16, 2021 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
Pushpendra Singh Chauhan Posted September 16, 2021 Author 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}}
Solution Daniel F Posted September 16, 2021 Solution 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}}
Recommended Posts