OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Is there a BASE_PATH variable in OxS?

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Is there a BASE_PATH variable in OxS?

Postby ramon » Mon Nov 26, 2012 8:57 am

Hello all,

We'd like to know what would be the best way to find OxS current base path.
Usually there is a defined variable for this, but we can't find it.
Something like gcwd() (which may be disabled for some reason), dirname(__FILE__) (which may or may not work properly), basedirname(), or a mix of them.
The use is planned for a plugin that needs to make a call to an include in the common header.tpl file.
If there's a proper way to "include" files, let us know, as we couldn't find anything related to this...

What we want to accomplish is add code right after the <body> tag, before the <a> tag of the header templates.


_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Is there a BASE_PATH variable in OxS?

Postby asmecher » Mon Nov 26, 2012 9:58 am

Hi Ramon,

I think registering a Smarty resource would be the best solution; see http://www.smarty.net/docsv2/en/template.resources.tpl. (This is the way that "core" templates are referenced, i.e.:
Code: Select all
{include file="core:path/to/template.tpl"}
If you register the resource in the plugin registration function, you'll be able to reference it from any template subsequently displayed. I think this would be a suitable piece of code to add to the plugin base class, if you're willing to submit a patch or something.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: Is there a BASE_PATH variable in OxS?

Postby ramon » Mon Nov 26, 2012 10:09 am

Alec,

THANKS!!
We'll try this...

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 5 guests