1

I created a block, in which an img with src="sites/mysite/files/imagename". It works every node, but failed loading in search page.

Is this an issue of Search module? Drupal 7, I hope, has a uniform url management, for example:

  • exapmle.com/files, exapmle.com/modules/Module_name, or

  • exapmle.com/modules/core(Symbolic Link points to sites/all/modules) /Module_name

  • exapmle.com/themes/Theme_name, or

  • exapmle.com/themes/core(Symbolic Link points to sites/all/themes) /Theme_name ...

  • ...

4

For any source or path of any thing in drupal site use src like this. It will work everywhere.$src = base_path() .'sites/files/logo.png';

| improve this answer | |
0

I had the same problem with a site where there were a lot of nodes with user-written links with relative paths. Something that I found noteworthy: It turns out that using clean urls can mess up references to relative paths, see this question. When you have clean urls enabled, you shoud better use absolute paths in your links.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.