Private tags, hidden pages

| 2 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.

/blog/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.

2 Comments

This is great and tells me what I want to know. However, one thing. If you've got your hidden stuff in a folder is there a way to tag and hide the folder as well?

Unfortunately, folders don't have Tags. If I wanted to hide the contents of a folder as you describe, I would name the folder "HIDDEN". Then when iterating through folders use <mt:Unless>.

<mt:Folders>
  <mt:Unless tag="FolderLable" eq="HIDDEN">
    <!-- do something -->
  </mt:Unless>
</mt:Folders>

This is untested, but I think it should work with only a little fiddling.

Leave a comment

Recent Entries

Private tags, hidden pages
There are pages on a site which you might not want to appear in a list of all the pages…
Putting Movable Type Keywords in the Head of the HTML file
When a user creates an entry or a page in MT, they are given the possibility of entering keywords in…
A small "new web site" gift for you
Today marks the launch of the new KinetixHosting site. Our company is dedicated to providing a variety of well supported…