0

Fankly this is a silly question.

I want to print node teaser in a block.

As discussed here: How to programmatically render a node's teaser using the theme layer? I've used this code to get the html code of teaser:

 $node = node_load($nid);
 $rendered_teaser = drupal_render(node_view($node, 'teaser'));
 //now print this teaser in block using PHP filter.

But the problem is that this contains a logo whose img src value is

http: //default/sites/default/files/styles/small-logo-image/public/ddn-job/iitblogo-1395397403j.jpg?itok=ZhTVC9Ee

Also internal URL's are linked as http:// localhost/node/1 which should have been http:// localhost/mysite/node/1

What is the problem? I've also tried running it through check_markup($rendered_teaser,'full_html')

  • Can you provide the following info: (1) How these urls are stored in actual content? (edit the node to see) (2) What is the site's base url (home page)? Is it localhost? – Alexei Rayu Apr 23 '14 at 7:48
  • How this logo image is rendered? – Mathankumar Apr 23 '14 at 9:45
  • @Mathankumar This logo is image field type. I've not done anything specific to change it's rendering. And in Node "Manage Display" it's FORMAT is set as "Image". I'm using all site default theming. I'm using Bartik. Here: bit.ly/1mCY8dO all the content below "Other Interesting Jobs" is output from $rendered_teaser as in the code above. Additionally localhost site's internal URL's also have the problem. – AgA Apr 23 '14 at 10:12
1

About this problem :

Also internal URL's are linked as http:// localhost/node/1 which should have been http:// localhost/mysite/node/1

The solution lies in the .htaccess file, at the root of your site : locate the line with RewriteBase, uncomment it if needed, and set it to : RewriteBase /mysite/

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.