Jump to content

Variable Smarty et CMS


Recommended Posts

Bonjour à tous.

 

Travaillant sur une multiboutique il serait interessant de pouvoir faire appel au variable Smarty dans le CMS pour notamment utiliser les $shop_name...

 

Existe t il une solution autre que de mettre dans le template cms.tpl:

{assign var="full_address" value=Configuration::get('PS_SHOP_ADDR1')|cat:Configuration::get('PS_SHOP_ADDR2'):', ':Configuration::get('PS_SHOP_CODE'):', ':Configuration::get('PS_SHOP_CITY'):', ':Configuration::get('PS_SHOP_COUNTRY')}
{$cms->content|replace:array(
       '_shop_name_',
       '_shop_address_',
       '_shop_address1_',
       '_shop_address2_',
       '_shop_code_',
       '_shop_city_',
       '_shop_phone_',
       '_shop_mail_'
   ):array(
       $shop_name,
       $full_address,  
       Configuration::get('PS_SHOP_ADDR1'),
       Configuration::get('PS_SHOP_ADDR2'),         
       Configuration::get('PS_SHOP_CODE'),
       Configuration::get('PS_SHOP_CITY'),
       Configuration::get('PS_SHOP_PHONE'),
       Configuration::get('PS_SHOP_MAIL'))
}

 

Dans il même esprit on pourrait utiliser

{$cms->content|regex_replace

Pour utiliser tout les variable smarty.

???

Merci à vous

Edited by jd440 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...