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
I will want to use it in both a controller and a block in edit mode.
Thanks,
scoop
DIR_BASE_CORE
DIR_BASE
Thanks ijessup, I'll try that. :)
(Worked a treat, thanks!)
Includes the trailing slash, so it outputs as and not Just in case anyone stumbles upon on this thread looking for the same thing. ;)
(Worked a treat, thanks!)
$DIR_BASE
/concrete/
/concrete
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.
can you say exactly how you are going to use it
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:
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>
You'll also want to put a slash after the DIR REL, like this:
...otherwise the link won't work when you move the site up to the root web directory (which I know from experience ;)
<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 ;)
Ah, yes... that would be a problem. Thanks for likely saving me a few minutes of head-banging!