Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Smarty Code - Get The Current Theme Path Url Rate Topic   - - - - -

 
  • danieltj
  • Member
  • Trial users
  • Join Date: 24-Nov 15
  • 28 posts

Posted 01 December 2015 - 03:36 PM #1

Hi, is there a Smarty code to get the current theme url path. So for example, is there a code that when used such as 

{$config.theme_path}

 it would output 

http://www.example.com/design/themes/mytheme/

Thanks



 
  • imac
  • Head of Product
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2074 posts

Posted 03 December 2015 - 08:42 AM #2

Hi, is there a Smarty code to get the current theme url path. So for example, is there a code that when used such as 

{$config.theme_path}

 it would output 

http://www.example.com/design/themes/mytheme/

Thanks

 

Take a look at app/functions/fn.common.php, function fn_get_theme_path

There you can see a variable with name of current theme: Settings::instance()->getValue('theme_name', '', $company_id);

Root store path can be found in Registry::get('config.dir');


Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug

 
  • danieltj
  • Member
  • Trial users
  • Join Date: 24-Nov 15
  • 28 posts

Posted 07 December 2015 - 01:51 PM #3

Not really what I was looking for. It doesn't look like there is one so you have to construct one yourself.
 
There is a theme name variable so using that you can try the following to get the theme path: -
 

{$config.current_location}/design/themes/{$settings.theme_name}/