I am trying to combine and sort by date two different feed list of entries with hash but not seems to be working.
<mt:entries blog_id="1">
<$mt:entrydate format="%Y:%m:%d:%H:%M:%S" setvar="DateStart"$>
<mt:setvarBlock name="item{title}"><mt:entryTitle></mt:setvarBlock>
<mt:setvarBlock name="item{url}"><mt:entryPermalink></mt:setvarBlock>
<mt:setvarBlock name="items" key="$DateStart"><mt:var name="item"></mt:setvarBlock>
</mt:entries>
<mt:entries blog_id="2">
<$mt:entrydate format="%Y:%m:%d:%H:%M:%S" setvar="DateStart"$>
<mt:setvarBlock name="item{title}"><mt:entryTitle></mt:setvarBlock>
<mt:setvarBlock name="item{url}"><mt:entryPermalink></mt:setvarBlock>
<mt:setvarBlock name="items" key="$DateStart"><mt:var name="item"></mt:setvarBlock>
</mt:entries>
<mt:loop name="items" sort_by="key numeric reverse">
<$mt:Var name="__value__"$><br />
</mt:loop>
OUTPUT:
HASH(0x7fb66e8284a8)
HASH(0x7fb66e8284a8)
HASH(0x7fb66e8284a8)
What Am I doing wrong?
This works for me:
<mt:entries blog_id="9">
<$mt:entrydate format="%Y%m%d%H%M%S" setvar="DateStart"$>
<mt:SetHashVar name="myhash">
<mt:SetHashVar name="$DateStart">
<mt:entryTitle setvar="title">
<mt:entryPermalink setvar="url">
</mt:SetHashVar>
</mt:SetHashVar>
</mt:entries>
<mt:entries blog_id="8">
<$mt:entrydate format="%Y%m%d%H%M%S" setvar="DateStart"$>
<mt:SetHashVar name="myhash">
<mt:SetHashVar name="$DateStart">
<mt:entryTitle setvar="title">
<mt:entryPermalink setvar="url">
</mt:SetHashVar>
</mt:SetHashVar>
</mt:entries>
<mt:loop name="myhash" sort_by="key numeric reverse">
Key: <$mt:Var name="__key__"$> — Values: <br>
<mt:loop name="__value__">
— Key: <$mt:Var name="__key__"$> — Value: <$mt:Var name="__value__"$><br>
</mt:loop>
<br>
</mt:loop>
It removes your "item" key which looks unnecessary to me.
P.S. I've also changed the date key to be a real number (since you want to sort by a numeric value).