Thanks, I figured it out finally very late last night. I wanted to use this in serveral places in my page template, mostly instead of the print head command. Here is what I used.
<?php global $base_url; print $base_url;?>
And in context.
<base href="<?php global $base_url; print $base_url;?>" />
Comments
dir?
if you're trying to access the path (eg to display an image) you can use:
working example:
note: this is for page.tpl.php
if you're looking for something else be a bit more specific.
hth!
Here it is...
Thanks, I figured it out finally very late last night. I wanted to use this in serveral places in my page template, mostly instead of the print head command. Here is what I used.
And in context.
Alternatively you can use
Alternatively you can use the GLOBALS array;
<?php print $GLOBALS['base_url'] ?>Slightly cleaner and more compact.
-zach
--
harkey design
: z
Cheers!
this thread cured a major headache
Working OK for me on 6.6.
Working OK for me on 6.6.
Using <base> is no longer
Using <base> is no longer recommended.
Why is that?
I just used $GLOBALS['base_url']. If this is not correct, what should I use?
$directory didn't work.
Did you try using
Did you try using $base_path?
Sorry posted double
Sorry posted double
Doesn't give full path
I have Drupal in http://localhost/site.com/
$base_path only gives me http://localhost/
while
$GLOBALS['base_url'] gives me http://localhost/site.com/
The variable I am trying to set up is:
$path_link = $GLOBALS['base_url'].'/'$menu['items'][$mid]['path'];
Drupal 6
You can use base_path()
Also path_to_theme() is useful at times.