Set a specific style with Helix depending on a server - Forum | JoomShaper
Staff replied Helix Framework

Set a specific style with Helix depending on a server

Asked by Jean Machuron 4 years ago Last activity 4 years ago

Hellow
We would like to use a specific template style for Helix when the server returns a specific header.
The code would be :

$template_style = ???
function getheaderms($name)
    {

    $namesrv='HTTP_'.str_replace(' ', '_',strtoupper(str_replace('-', ' ',$name)));
   return $_SERVER[$namesrv];

    }
if ( isset( $_SERVER["HTTP_CERCLE_VERSION"] ))
{$value=getheaderms('Cercle-Version');}

//$value=getheaderms('Cercle-Version');

if( isset($value)) {return $template_style; }

The idea would be to insert this code as early as possible.

Can you tell me how to get in PHP a specific helix template style and where to include this code ?
Would it be best to include it in all helix template styles or to do an override somewhere and where ?

thanks for your help
Best regards
Jean

1 reply

Toufiq Senior Staff

Hi there,

Thanks for contacting us. Sorry to say, there is no option to add a custom PHP code for the specific template. If you want to use any script then you can use template advanced settings custom code area.

-Thanks

Log in to reply.