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.
- Open your "Feed - Recent Entries" template and after the line "<id><$MTEntryAtomID$></id>" add the following:
<entryid><mt:EntryID /></entryid> - Open the file plugins/ActionStreams/lib/ActionStreams/Event/Website.pm
- 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
) ],
});
- Change line 27 to:
map { MT::Util::encode_html($event->$_()) } qw( url title source_url source_title entry_id )); - 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()',
}, - Save, close and upload Website.pm
- Add a "Website Profile" to your other profiles, and set it to your website url
- Open your action stream template (presuming you have an index template, NOT a widget)
- 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) - 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> - 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>".
Next I will show you how to set up different styles and layouts for different action stream services.
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