6.29 月別アーカイブ一覧を簡略表示する ★

P.519

「月別アーカイブ」ウィジェットテンプレート

<mt:ifArchiveTypeEnabled archive_type="Monthly">
<dt class="sidetitle">月別アーカイブ一覧</dt>
<dd class="side">
  <mt:archiveList archive_type="Monthly" sort_order="descend">
    <mt:archiveListHeader>
  <dl class="monthchunks">
    <dt><mt:archiveDate format="%Y&#24180;" /></dt>
    <dd>
      <ul>
      <mt:archiveDate format="%Y&#24180;" setvar="year" />
    </mt:archiveListHeader>
    <mt:archiveDate format="%Y&#24180;" setvar="current_year" />
    <mt:if name="current_year" ne="$year">
      <mt:getVar name="monthly_list" />
      </ul>
    </dd>
    <dt><mt:getVar name="current_year" /></dt>
    <dd>
      <ul>
    <mt:setVar name="monthly_list" value="" />
    </mt:if>
    <mt:setVarBlock name="monthly_list" prepend="1">	
        <li><a href="<mt:archiveLink />"><mt:archiveTitle regex_replace="/\d+&#24180;(\d+)&#26376;/","$1" /></a></li>
    </mt:setVarBlock>
    <mt:if name="__last__">
      <mt:getVar name="monthly_list" />
    <mt:else>
      <mt:getVar name="current_year" setvar="year" />
    </mt:if>
    <mt:archiveListFooter>
      </ul>
    </dd>
  </dl>
    </mt:archiveListFooter>
  </mt:archiveList>
</dd>
</mt:ifArchiveTypeEnabled>

★「月別アーカイブ」ウィジェットテンプレート(デフォルトテンプレート)

<mt:IfArchiveTypeEnabled archive_type="Monthly">
  <mt:ArchiveList archive_type="Monthly">
    <mt:ArchiveListHeader>
<div class="widget-archive-monthly widget-archive widget">
  <h3 class="widget-header"><$mt:ArchiveTypeLabel$> <a href="<$mt:Link template="archive_index"$>">アーカイブ</a></h3>
  <div class="widget-content">
    <dl class="widget-list monthchunks">
      <dt class="widget-list"><mt:archiveDate format="%Y&#24180;" /></dt>
      <dd class="widget-list-item">
        <ul class="widget-list">
      <mt:archiveDate format="%Y&#24180;" setvar="year" />
    </mt:archiveListHeader>
    <mt:archiveDate format="%Y&#24180;" setvar="current_year" />
    <mt:if name="current_year" ne="$year">
      <mt:getVar name="monthly_list" />
        </ul>
      </dd>
      <dt class="widget-list"><mt:getVar name="current_year" /></dt>
      <dd class="widget-list-item">
        <ul class="widget-list">
      <mt:setVar name="monthly_list" value="" />
    </mt:if>
    <mt:setVarBlock name="monthly_list" prepend="1">
          <li class="widget-list-item"><a href="<$mt:ArchiveLink$>"><$mt:ArchiveTitle regex_replace="/\d+&#24180;(\d+)&#26376;/","$1"$></a></li>
    </mt:setVarBlock>
    <mt:if name="__last__">
      <mt:getVar name="monthly_list" />
    <mt:else>
      <mt:getVar name="current_year" setvar="year" />
    </mt:if>
    <mt:ArchiveListFooter>
        </ul>
      </dd>
    </dl>
  </div>
</div>
    </mt:ArchiveListFooter>
  </mt:ArchiveList>
</mt:IfArchiveTypeEnabled>

P.520

「スタイルシート」インデックステンプレート(サンプルテンプレート)

...前略...
.monthchunks {
    margin-left: -10px;
}
.monthchunks dt {
    margin-left: -8px;
}
.monthchunks dd ul li {
    display: inline;
}
...後略...

「スタイルシート」インデックステンプレート(デフォルトテンプレート)

...前略...
.monthchunks {
    margin-left: -15px;
}
.monthchunks dd {
    margin-left: 25px;
}
.monthchunks dd ul li {
    display: inline;
}

ウェブページ

Powered by Movable Type 4.261

このアーカイブについて

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。