开发者

drupal display the rest category article

开发者 https://www.devze.com 2023-01-24 06:20 出处:网络
i have create a category CMS,and add three terms to it (drupal,joomla,wordpress). when i create an article which belongs to drupal.now i want to show the rest drupal\'s articles(belongs t开发者_运维百

i have create a category CMS,and add three terms to it (drupal,joomla,wordpress). when i create an article which belongs to drupal.now i want to show the rest drupal's articles(belongs t开发者_运维百科o the term of drupal ) at the bottom of the article .is there a module to get this or how to write the code to get that.thank you.


I think the Similar by terms module will do what you want.

Coding this is not a bad way to learn some drupal coding skills. If you want to do your own, post here and I can give you pointers.

edit

You will need to implement hook_block() to create and define your block.

I suggest that you start with outputing some dummy text to prove to yourself that you have got it working.

You can then use menu_get_object() to load the object, and make sure that you only return something on node pages.

As part of your node object. Use var_dump on what is returned from menu_get_object to see what is there, there will be a taxonomy, which you can interrigate to get the appropriate term.

Then you can use taxonomy_select_nodes() to get the nodes.

Let us know you if you run into any issues.

0

精彩评论

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