Hi,
The best way to generate a img url is something like this:
<img src="<pinp> echo make_url( currentsite() ); </pinp>images/
my_image.gif">
or with the new ar() library:
<img src="<pinp> echo ar('loader')->makeURL( ar('store')-
>currentSite() ); </pinp>images/my_image.gif">
This way all your image paths are relative to the site root of the
site that the template is called on. So if you later move the site, or
export it and import it somewhere else, all the paths are
automatically correct.
There is an improvement on this, you can set the often used urls in
the config.ini once, instead of calculating them a few times, e.g.:
psite::config.ini
<pinp>
$arConfig = ar::getvar('arConfig');
$arConfig['settings'] = array(
'site' => $path,
'siteURL' => ar('loader')->makeURL().
'graphicsURL' => ar('loader')->makeURL('graphics/', false, false)
);
putvar('arConfig', $arConfig);
return $arConfig;
</pinp>
then in your other templates do this:
<pinp>
$graphicsURL = ar::acquire('settings.graphicsURL');
</pinp>
<img src="<pinp> echo $graphicsURL; </pinp>my_image.gif">
regards,
Auke