Private tags, hidden pages

| 0 Comments

There are pages on a site which you might not want to appear in a list of all the pages on your site. If you make a custom 404 error page, that really doesn't belong in a site map. If you have landing pages such as "Thank you" pages displayed for users after they submit a form those don't really need to be listed in menu lists.

edit404.png

In order to manage those kinds of pages with Movable Type you need a way to tell MT those are "hidden" pages and not to put them in lists of pages. One way is to use a private tag to mark the pages, and then look for that mark when you build lists in your Movable Type templates. In MT beginning an Entry Tag or a Page Tag with an at symbol (@) makes that tag private. Private tags won't be displayed in lists of tags, they are only seen by the author... or in this case the templates.

How did we do it?

As shown in the illustration, we used the tag @hidden to designate the pages we don't want showing up in menus. In templates we used code like this snippet from the Page Listing widget

<mt:Pages tag="NOT @hidden" no_folder="1" sort_by="title" sort_order="ascend">
  <mt:PagesHeader>
    <ul class="widget-list">
  </mt:PagesHeader>
  <li class="widget-list-item"><a href="<$mt:PagePermalink$>" title="<$mt:PageTitle$>"><$mt:PageTitle$></a></li>
  <mt:PagesFooter>
    </ul>
  </mt:PagesFooter>
</mt:Pages>

The tag="NOT @hidden" attribute value pair we used is valid to modify the <mt:Entries> tag as well as <mt:Pages> tag. Although, off the top of my head, I don't know why you would want to hide an entry.

When a user creates an entry or a page in MT, they are given the possibility of entering keywords in a separate field. If the field is not visible in your MT editing page, you can change the "Display Options". MT uses this data when it performs a search, but this data is not "visible" to Internet search engines.

Display OptionsIt should be noted that the code in this tutorial has a lot of conditionals, so it may not scale well for your whole blog. Which is to say if you have thousands of pages or entries, this may slow down your rebuild process... maybe a little or maybe a lot. How much really depends, on lots of things that are beyond the scope of this post.

Next to useless?

There is a standard HTML head element, which contains meta data. The standard does not define what kinds of meta data may be present, but one very commonly used meta element is keywords. It is sometimes referred to as meta-keywords or the <meta> keywords attribute. Google says that http-equiv attribute keywords is next to useless. In the same article they note that it is still the second most commonly used attribute value of the meta element.

How we did it at Kinetix

As always, we recommend making a new template and including it where applicable. This makes it easier to upgrade your customizations in the future if template sets change. And when have they not changed?

There are two template tags that refer to keywords, because both pages and entries can have keywords. The tags are: <mt:EntryKeywords> and <mt:PageKeywords>. This code is included in the all output HTML (pages, entries and archives) so it has to check which context it will be render for, and select the appropriate MT template tags to render. Additionally, The KinetixHosting site uses the Professional Template Set so the code takes into account the special condition of the home page.

<mt:If name="entry_template">
  <mt:IfNonEmpty tag="EntryKeywords">
   <meta name="Keywords" content="<mt:EntryKeywords>" />
  </mt:IfNonEmpty>    
<mt:ElseIf name="page_template">
  <mt:IfNonEmpty tag="PageKeywords">
   <meta name="Keywords" content="<mt:PageKeywords>" />
  </mt:IfNonEmpty>
<mt:ElseIf name="main_index">
  <mt:Pages tag="@home" lastn="1">
    <mt:IfNonEmpty tag="PageKeywords">
      <meta name="Keywords" content="<mt:PageKeywords>" />
    </mt:IfNonEmpty>
  </mt:Pages>
</mt:If>

What, no keywords for the archive pages?

Well, its true. But those pages always represent a collection of entries. What would the correct keywords for the archives be? What do you think should be done in this case?

Today marks the launch of the new KinetixHosting site. Our company is dedicated to providing a variety of well supported web hosting services to your small business. We made this new site with Movable Type and the Universal template set to demonstrate that a small business can easily make a simple web site to communicate effectively with their clientele.

Karla Blue 905

We believe that what you write (what search engines see on your site) is the most important part of a business web site. No matter how many people you can reach with your site, the major search engines reach more. So we think you should concentrate on what you write. The MT platform makes it easy to focus on the words, and the Movable Type UTS provides a simple visual framework to easily drop them in. KinetixHosting provides the servers and fast network platform your company needs to put your content on the web.

Soft Orange Lilly

Over the coming months, we will be using this power to help our customers by creating articles which will allow them to better use our systems and the Movable Type publishing platform. We got started with an article describing the similarities and differences between pages and entries. Another example is our description of a great way to begin to customize the templates by building on a predefined style sheet.

Sunflower Bee

One of the first ways you can begin to make the Movable Type predefined templates look more customized is to change the image on the front page. The selector for which you must change the CSS properties is #homepage-image .

You may save any of the images linked to this post, or make your own 905 × 170 pixel rectangular image. Then you must change to URL of the background image to refer to the image you have selected. This article describes how to write such customize CSS code for MT in an organized way that will allow you to update templates easily in the future.

The other day, on one of MT mailing lists, someone commented on how difficult it was for the average user to edit the CSS files that are created when a style is selected for a blog using StyleCatcher. On this site we have presented an alternative which does not involve editing the files from StyleCatcher, and makes it possible to easily refresh templates without loosing all your customizations.

From CSS2 Specification : Assigning property values, Cascading, and Inheritance

Imported style sheets also cascade and their weight depends on their import order. Rules specified in a given style sheet override rules imported from other style sheets. Imported style sheets can themselves import and override other style sheets, recursively, and the same precedence rules apply.

On our site, we create a new template, and name the output file kinetix.css.

Custom Style Template - Edit

Then in the Style Sheet template we add a line to include our own styles. Since we import our style sheet after the StyleCatcher style sheets, any property values we define will over ride the values from the StyleCatcher files.

@import "/mt-static/themes-base/blog.css";
@import "/[...]/universal-black/screen.css";
@import "/kinetix.css";

Another advantage to making changes this way is that if we refresh templates we will only have to add one line to have all our customizations replaced.

In MT4 the publisher has supplied a visual editor, which lets users choose which navigation elements are displayed in the sidebar of a blog or web site. These navigation elements are called widgets, examples include recent entries, recent comments, and a variety of archive listings. There are also very basic widgets included in the default set, including a set and forget Creative Commons widget, and a feed subscription promo widget.

Dragging Widget

By dragging and dropping on the "Installed Widgets" column of the screen, (as shown above) users can control what is displayed in the sidebar of different parts of the site when the site is next published. The default template includes three widget sets, appropriately named: "2-column layout - Sidebar","3-column layout - Primary Sidebar", and "3-column layout - Secondary Sidebar". n.b. In release candidates for 4.2 I see there are some others as well.

Users can create their own widget sets, and insert them into templates using code like:

<$MTWidgetSet name="Name of the Widget Set"$>

MT4, now with Pages

| 0 Comments | 1 TrackBack

In Movable Type 4 the vocabulary of information elements increased to include Pages. By adding Pages through the Movable Type system, users can create files on their web sites or blogs that are not part of the chronological flow of Entries. This feature may be expressed as simply as an "about" page on a blog. Or it may be part of a more complex organization of pages into a site with a blog.

Pages are not entries

Pages can be organized into folders, but pages do not have categories. Entries have categories. Pages are not listed in date archives or on blog index pages. There is a nested page listing widget which can be placed in sidebars. Pages have their own template which is separate from entry templates; they can be customized to have different XHTML structure than entries, archives and indexes.

There are similarities between pages and entries

Pages can have a main (body) and extended sections, they can have excerpts that work the same way as excerpts work on entries. Pages have keywords field and they can be tagged. Pages can have comments and trackbacks.

One of the products that we are pleased to support for our customers is Movable Type Open Source, and all the Movable Type ™ 4.1 commercial products. We like this so well, we're going to use it for managing our new web site.

At KinetixHosting.com we are excited to try web site development using the Universal Template Set that comes with Movable Type 4.1. Our goal is to show that you can make use this tool, out of the box, to make a functional basic web site in three days without a huge investment in time. To that end we won't be making any significant changes to the structure for the initial launch, purely an exercise in developing the content and small changes to customize the look of the site.

We have been planning this change for some time, and we have even simplified our pricing for new customers. This effort marks our first major web site redesign in five years, and should our on-going commitment to providing excellent Business Web Hosting Services to all our customers.