1 (edited by guesse 2014-04-02 20:11:12)

Topic: path to a template

How can I do so that the path to the template points through a variable?

DataLifeEngine - has a solution as:

<link rel="stylesheet" type="text/css" media="all" href="{theme}/css/style.css" />

{Theme} alternative - public/themes/name_theme
-----------------

Как можно сделать так, чтоб путь до шаблона указывался через переменую?

DataLifeEngine - есть такое решение как:

<link rel="stylesheet" type="text/css" media="all" href="{theme}/css/style.css" />

{Theme} алтернатива - public/themes/Название шаблона

Re: path to a template

Why dont u try like this?

<?php echo Site::url(); ?>public/themes/YouThemeName/
(с) Roman Art
So far So good wink

RomanArt's Website

Re: path to a template

if u really want so hard to do exactly like u said in ur post then u can try the following solution

in header.chunk.php of ur theme add to the line 1 before <!DOCTYPE html> this:

<?php
$theme_path = 'public/themes/YouThemeName/';
$theme_url = Site::url() . 'public/themes/YouThemeName/';
?>

so now u can call 2 vars:

<?= $theme_url ?>
and
<?= $theme_path ?>

example of use in theme:

<link href="<?= $theme_url ?>css/bootstrap.css" rel="stylesheet">
<link href="<?= $theme_url ?>css/bootstrap-theme.css" rel="stylesheet">
<link href="<?= $theme_url ?>css/main.css" rel="stylesheet">

where $theme_path is "public/themes/YouThemeName/"
and $theme_url is "http://website.ru/public/themes/YouThemeName/"


p\s I'm really bad in php, so if there is a better solution i might dont know smile

(с) Roman Art
So far So good wink

RomanArt's Website

Re: path to a template

Thank!!!!!