简体   繁体   中英

Smarty Templating-unable to get values from custom config file

I have built a custom smarty tpl file called logo.tpl. Now,I want to modify logo.tpl(ojs/templates/common) file like below:

{config_load file='foo.conf'}
<div class="logo">
<img alt="logo" height="73" width="75" src="{$baseUrl}/images/logo.jpg"/>
</div>
<div class="slogan">
 {$smarty.config.siteDesc}
</div>

and here is foo.conf

siteDesc = "blah blah blah"

The output what I can see from page source is:

<div class="logo">
<img alt="logo" height="73" width="75"
    src="http://localhost/ojs-2.3.7/images/logo.jpg"/>
</div>
<div class="slogan">

</div>

So, though I am placing foo.conf in ojs/templates/common folder ie same folder as logo.tpl,the values are not getting reflected.

So any help in this regard would be appreciated.

Note:Details about OJS: http://pkp.sfu.ca/ojs/

EDIT: This is solved by using {config_load file="core:common/foo.conf"} and placing foo.conf to lib\\pkp\\templates\\common path. Thanks tpaksu.

This is solved by using

{config_load file="core:common/foo.conf"}
<div class="logo">
<img alt="logo" height="73" width="75" src="{$baseUrl}/images/logo.jpg"/>
</div>
<div class="slogan">
{$smarty.config.siteDesc}
</div>

and placing foo.conf to lib\\pkp\\templates\\common path. Thanks tpaksu.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM