views:

53

answers:

2

On certain pages drupal_get_path isn't working correctly (or it is and I've got the wrong function) The base path is wrong

Example: Image is supposed to be at http://domain.com/sites/all/modules/pecapture/images/headline_dontmissout.jpg

But when on http://domain.com/node/9

The URL is http://domain.com/node/sites/all/modules/pecapture/images/headline_dontmissout.jpg

The same happens on the page http://domain.com/admin/build/ and block edit page

How do I get the right path?

+2  A: 

added base_path() to beginning of my paths...

davidosomething
A: 

base_path (http://api.drupal.org/api/base_path), if you use php code.
In html case, just add "/", like: /sites/all/modules/pecapture/images/headline_dontmissout.jpg
One problem: if you work on subfolder (Drupal installed in internal folder of main site): http://domain.com/subfoldersite, it will not correct, becase will remove "subfoldersite".

Nikit

related questions