Drupal 6 main links: how can I link to my latest news?

I have defined a custom content type - news. I also have a menu item - the latest news - these are links to one of the news sites. I want him to refer to the last one. How should I do it?

+3
source share
1 answer

A common approach to end-users: . Using the Views module , you create a view page (with its own path) that shows only the last (or n last) node (s). Then you indicate your menu item on this page.


An alternative approach Developer . If you want to avoid the overhead of the views module, you can also implement it hook_menu()in the user module. There you would register a callback function for the new path (for example, "/ show / latest / news"). The callback function will then determine the latest node news and either make it itself or redirect its path using drupal_goto(). Your menu item will point to a new path.

+1
source

Source: https://habr.com/ru/post/1735939/


All Articles