I build a forum using forum module and create several items and their subitems. For example, I have a top texonomy item of "discuss", which has a child item of "IT", then I post a topic of "drupal is amazing" in the "IT" item. Then others may post other topics in other texonomy items and subitems.

My question is, when the user navigate in the forum, how can I judge if the current page belongs to a special item, or a subitem is the child of another topitem in the hook_preprocess function ?

  • I don't know the "forum" module. But the answers must just lay front of you: When clicking of an item, how does it knows about it's sub items (and topics?)? And when clicking on sub item, how can list it's topics? You either have to check the item's structure or the topics structue. – ssibal Jan 9 at 9:30
  • Thanks for your reply. The "forum" module is a core module of D8.( I begin from D8, don't know other versions) Create items and topics is quite easy under UI interface, but I dont' know the program mechanism. – richardson Jan 9 at 9:41

Your Answer

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

Browse other questions tagged or ask your own question.