eko / FeedBundle

A Symfony bundle to build RSS feeds from your entities
http://vincent.composieux.fr
MIT License
141 stars 50 forks source link

Atom entry author #25

Closed Janest closed 10 years ago

Janest commented 10 years ago

Hi,

Thanks for the good work.

I didn't find the way to add the complete author tag within entries in an atom feed.

Something like:

<entry>
    ...
    <author>
        <name>author's name</name>
        [<email>author's email</email>]
    </author>
</entry>

Thanks in advance for your help.

eko commented 10 years ago

Hi,

Thank you for pointing out this issue, I will look on it by the end of the week.

eko commented 10 years ago

Hi @Yiul,

Commit referenced in this issue fix this problem.

Now, you can add a GroupItemField (such author) with multiple ItemField (name and email), like this:

$feed->addItemField(
    new GroupItemField('author', array(
        new ItemField('name', 'getFeedItemAuthorName', array('cdata' => true)),
        new ItemField('email', 'getFeedItemAuthorEmail')
    )
);

This will render the following XML:

<entry>
    ...
    <author>
        <name><![CDATA[John Doe]]></name>
        <email>john.doe@example.org</email>
    </author>
</entry>

Thank you for reporting this issue, let me know if you have other issues.