user-pic

ActionStreamRollup with "website" service for a blogroll

Vote 0 Votes

I am attempting with MT Pro 4.25 to create a blogroll using Action Streams. Basically, I'm using a "website" service for each item on the roll, and then for the blogroll am drawing the blog name (source_title variable), blog link (source_url variable), the latest-entry title, and the latest-entry link. I created a new user exclusively for the blogroll so that it doesn't get intermingled with other actions. They're being ordered from newest entry to oldest. So far, so good.

The problem is that because some blogs update more frequently than others, they're dominating the blogroll in a way that doesn't make me happy. Ideally, the blogroll would list all the blogs in the blogroll, with one item per blog, with the most recently updated blog first and then going through to the oldest.

The apparent solution is to use the StreamActionRollup template tag. Unfortunately, even using the "service" modifier for that, it treats all the website services as one website service and compacts them into the same action.

Is there any way to the StreamActionRollup tag to treat the individual website services as separate services, e.g. somehow using the source_url or source_title as the modifier? (Those aren't listed as valid options, and one of those didn't work when I quickly tried it.)

Here's the basic code, producing the uncompacted stream:

<div class="widget-recent-entries widget-archives widget">
    <h3 class="widget-header">Other Voices</h3>
    <div class="widget-content">
<mt:actionstreams lastn="200" display_name="Blogroll">
        <ul class="widget-list">
	    <li class="widget-list-item"><strong><a href="<mt:StreamActionVar name="source_url" escape="html">"><mt:StreamActionVar name="source_title" escape="html"> ></a></strong> <a href="<mt:StreamActionURL escape="html">"><mt:StreamActionTitle escape="html"></a></li>
        </ul>
</mt:actionstreams>
    </div>
</div>

Reported on Movable Type 4.25

3 Replies

| Add a Reply
  • You could save the source_url into a var in each loop and if the saved var != current source_url then output the link. This would do just the most recent entry for each blog, or if you added a counter var you could do more entries per blog.

    Unfortunately Action Streams only supports filtering by service or stream type and the "website" stream doesn't distinguish between profiles.

    You could potentially set this up in a sub blog all on it's own, add a new user to that blog for each site with only one website profile. Then have a template that loops the authors and outputs the top x actions. Publish this to a file all on it's own and use mt:include to insert that file into your main blog. If you used the MTOrder plugin, you could even have them in chronological order not just grouped by author.

    • Richard: Thanks.

      But wouldn't the saved-source_url-variable method only work to the extent that one blog's entries were together in the action stream?

      For example: If there were three blogs (A, B, and C) in the blogroll, the chronological list might look like this: A, C, A, A, B, B, C, A, C, etc. I think what you're proposing would produce A, C, A, B, C, A, C, etc. What I want is A, C, B -- chronological based on the most recently updated blog, but only one entry per blog.

      The second thing you propose might do what I want, but I was hoping for a more elegant solution. My current blogroll is done with a combination of the LinkRoller and Feeds.App 3 plugins, and it works -- mostly -- but it's pretty convoluted. My goals here were to (a) improve functioning, (b) simplify, and (c) chuck Feeds.App 3 as the retrieval method. A new blog with 30-50 users with a single website service would do (a) and (c) but not (b).

  • The lovely and talented Dan Wolfgang crafted this solution with php magic, and it appears to work.

    To make the blogroll, create a user (in this case, Blogroll), and then add a "website" profile for each item you want to add to the blogroll. The result with the code below is a chronological listing (most recently updated first) with the blog name, a link to the blog, the title of the latest entry, and a link to the latest entry.

    <div class="widget-recent-entries widget-archives widget">
        <h3 class="widget-header">Other Voices</h3>
        <div class="widget-content">
            <?php $sourceurl = array(); ?>
            <ul class="widget-list">
                <mt:actionstreams lastn="500" display_name="Blogroll">
                    <?php if (!in_array('<mt:StreamActionVar name="source_url" escape="html" encode_php="q">', $sourceurl)) { ?>
    	        <li class="widget-list-item"><strong><a href="<mt:StreamActionVar name="source_url" escape="html">"><mt:StreamActionVar name="source_title" escape="html"> ></a></strong> <a href="<mt:StreamActionURL escape="html">"><mt:StreamActionTitle escape="html"></a></li>
                    <?php $sourceurl[] = '<mt:StreamActionVar name="source_url" escape="html" encode_php="q">'; } ?>
                </mt:actionstreams>
            </ul>
        </div>
    </div>
    

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1773 6162

Last Topic: Excluding categories from blog by kholechek on Feb 9, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1429 5077

Last Topic: What apocalypse hit this community in the middle of 2011? by 75th on Feb 10, 2012

695 2910

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

173 737

Last Topic: About the MT version stated in HTML source by Alex E. Schneider on Feb 7, 2012

190 567

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012