Created
April 18, 2011 01:43
-
-
Save machida/924677 to your computer and use it in GitHub Desktop.
Lokkaテーマ作成用のコピペで出来るコード集
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%# bodyタグにページのスラッグをつける %> | |
<% if entry? %> | |
<body class="<%= @theme_types.join(' ') %> <%= @entry.slug %>"> | |
<% else %> | |
<body class="<%= @theme_types.join(' ') %>"> | |
<% end %> | |
<%# Topページにだけアイキャッチを表示 %> | |
<% if index? %> | |
<div class="eye_catch"> | |
<img src="theme/otto/images/eyecatch.jpg" width="720" height="400" /> | |
</div><!-- .eye_catch --> | |
<% end %> | |
<%# パンくずリスト(Topページには表示しない) %> | |
<% unless index? %> | |
<div class="bread_crumb"> | |
<%= bread_crumb %> | |
</div><!-- .bread_crumb --> | |
<% end %> | |
<%# Snippet id 「introduction」を表示 %> | |
<div class="section introduction clearfix"> | |
<%= Snippet('introduction').body %> | |
<% if logged_in? %> | |
<p><a href="<%= Snippet('introduction').edit_link %>"><%= t.edit %></a></p> | |
<% end %> | |
</div><!-- section --> | |
<% if index? %> | |
<div id="aside"> | |
<%= partial :twitter_widget %> | |
<%= partial :aside_contents %> | |
</div> | |
<%# [条件分岐] 一覧のとき %> | |
<% elsif entries? %> | |
<div id="aside"> | |
<%= partial :aside_contents %> | |
</div> | |
<%# [条件分岐] ページスラッグ「about」のとき %> | |
<% elsif @entry.slug == 'about' %> | |
<div id="aside"> | |
<%= partial :aside_contents %> | |
</div> | |
<%# [条件分岐] ページスラッグ「members」のとき %> | |
<% elsif @entry.slug == 'members' %> | |
<div id="aside"> | |
<%= partial :aside_contents %> | |
</div> | |
<%# [条件分岐] 投稿のとき %> | |
<% elsif @entry.class == Post %> | |
<div id="aside"> | |
<%= partial :aside_ad %> | |
<%= partial :aside_contents %> | |
</div> | |
<% end %> | |
<%# [条件分岐] カテゴリースラッグ「tech」のとき %> | |
<% if post.category.slug == 'tech' %> | |
<% end %> | |
<%# [条件分岐] カテゴリータイトル「test」のとき %> | |
<% if @entry.category and @entry.category.title == 'test' %> | |
<%= 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaa' %> | |
<% end %> | |
%# [条件分岐] カテゴリー名「開発受託」のとき %> | |
<% if page? and @entry.category and @entry.category.title == '開発受託' %> | |
あああああああ | |
<% end %> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment