Disappearing Introduction

The blog introduction, which appears only on the front page, is in an added HTML element, HTML1 in this case. A blog post was written and published and the Html code for the post, including the title was, copied to the element and the post deleted. The id and class names were changed and styles added to the style sheet to allow for formatting separate from the posts.

Did you notice the introduction isn't on this page?

To make it disappear an adjustment, in the form of additional code, was made to the Html element. Here's the normal widget content when viewed with Expand Widgets checked.

Note: The code is not directly usable as it is converted to Html entities, so the code needs to be typed as it is displayed here, or converted back.

<b:widget id='HTML1' locked='false' title='' type='HTML'>
<b:includable id='main'>
  <!-- only display title if it's non-empty -->
  <b:if cond='data:title != ""'>
    <h2 class='title'><data:title/></h2>
  </b:if>
  <div class='widget-content'>
    <data:content/>
  </div>
  <b:include name='quickedit'/>
</b:includable>
</b:widget>

The addition was four added lines, two comments and two code. The required code is on the line following the comment.

<b:widget id='HTML1' locked='false' title='' type='HTML'>
<b:includable id='main'>
<!-- next added to suppress element -->
<b:if cond='data:blog.url == data:blog.homepageUrl'>
  <!-- only display title if it's non-empty -->
  <b:if cond='data:title != ""'>
   <h2 class='title'><data:title/></h2>
  </b:if>
  <div class='widget-content'>
    <data:content/>
  </div>
<!-- next added to close suppressor -->
</b:if>
  <b:include name='quickedit'/>
</b:includable>
</b:widget>

1 comment:

DanDan said...

This works like a charm- thanks for posting the information.

I tinkered with the idea of setting the widget pageType='main' which seemed to me should have worked, but I could not get the edit to stick... your solution works perfectly!