简体   繁体   English

Drupal:如何将节点内容导出到其他网站?

[英]Drupal : How to export node content to other website?

I want to fetch contents from my Drupal site and show it on another site using CURL. 我想从我的Drupal网站上获取内容,并使用CURL在另一个网站上显示它。 I already have a module that creates a URL (menu) in Drupal and outputs the requested node using node_load() method. 我已经有一个模块可以在Drupal中创建URL(菜单),并使用node_load()方法输出所请求的节点。 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. 它的作用是查看节点时,它将在内容中查找img标签,并用其缩略图版本替换source属性。 In this module I look for a specific attribute of the node : 在这个模块中,我寻找节点的特定属性:

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

And replace the img tags if present.. 并替换img标签(如果存在)。

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.. 我的问题是,当我在第一段中定义的菜单中调用node_load()时,它没有$ node-> content ['body'] ['#value']这就是为什么不替换图像标签的原因。

Thanks! 谢谢!

使用node_view为节点的显示设置主题,并调用更改节点输出的模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM