Concrete root dir variable?

Permalink
Hi, Anyone know if there is a variable that I can use to specify concrete's root directory?

I will want to use it in both a controller and a block in edit mode.

Thanks,

scoop

 
ijessup replied on at Permalink Reply
ijessup
DIR_BASE_CORE
ijessup replied on at Permalink Reply
ijessup
DIR_BASE
scoop replied on at Permalink Reply
Thanks ijessup, I'll try that. :)

(Worked a treat, thanks!)

$DIR_BASE
Includes the trailing slash, so it outputs as
/concrete/
and not
/concrete
Just in case anyone stumbles upon on this thread looking for the same thing. ;)
philbirnie replied on at Permalink Reply
philbirnie
Just a note -- it's a constant, not a variable in this case (in other words DIR_BASE instead of $DIR_BASE. If you just need the WEB root, it's DIR_REL. Thanks for this thread.
Mnkras replied on at Permalink Reply
Mnkras
can you say exactly how you are going to use it
philbirnie replied on at Permalink Reply
philbirnie
Mnkras,

Sure: I just used it in one of my theme's so that the logo links back to the home page. Since I'm building the site in a sub-directory, I don't want to have to worry about changing this when I move it to the root directory.

Example:

<a id="home-link" href="<?=DIR_REL ?>" title="Return to Home Page">Home</a>
jordanlev replied on at Permalink Reply
jordanlev
You'll also want to put a slash after the DIR REL, like this:
<a id="home-link" href="<?=DIR_REL ?>/" title="Return to Home Page">Home</a>

...otherwise the link won't work when you move the site up to the root web directory (which I know from experience ;)
philbirnie replied on at Permalink Reply
philbirnie
Ah, yes... that would be a problem. Thanks for likely saving me a few minutes of head-banging!