I'm using the Feeds module to aggregate RSS feeds from different sources, and I'd like to use this theme for the task. How do I make the Title, Image and "Read More" links map to the original source URL for feed items? That is, I don't want them to link to Drupal nodes. I want them to link to the external links associated with the feed items.
I've attached a screen shot here with one example to illustrate the point, and I'm happy to provide additional screen shots and/or provide any additional information you may need.
I've found a couple of pieces of information that look promising, but I'm not sure how to integrate the code into the back end:
Hi Mattie,
Find <?php print $links; ?>, replace with:
<ul class="links inline"><li class="node-readmore first"><a href="<?php print $node->field_srouce['und'][0]['value'];?>" target="_blank">Read more</a></li></ul>Remember to delete all existing feed item nodes, because they did not have field_source value.
Hi, Neo:
After copying file node--article.tpl.php to node--feed-item.tpl.php I lose the ability to edit feed items in the manner shown below, and it's important for me to retain this functionality. How specifically do I accomplish this?
you mean this function disappear? Can you upload your node--feed-item.tpl here?
Yes, I mean this function disappears. I disabled it for purposes of creating that screenshot, but I'll put it in place again and upload it for you here in a couple of minutes.
Stay tuned,
Mattie
I've reverted to a simplest use case to illustrate the problem, and I've uploaded the node--feed-item.tpl.php here. All that I've done is to copy file node--article.tpl.php to node--feed-item.tpl.php and clear cache. Again, for purposes of demonstration, I haven't put the mapping changes into place (although I have done so previously with the same result).
Note: I had a little difficulty uploading the file here, so it's been renamed. On my server, the file name is node--feed-item.tpl.php. Apologies for any confusion.
it's my bad, please follow this instruction:
before line 8: <h2<?php print $title_attributes; ?> class="article-title">
add <?php print render($title_prefix); ?>
after line 10: </h2>
add: <?php print render($title_suffix); ?>
do the same with line 27 and line 29
That worked -- it's a beautiful thing. Thanks!
Hi, Neo:
I'm not out of the woods yet. The feed item editing functionality is in place, and I've got the title and "Read more" links pointing to the external source URL rather than the node. The last piece of the puzzle will be getting teaser images to display and have them properly linked to the external source URL as well. (Have a look at the very first screenshot at the top of the thread if that description confused you.)
I have IMCE modules installed to assist in production work, and I've enabled IMCE usage for image fields in both feed item and article content types. However, when I edit a feed item to upload and incorporate images (using one of the theme options), it's saved fine but doesn't display in the teaser view. I have a suspicion that this is related to the $articleimage variable in the node--feed-item.tpl.php template looking for data from the article type field data rather than the feed item content type data.
I'll put together a quick screencast for illustrative purposes if you'd like, so let me know if that would be helpful to you.
Best -- Mattie
Addendum: I did create a screencast for you, so check out http://youtu.be/oUavRcBu9PY if you feel it would be helpful.