Показаны сообщения с ярлыком Layout_Simple. Показать все сообщения
Показаны сообщения с ярлыком Layout_Simple. Показать все сообщения

понедельник, 9 мая 2011 г.

Как не загружать виджеты для определенных типов страниц в шаблоне Blogger.

<b:widget id='HTML10' locked='false' title='Мой блок меню' type='HTML'>
<b:includable id='main'>
<!-- my hack -->
<b:if cond='data:blog.url != data:blog.homepageUrl'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != &quot;&quot;'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
<!-- my hack -end -->
</b:includable>
</b:widget>
Пример кода виджета, который виден на всех страницах блога, кроме главной. 
Выводы, резюме

Как модифицировать шаблон (template) Blogger, чтобы не загружать заголовок (header) блога для главной страницы

Обтекаемый пустой блок Ссылка на видео, Ссылка на аудио (инструкции), Слайд-шоу
Краткое содержание (постановка задачи), результаты
<b:includable id='main'>
<!-- my hack -->
<b:if cond='data:blog.url != data:blog.homepageUrl'>
<b:if cond='data:useImage'>
<b:if cond='data:imagePlacement == &quot;BEHIND&quot;'>
<!--
Show image as background to text. You can't really calculate the width
reliably in JS because margins are not taken into account by any of
clientWidth, offsetWidth or scrollWidth, so we don't force a minimum
width if the user is using shrink to fit.
This results in a margin-width's worth of pixels being cropped. If the
user is not using shrink to fit then we expand the header.
-->
<b:if cond='data:mobile'>
<div id='header-inner'>
<div class='titlewrapper' style='background: transparent'>
<h1 class='title' style='background: transparent; border-width: 0px'>
<b:include name='title'/>
</h1>
</div>
<b:include name='description'/>
</div>
<b:else/>
<div expr:style='&quot;background-image: url(\&quot;&quot; + data:sourceUrl + &quot;\&quot;); &quot; + &quot;background-position: &quot; + data:backgroundPositionStyleStr + &quot;; &quot; + data:widthStyleStr + &quot;min-height: &quot; + data:height + &quot;_height: &quot; + data:height + &quot;background-repeat: no-repeat; &quot;' id='header-inner'>
<div class='titlewrapper' style='background: transparent'>
<h1 class='title' style='background: transparent; border-width: 0px'>
<b:include name='title'/>
</h1>
</div>
<b:include name='description'/>
</div>
</b:if>
<b:else/>
<!--Show the image only-->
<div id='header-inner'>
<a expr:href='data:blog.homepageUrl' style='display: block'>
<img expr:alt='data:title' expr:height='data:height' expr:id='data:widget.instanceId + &quot;_headerimg&quot;' expr:src='data:sourceUrl' expr:width='data:width' style='display: block'/>
</a>
<!--Show the description-->
<b:if cond='data:imagePlacement == &quot;BEFORE_DESCRIPTION&quot;'>
<b:include name='description'/>
</b:if>
</div>
</b:if>
<b:else/>
<!--No header image -->
<div id='header-inner'>
<div class='titlewrapper'>
<h1 class='title'>
<b:include name='title'/>
</h1>
</div>
<b:include name='description'/>
</div>
</b:if>
</b:if><!--My hack end -->
</b:includable>
Цитата, афоризм
Картинка, схема... в заголовок
Выводы

Как модифицировать шаблон (template) Blogger, чтобы не загружать футер для страниц сообщений

Обтекаемый пустой блок Ссылка на видео, Ссылка на аудио (инструкции), Слайд-шоу
Краткое содержание (постановка задачи), результаты
<!-- hack--><b:if cond='data:blog.pageType != &quot;item&quot;'>
<macro:include id='footer-sections' name='sections'>
<macro:param default='2' name='num'/>
<macro:param default='footer' name='idPrefix'/>
<macro:param default='foot' name='class'/>
<macro:param default='false' name='includeBottom'/>
</macro:include>
<!-- hack--></b:if>
Цитата, афоризм
Картинка, схема... в заголовок
Выводы

Как модифицировать шаблон (template) Blogger, чтобы не загружать боковые панели для опраделенных типов страниц

<!-- left sidebar hack -->
<b:if cond='data:blog.url == &quot;http://simple1-altersego.blogspot.com/&quot;'>
<div class='column-left-outer'>
<div class='column-left-inner'>
<aside>
<macro:include id='main-column-left-sections' name='sections'>
<macro:param default='0' name='num' value='1'/>
<macro:param default='sidebar-left' name='idPrefix'/>
<macro:param default='sidebar' name='class'/>
<macro:param default='true' name='includeBottom'/>
</macro:include>
</aside>
</div>
</div>
</b:if>
<!-- left sidebar hack end -->
Как убрать из трех колонок шаблона Blogger Simple левую боковую панель при загрузке тематических страниц (метки, labels), все боковые пенели при загрузке постов (items)
В XHTML шаблоне есть теги <aside>(которые пока не используются). Скачиваем шаблон, в текстовом редакторе задаем поиск <aside> и вставляем в шаблон дополнения (красный цвет на вкладках). Все просто..., однако, нам нужно будет еще внести изменения в таблицы стилей CSS.
<!-- right sidebar hack -->
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<div class='column-right-outer'>
<div class='column-right-inner'>
<aside>
<macro:include id='main-column-right-sections' name='sections'>
<macro:param default='2' name='num' value='2'/>
<macro:param default='sidebar-right' name='idPrefix'/>
<macro:param default='sidebar' name='class'/>
<macro:param default='true' name='includeBottom'/>
</macro:include>
</aside>
</div>
</div>
</b:if>
<!-- right sidebar end -->
Цитата, афоризм
Картинка, схема... в заголовок
Выводы