Answer the question
In order to leave comments, you need to log in
PHP: How to declare a variable in an array including any characters for a link starting with '/?'?
You need to include a variable that includes all links starting with '/?' or another more adequate solution in php request:
<body<?php echo (in_array($_SERVER['REQUEST_URI'], array('/en', '/ru', '/', '/?'))) ? ' class="homepage"':''; ?>>
<body class="homepage">
, that is, the homepage class is assigned Only for the start page and links described in the array (since this class is used in the design only on the main page of the site). Answer the question
In order to leave comments, you need to log in
What are you talking about? ... In Joomla, this can be solved almost by regular means.
From your text, the task is not entirely clear, do you need to hang up a class on the body only for the initial page? or for a specific set of pages?, if only for the start page, then you can track it by itemId, if for a set, then you can use the style of the template tied to the necessary menu items, and depending on the style, set the class or not ...
I will say only two words - Regular expressions.
ideone.com/zdwUPE
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question