Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Mradula.1990 on
Dear All,
I need to display RSS feed for each post, in below way : www.example.com/post-url-alias/feed
How to achieve this using post view, CONTEXTUAL FILTERS and path?
Comments
What is it you want to
What is it you want to display in the node? An RSS feed is a list of things, but a node is only a single thing not a list.
In word press there is a
In word press there is a feature called feed per post, in the same way I need to develop.
Ok, that doesn't answer my
Ok, that doesn't answer my question though. Or maybe it would if I knew that feature, but I'm not a wordpress developer, and this isn't a wordpress forum, so it's probably best to assume that we don't know the feature you are referring to and/or how it works.
Rss feed per post.. Single
Rss feed per post.. Single Rss listing...
And again I ask, a listing of
And again I ask, a listing of what? An RSS feed is a list of things. A node is only a single thing. What is it you want to list?
<?xml version="1.0" encoding=
in this way for each post. when i hit example.com/post/feed
Please wrap that in code tags
Ok, I see what you want. I don't understand the rational behind wanting it, but that's beside the point.
The first thing you'll need to do is implement hook_menu:
Then you need to create the callback for the node:
Next, you'll need to implement hook_theme() to get the system to use the #theme you just referenced:
This will allow you to create the template feed-per-post-xml.tpl.php, in which you can create the XML you showed above. The node will be available in your template as
$node
.