スキップしてメイン コンテンツに移動

[blogger template customize]How to fill empty <data:post.dateHeader/>

This article is for blogger widget version 1 only.

When you post a lot in a day to "blogger", The second and subsequent <data:post.dateHeader> will be empty. It is often disturbs the design.

Article will show you how to fill the empty <data:post.dateHeader>.

But, not a completely pretty. So, Unnecessary contents is written. And it's dropped between the comment tag (^-^;) It was fixed by using a recursive call, So completely pretty.(16/09/28 22:55)

Fixed an issue where an error occurred when the blue circle check box was not checked. If not checked, <data:post.dateHeader> will be empty.(2018/1/28 19:42)

Get dateHeader function

Call the funciton as <b:include name='get_dateheader' data='post'/>, Enjoy!

<b:includable id='get_dateheader' var='post'>
    <b:if cond='data:post.isDateStart'>
        <data:post.dateHeader/>
    <b:else/>
        <b:loop values='data:posts' var='_post' index='i'>
            <b:if cond='data:post.id == data:_post.id'>
                <b:with var='next' value='data:posts[data:i - 1]'>
                    <b:if cond='data:next.isDateStart'>
                            <data:next.dateHeader/>
                        <b:else/>
                            <b:include name='get_dateheader' data='next'/>
                    </b:if>
                </b:with>
            </b:if>
        </b:loop>
    </b:if>
</b:includable>
<b:includable id='get_dateheader' var='post'>
    <b:if cond='data:post.dateHeader'>
        <data:post.dateHeader/>
    <b:else/>
        <b:loop values='data:posts' var='_post' index='i'>
            <b:if cond='data:post.id == data:_post.id'>
                <b:with var='next' value='data:posts[data:i - 1]'>
                    <b:if cond='data:next.isDateStart'>
                            <data:next.dateHeader/>
                        <b:else/>
                            <b:include name='get_dateheader' data='next'/>
                    </b:if>
                </b:with>
            </b:if>
        </b:loop>
    </b:if>
</b:includable>
<b:includable id='get_dateheader' var='post'>
    <b:if cond='data:post.dateHeader'>
        <data:post.dateHeader/>
    <b:else/>
        <b:loop values='data:posts' var='_post' index='i'>
            <b:if cond='data:post.id == data:_post.id'>
                <b:loop values='data:i to 0' var='_i'>
                    <b:with var='newer' value='data:posts[ data:_i ]'>
                        <b:if cond='data:newer.isDateStart'>
                            <data:newer.dateHeader/>&lt;!--
                        </b:if>
                    </b:with>
                </b:loop>
            </b:if>
        </b:loop>
        --&gt;
    </b:if>
</b:includable>