开发者

Drupal : How to export node content to other website?

开发者 https://www.devze.com 2023-01-23 17:07 出处:网络
I want to fetch contents from my Drupal site and show it on another site using CURL. I already have a module that creates a URL (menu) in Drupal and outputs the requested node using node_load() method

I want to fetch contents from my Drupal site and show it on another site using CURL. I already have a module that creates a URL (menu) in Drupal and outputs the requested node using node_load() method. This way, I can select which specific fields to output to the requesting site.

However, I also have a module that alters the node's content. What is does is when a node is viewed, it looks for the img tags in the content and replaces the source attribute with its thumbnail version. 开发者_Python百科In this module I look for a specific attribute of the node :

$node->content['body']['#value']

And replace the img tags if present..

My problem is when i call node_load() in the menu I defined on the first paragraph, it doesnt have that $node->content['body']['#value'] that's why the image tags are not replaced..

Thanks!


Use node_view to theme the display of the node and invoke modules changing the node output.

0

精彩评论

暂无评论...
验证码 换一张
取 消