jquery-rss
jquery-rss copied to clipboard
layoutTemplate not working with <table>
Hi,
When I do a layoutTemplate: '<table>{entries}</table>' it never adds the start nor the end of the table tag, it only produces the
I tried your examples in JSFiddle and I get the same results, so there is no interference from any other lib I am using in my project.
JSFIddle here; https://jsfiddle.net/AFHfn/2551/
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
currently it is impossible, i think :(
because jquery create a different objects structure from 'table' tag.
compare its on browser console:
$('<ul><entries></entries></ul>') and $('<table><entries></entries></table>')
second object has two array members, moreover its .outerHTML not hold a <entries></entries>!
its made as first member of array.
but you can make output rss entries in table by another way ;) add in your JSFiddle example next code - html:
<h2>Rss entries in table</h2>
<table id="rss2table"></table>
javascript:
$("#rss2table").rss("http://www.gosugamers.net/counterstrike/news/rss", {
limit: 5,
ssl: true,
layoutTemplate: '{entries}',
entryTemplate: '<tr><td><a href="{url}">{title}</a>{shortBodyPlain}[{author}@{date}]</td></tr>'
}).show();
I will try that, thanks for the reply
@myrises , It is interesting that you think tables are not possible for the time being (I have just tried, myself, with no success) but one of the examples in the readme goes like this:
$('#foo').rss(url, { layoutTemplate: "<table><tr><th>Title</th></tr>{entries}</table>", entryTemplate: "<tr><td>{title}</td></tr>" })
I now wonder if it should/did work, but does not anymore.