relative path in white label src
Permalink 1 user found helpful
Is it possible to use relative path in config or to a variable that holds path? I want to be able to move site around and want to set this and forget it.
mlocati
white label src in config
white label src in config
You can, just add 'DIR_REL' at the beginning like this:
define('WHITE_LABEL_LOGO_SRC', DIR_REL.'/files/images/mylogo.png');
When you use DIR_REL. inb the config is the path from the root or from the config folder or from the core root?
In other words where exactly would I put the logo.png with a clean install?
I have tried it several places and the logo does not show - alt still says "Concrete5"
thanks
In other words where exactly would I put the logo.png with a clean install?
I have tried it several places and the logo does not show - alt still says "Concrete5"
thanks
It's path from root, and you can put your logo anywhere, but it's more logical to put at /files/images/mylogo.png
I can't seem to get DIR_REL to work. Do I have to first define DIR_REL in the config.
When I do do it the img src resolves to
DIR_REL/images/soccer_logo-SE.png
which shows nothing.
Also when I did get the whole path to work - the logo on the edit bar changed during editing but when I hit the dashboard it no longer showed. I am thinking that I need the DIR_REL to work for that to show - the edit bar on the dashboard must be calling from a different path. So the DIR_REL would probably fix that
DIR_REL/images/soccer_logo-SE.png
When I do do it the img src resolves to
DIR_REL/images/soccer_logo-SE.png
which shows nothing.
Also when I did get the whole path to work - the logo on the edit bar changed during editing but when I hit the dashboard it no longer showed. I am thinking that I need the DIR_REL to work for that to show - the edit bar on the dashboard must be calling from a different path. So the DIR_REL would probably fix that
DIR_REL/images/soccer_logo-SE.png
The syntax in the config files is as you inputted - i.e.
define('WHITE_LABEL_LOGO_SRC', DIR_REL.'/images/soccer_logo-SE.png');
What I was trying to say is that with that syntax when you go to the Edit bar - where the logo is supposed to be - the img src resolves to - ( Firebig inspection ) DIR_REL/images/soccer_logo-SE.png and doesn't show the image ( logo ) I can get it to work without the DEL_REL, but only in the edit mode as soon as you click the dashboard button the logo on the edit bar disappears - this leads me to believe that the edit bar logo src is being called from a different path than the Edit bar over pages. If they are two different paths than the DIR_REL should fix that problem - I just can't get it to work.
I would think that if the DIR_REL was defined that it would spit out whatever path from the root it is being called from - right now it is DIR_REL which leads me to believe that it is not being defined.
define('WHITE_LABEL_LOGO_SRC', DIR_REL.'/images/soccer_logo-SE.png');
What I was trying to say is that with that syntax when you go to the Edit bar - where the logo is supposed to be - the img src resolves to - ( Firebig inspection ) DIR_REL/images/soccer_logo-SE.png and doesn't show the image ( logo ) I can get it to work without the DEL_REL, but only in the edit mode as soon as you click the dashboard button the logo on the edit bar disappears - this leads me to believe that the edit bar logo src is being called from a different path than the Edit bar over pages. If they are two different paths than the DIR_REL should fix that problem - I just can't get it to work.
I would think that if the DIR_REL was defined that it would spit out whatever path from the root it is being called from - right now it is DIR_REL which leads me to believe that it is not being defined.
I can duplicate this problem. You are correct in thinking that the 'DIR_REL' value needs to be defined in the site.php BEFORE it's used later in the same site.php file to define the location of the image however, this does not provide you with the portability you desire.
Recent versions of C5 automatically determine the DIR_REL value but this might be AFTER the logo is placed in the toolbar.
Kind of a bug but more of a use case that the core team didn't think about.
EDIT:
Is it sufficient to just have the White Label logo image in your domain root? If so, you could hard-code the logo path ("http://...") into the define statement rather than needing it to be a variable at all.
Recent versions of C5 automatically determine the DIR_REL value but this might be AFTER the logo is placed in the toolbar.
Kind of a bug but more of a use case that the core team didn't think about.
EDIT:
Is it sufficient to just have the White Label logo image in your domain root? If so, you could hard-code the logo path ("http://...") into the define statement rather than needing it to be a variable at all.
Yeah, when I hard code in the image in the white_label ( WHITE_LABEL_LOGO_SRC ) - It seems to work only over page edits on the edit bar - as soon as I click the dashboard the path to the edit bar is wrong and the hard coded path no longer works. May have to just hide it.
My hard-coded logo image is there all the time. See attached screen capture.
is it an absolute or relative to root path?
define('WHITE_LABEL_LOGO_SRC', 'http://www.mydomain.com/images/logo.jpg');
To which configuration variable are you referring to?