I'm trying to make my custom Blogger theme, so I have to deal with their data syntax (all these "b" namespaces, etc.)
我正在尝试制作我的自定义Blogger主题,因此我必须处理他们的数据语法(所有这些“b”命名空间等)
Everything went good until I came to Archive widget. I have next construction:
一切顺利,直到我来到Archive小部件。我有下一个建设:
<b:section id='BlogArchive'>
<b:widget id='BlogArchive1' locked='true' title='Blog Archive' type='BlogArchive'>
<b:includable id='main'>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel" style="display: block; position: static; margin-bottom: 5px; *width: 180px;">
<b:include data='data' name='interval'/>
</ul>
</b:includable>
<b:includable id='interval' var='intervalData'>
<b:loop values='data:intervalData' var='i'>
<li class="dropdown-submenu">
<a tabindex="-1" expr:href='data:i.url'><data:i.name/> (<data:i.post-count/>)</a>
<b:if cond='data:i.data'>
<ul class="dropdown-menu">
<b:include data='i.data' name='interval'/>
</ul>
</b:if>
<b:if cond='data:i.posts'>
<b:include data='i.posts' name='posts'/>
</b:if>
</li>
</b:loop>
</b:includable>
<b:includable id='posts' var='posts'>
<ul class="dropdown-menu">
<b:loop values='data:posts' var='i'>
<li><a tabindex="-1" expr:href='data:i.url'><data:i.title/></a></li>
</b:loop>
</ul>
</b:includable>
</b:widget>
</b:section>
And the problem is that this snippet works only for current month: all previous months seems to be empty (with no posts listed in drop-down list).
问题是这个代码段仅适用于当前月份:所有前几个月似乎都是空的(下拉列表中没有列出任何帖子)。
I've checked the original widget and recognized that by default server returns only current month's posts and then it uses AJAX to load older months' posts (when expanding the list).
我检查了原始窗口小部件,并确认默认服务器只返回当前月份的帖子,然后使用AJAX加载旧月份的帖子(扩展列表时)。
So the question is: how to edit my snippet to make it load titles for all chronological existing of a blog? Maybe I should use some JavaScript or AJAX?
所以问题是:如何编辑我的代码段以使其为博客的所有按时间顺序加载标题?也许我应该使用一些JavaScript或AJAX?
1 个解决方案
#1
0
What ill suggest you is remove the following code
有什么不好的建议你删除以下代码
<b:widget id='BlogArchive1' locked='true' title='Blog Archive' type='BlogArchive'>
<b:includable id='main'>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel" style="display: block; position: static; margin-bottom: 5px; *width: 180px;">
<b:include data='data' name='interval'/>
</ul>
</b:includable>
<b:includable id='interval' var='intervalData'>
<b:loop values='data:intervalData' var='i'>
<li class="dropdown-submenu">
<a tabindex="-1" expr:href='data:i.url'><data:i.name/> (<data:i.post-count/>)</a>
<b:if cond='data:i.data'>
<ul class="dropdown-menu">
<b:include data='i.data' name='interval'/>
</ul>
</b:if>
<b:if cond='data:i.posts'>
<b:include data='i.posts' name='posts'/>
</b:if>
</li>
</b:loop>
</b:includable>
<b:includable id='posts' var='posts'>
<ul class="dropdown-menu">
<b:loop values='data:posts' var='i'>
<li><a tabindex="-1" expr:href='data:i.url'><data:i.title/></a></li>
</b:loop>
</ul>
</b:includable>
</b:widget>
and then save your template. while saving, it will ask you if to delete widget. click on delete widget and then again goto your layouts tab and add a new widget for archive. this must work
然后保存您的模板。在保存时,它会询问您是否删除小部件。单击“删除小部件”,然后再次转到“布局”选项卡并添加新的小部件以进行存档。这必须奏效
Include your blog URL so that i can check your blog
包括您的博客网址,以便我可以检查您的博客
Regards, Gireesh - www.CoreBlogging.in
此致,Gireesh - www.CoreBlogging.in
#1
0
What ill suggest you is remove the following code
有什么不好的建议你删除以下代码
<b:widget id='BlogArchive1' locked='true' title='Blog Archive' type='BlogArchive'>
<b:includable id='main'>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel" style="display: block; position: static; margin-bottom: 5px; *width: 180px;">
<b:include data='data' name='interval'/>
</ul>
</b:includable>
<b:includable id='interval' var='intervalData'>
<b:loop values='data:intervalData' var='i'>
<li class="dropdown-submenu">
<a tabindex="-1" expr:href='data:i.url'><data:i.name/> (<data:i.post-count/>)</a>
<b:if cond='data:i.data'>
<ul class="dropdown-menu">
<b:include data='i.data' name='interval'/>
</ul>
</b:if>
<b:if cond='data:i.posts'>
<b:include data='i.posts' name='posts'/>
</b:if>
</li>
</b:loop>
</b:includable>
<b:includable id='posts' var='posts'>
<ul class="dropdown-menu">
<b:loop values='data:posts' var='i'>
<li><a tabindex="-1" expr:href='data:i.url'><data:i.title/></a></li>
</b:loop>
</ul>
</b:includable>
</b:widget>
and then save your template. while saving, it will ask you if to delete widget. click on delete widget and then again goto your layouts tab and add a new widget for archive. this must work
然后保存您的模板。在保存时,它会询问您是否删除小部件。单击“删除小部件”,然后再次转到“布局”选项卡并添加新的小部件以进行存档。这必须奏效
Include your blog URL so that i can check your blog
包括您的博客网址,以便我可以检查您的博客
Regards, Gireesh - www.CoreBlogging.in
此致,Gireesh - www.CoreBlogging.in