Creating an entry list from plural blogs, under the same category

| No Comments | No TrackBacks

Hajime Fujimoto wrote an entry about MT's category technique.

He found a question about MT's category at Japanese SNS service named "mixi". The summary of that question is like this;

*There are two blogs. One is named "recommended restaurant" and other is "recommended cafe".
*They have the same categories with same name.
*The questioner wants to make an entry list. An entry list is pulling entry data from each blogs, belonging to the same category.


To this question, Hajime made some answers in his entry.
Let’s check the master's answers.

1.Using <mt:Entries> tag with "include_blogs" modifier and "category" modifier

You can use <mt:Entries> block tags with some modifier.


<mt:Entries include_blogs="2,3(blog's IDs)" category="foo">
*An entry list will be created here.
</mt:Entries>

In this case, you must have the same category structure with each.
If each blog's category structure is different, this code cannot publish the right results.

2.Using <mt:TopLevelCategories> tags

Another way is like this;

<mt:TopLevelCategories>
<$mt:CategoryLabel setvar="cat_label"$>

  *You can write a category information  here

<mt:Entries include_blogs="2,3(blog's IDs)" category="$cat_label">

  *An entry data from each blog will be published.

</mt:Entries>

<$mt:SubCatsRecurse$>

</mt:TopLevelCategories>

With this code, Hajime entered a category's name to a variable named "cat_label".

If you want to make an entry list on THE TOTALLY DIFFERENT BLOG, (not on these blogs which have same categories) you can use <mt:Blogs> block tags.

<mt:Blogs include_blogs="10">

    <mt:TopLevelCategories>
     <$mt:CategoryLabel setvar="cat_label"$>

        *You can write a category information  here

     <mt:Entries include_blogs="2,3(blog's IDs)" category="$cat_label">

      *An entry data from each blog will be published.

     </mt:Entries>

    <$mt:SubCatsRecurse$>

    </mt:TopLevelCategories>

</mt:Blogs>

No TrackBacks

TrackBack URL: http://www.mt-j.info/mt/mt-tb.cgi/69

Leave a comment

About this Entry

This page contains a single entry by nick published on March 10, 2010 10:00 PM.

New php API of MT5 was the previous entry in this blog.

“CustomFieldsSearch”, searching MT’s custom fields is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.