wish: merge aggregator-wrapper.html.twig + aggregator-item.html.twig into "aggregator.html.twig"
markup
<section class="feed">
<article>
<h3><a href="feedurl">title</a></h3>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit
</div>
<footer>
<time>date: xx xx xx</time>
<div class="terms">Categories: foo, bar , baz</div>
<a href="foo">bar</a>
</footer>
</article>
<article>
<h3><a href="feedurl">title</a></h3>
<div class="content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit
</div>
<footer>
<time>date: xx xx xx</time>
<div class="terms">Categories: foo, bar , baz</div>
<a href="foo">bar</a>
</footer>
</article>
</section>
twig stuff
{% if aggrerator %}
<section class="feed">
{% for item in aggrerator %}
<article>
<h3><a href="{{ feed_url }}">{{ feed_title }}</a></h3>
<footer>
<time>{{ 'Date' | t }} {{ source_date }}</time>
{% if categories %}
<div class="terms">
{% for item in categories %}
{% if loop.first %}
{{ 'Categories' | t }}
{% elseif loop.last %}
<li>{{ item }}</li>
{% else %}
<li>{{ item }} , </li>
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if source_url %}
<a href="{{ source_url }}">{{ source_title }}</a> -
{% endif %}
</footer>
{% if content %}
<div class="content">
{{ content }}
</div>
{% endif %}
</article>
{% endfor %}
</section>
{% endif %}
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | aggregator-theme.patch | 15.44 KB | geoffreyr |
Comments
Comment #1
geoffreyr commentedComment #2
geoffreyr commentedDoes the wrapper element account for the pager? Looks like it got left out of the wrapper.
As far as the implementation, I can't seem to enable the aggregator module right now...
Comment #3
mortendk commentedups forgot about the pager gonna look into it asap
Comment #4
geoffreyr commentedI kind of went a bit over the top here and converted a few extra templates. There are still some classic theme functions left in there, including
theme_aggregator_page_opmlwhich spits out XML. (Is there any way we can get Twig to handle that, or should we leave it to another subsystem of Drupal that actually generates nice XML? Views maybe?)Comment #5
mortendk commentedthe pager should be a general element that we can (re)use all over so i added it in as a seperate element in http://drupal.org/node/1913076
Comment #5.0
mortendk commentedadded info about the files