In the "view" only... I don't have access to the controller or anything else.
I'm trying to figure out how to detect the page and display a banner or not display the banner depending on the page.
Nothing is passed down. What's needed is IF you're on this page > display the banner. ELSE - You're on this page - do not display banner.
<div class="thebnr"><img src="{{ 'thebnr.png' | asset_url }}" alt="{{ the.name }}" itemprop="bnr"></div>
I've searched and search but only see things like currentpage? ... not sure how to get this to work.
You can declare a helper method in your:
Then in your view, you can use it like this:
returnval
is a neat argument which you can use for modifying the return value of thepage?
method if the action matches the one specified. Otherwise the method returnsnil
andnil == false
so you can safely use it in an if.An example of using the
returnval
argument is: