-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get current view in page_head.html.twig #3295
Comments
I've tried this: {{current_url}} and it's working.I've tried this code - and it doesn't work: {{ view }} |
Strangely, nothing is said about this in the Gantry5 documentation. So: {% set app = joomla.call('JFactory::getApplication') %} {% set current_view = input.get('view') %} View: {{current_view}} And another way {% set current_view = joomla.call('JFactory::getApplication').input.get('view') %} {% set menu = joomla.call('JFactory::getApplication').getMenu() %} View: {{current_view}} In both cases Is Home does not work. Before making any changes in /media/gantry5/engines/nucleus/templates/page_head.html.twig need to override them in /templates/your-template/custom/engine/templates/page_head.html.twig |
Hello!
How get current view in page_head.html.twig?
I need to add some code depending in current view - article or category.
The text was updated successfully, but these errors were encountered: