Saurabh Jain Posted January 13, 2016 Posted January 13, 2016 Base template for importing rss feed I am importing RSS feed of a forum {{if !empty( $items ) }} <h3 class='ipsWidget_title ipsType_reset'>{$title}</h3> <div class='ipsPad_half ipsWidget_inner'> <ul class='ipsDataList ipsDataList_reducedSpacing'> {{foreach $items as $item}} <li class='ipsDataItem'> <div class='ipsDataItem_main'> <a href="{$item['link']}" target="_blank" class='ipsDataItem_title ipsType_break'>{wordbreak="$item['title']"}</a><br> <span class='ipsType_light ipsType_small'>{datetime="$item['date']"}</span> </div> </li> {{endforeach}} </ul> </div> {{endif}} It shows only title and date I will like to add Description as well Can any 1 modify this code to get description as well Thx in advance Regards Saurabh
Nathan Explosion Posted January 20, 2016 Posted January 20, 2016 Does the feed have a description field in each item?
Saurabh Jain Posted January 21, 2016 Author Posted January 21, 2016 17 hours ago, Nathan Explosion said: Does the feed have a description field in each item? Yes... http://mechanical-engg.com/forum/forum/44-question-answers.xml The feed is also of IPB and also ia m importing in IPB
Nathan Explosion Posted January 21, 2016 Posted January 21, 2016 Then it imports already. What's the actual issue that is causing you to ask the question?
Saurabh Jain Posted January 22, 2016 Author Posted January 22, 2016 I dont want to import in forums........... Please try RSS feed block to import on page....
Nathan Explosion Posted January 22, 2016 Posted January 22, 2016 Now we're getting somewhere.....that information, plus the url of the feed, added to your opening post would have been a lot clearer and probably would have resulted in a quicker answer. Anyway....I'll help you help yourself now.... Add the following {{var_dump($item);}} after {{foreach $items as $item}} and then look at the preview to determine which field contains the description you want to display.....and then add $item['WHATEVERTHATFIELDISCALLED'] somewhere in your code. You've got the title, link and date fields being displayed already, so you can use them as a reference on what/how it can be added in.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.