Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layoutTemplate not working with <table> #118

Open
mortenlein opened this issue Nov 15, 2016 · 3 comments
Open

layoutTemplate not working with <table> #118

mortenlein opened this issue Nov 15, 2016 · 3 comments

Comments

@mortenlein
Copy link

mortenlein commented Nov 15, 2016

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 tags within the entryTemplate.

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.

@myrises
Copy link

myrises commented Jan 1, 2017

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();

@mortenlein
Copy link
Author

I will try that, thanks for the reply

@SimpleProgrammingAU
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants