Combining entries with Action Stream data

(1) (0)
First off, credit where credit is due; this method is entirely the property of Yves Luther, I am merely providing it in English in an instructional capacity.

So, you can see on my home page that my blog posts are nicely mixed in with my action stream entries, which for blogs with infrequent updates or personal sites, means you have a collection that summarises (most of) your activity on the web as a whole.  The beuty of Yves solution is it's simplicity and flexibility.  Once set up, the choice of exactly how to display your home page is completely up to you.

Also on my home page are variations on styling and content based on the service providing the action, this is something I will detail in a later post.
These instructions are presented in a much more 'instructional' way than Yves original entry, who provides additional commentary on the subject.

  1. Open your "Feed - Recent Entries" template and after the line "<id><$MTEntryAtomID$></id>" add the following:
    <entryid><mt:EntryID /></entryid>
  2. Open the file plugins/ActionStreams/lib/ActionStreams/Event/Website.pm
  3. Add after line 18:
            entry_id
    Meaning that section of code looks like this:
    __PACKAGE__->install_meta({
        columns => [ qw(
            summary
            source_title
            source_url
            icon_url
            entry_id
        ) ],
    });
  4. Change line 27 to:
            map { MT::Util::encode_html($event->$_()) } qw( url title source_url source_title entry_id ));
  5. Add after line 51:
                    entry_id     => 'entryid/child::text()',
    Meaning that section looks like this:
                get => {
                    identifier   => 'id/child::text()',
                    entry_id     => 'entryid/child::text()',
                    title        => 'title/child::text()',
                    summary      => 'summary/child::text()',
                    url          => q(link[@rel='alternate']/@href),
                    source_title => 'ancestor::feed/title/child::text()',
                    source_url   => q(ancestor::feed/link[@rel='alternate']/@href),
                    created_on   => 'published/child::text()',
                    modified_on  => 'updated/child::text()',
                },
  6. Save, close and upload Website.pm
  7. Add a "Website Profile" to your other profiles, and set it to your website url
  8. Open your action stream template (presuming you have an index template, NOT a widget)
  9. Add this line after the "<mt:actionstreams>" tag:
    <mt:setvarblock name="entry_id"></mt:setvarblock>
    (this resets the entry id so that you don't end up duplicating)
  10. Add this block after that:
    <mt:if name="service_type" eq="website">
        <mt:setvarblock name="entry_id"><$MTStreamActionVar name="entry_id"$></mt:setvarblock>
    </mt:if>
  11. After "<li class="hentry service-icon service-<mt:var name="service_type">">" add the following:
                <mt:if name="entry_id">
                    <MTEntries id="$entry_id">
                        <$MTInclude module="Entry Summary"$>
                    </MTEntries>
                <mt:else>
    Then add an "</mt:if>" before the "</li>".
That should be it!  Publish all, wait for your run-periodic-tasks to execute and your posts should appear inside your action stream.

Next I will show you how to set up different styles and layouts for different action stream services.

No TrackBacks

TrackBack URL: http://www.richardbenson.co.uk/mt/mt-tb.cgi/132

1 Comment

Hi Richard,

many thanks for your perfect translation. I couldn't have done it better and so this trick/hack is available to a much larger audience.

And, of course, many thanks for the credits.

Let's keep the MT community rockin'.

Yours, Yves Luther

Leave a comment

Recent Comments

  • Hi Tom, Sorry I only just saw this comment, I didn't get a notification from MT (unless it was caug

  • Richard, Noticed you commented on this plugin here: http://plugins.movabletype.org/rich-text-editor-

  • Thanks for the link to your main index page Richard, it will give me a better understanding of what

    toni.hambilton.myopenid.com
    Collating Action Streams
  • Hi Chris, The YUI editor strips out tags it thinks may be harmful, but you can affect which tags it

  • Hi Toni, That trick is not included in the examples here, I based them on the default code. It's q

  • Hi Richard, I added all the above code and checked out your add-twitter page, and the short version

    toni.hambilton.myopenid.com
    Collating Action Streams
  • Great plugin Richard. Until recently this worked as expected, but now I'm getting the re-feed every

    toni.hambilton.myopenid.com
    MT.org Action Stream 0.1
  • If you don't want to pay the extra money is P&P included? I would have thought a huge ballista would

  • I haven't tried it, but you should be able to use <mt:actionstreams service_type="digg"

  • Hey Richard, this plugin is great on the formatting and usability side. There's one slight (well, bi

    me.chrisfullman.com
    YUI Editor in Movabletype v1.0
  • Many thanks, Richard. This is very useful. I have to confess that I am having great difficulty wrap

joke