We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Template {smarty} | Forum

LD`K
LD`K Nov 25 '13
Hi,


I would like to ask on how i can access site url or the base url of the site through smarty, i am talking about themes master_pages.


I wanted to do something like:

    

    <script src="{$baseURL}mytheme/images/jq.theme.inits.js"></script>


    {$site_url} seems not working here..


Any help would be appreciated.

ross Team
ross Dec 2 '13
Topic was moved from General Questions.
Daisy Team
Daisy Dec 10 '13
There is no need to add a path to the .js file. If you create your own plugin that should include the .js file, you can simply add the following function to your plugin init.php file:


function JSCRIPT_FINALIZE ($event){
    OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('JSCRIPT')->getStaticUrl() . 'JSCRIPT.min.js');
   
}
OW::getEventManager()->bind(OW_EventManager::ON_FINALIZE, 'JSCRIPT_FINALIZE');


* JSCRIPT_FINALIZE - change to your plugin name
LD`K
LD`K Dec 10 '13
Hi Daisy,


Thank you for your reply, yes we done this through `thememanagerof` since we cannot access this things through template master / `master_pages`. So what we did is through `thememangerof`. The only thing now is, all our future theme starting with OrangeOF, requires this plugin. 


We did not release any documentation for this plugin since it is nothing common for the end user.


We have lots of things to add to our Theme Manager in the future, like:


- Be able to change theme colors

- Logo

- etc


Just like wordpress themes..


I also want to stress out that some modules, does not follow some html tag or structure from one to the other module. So creating theme is a bit tedious.  We understand this.


By the way since, we are still learning oxwall, does oxwall happen to have a event manager / messagebus that we can subscribe to when the user for example accepts a friend, etc? If you can point this out to us, then it would be a very great help.



Best Regards,


LD`K