davidosomething
davidosomething

Reputation: 3437

Drupal paths in themes

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?

Upvotes: 0

Views: 139

Answers (2)

Nikit
Nikit

Reputation: 5128

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".

Upvotes: 0

davidosomething
davidosomething

Reputation: 3437

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

Upvotes: 2

Related Questions