Deprecated: Optional parameter $pophelp declared before required parameter $event is implicitly treated as a required parameter in /home/tomfadial/textplates.com/textpattern/lib/txplib_html.php on line 1389
A Customized Preview Section | Textplates '07 - Textpattern Template Competition

Proudly sponsored by:

  • Textpattern Hosting
    SiteGround

    Professional TextPattern web hosting services: FREE TextPattern installation, FREE domain name, 24/7 support and more!

  • Iconfactory
    The Iconfactory

    The Iconfactory makes Frenzic, a fast-paced, addictive game that makes Tetris look like child’s play

A Customized Preview Section

Garrett already has a great article about previewing your posts in Textpattern by creating a private section. However, by creating one more page template (or adding some conditional statements), you can create a specialized admin section with just the stats and information you need.

My template for this website is set up pretty cleanly so I was able to quickly set up a new page template and modify a few forms to get the features I wanted.

Adding these features and other modifications will be a lot simpler if you build your templates to use “misc” type forms as includes. An example template for a “Preview” section can be found below.

<txp:output_form form="Temp_header" />
<body>
       <div id="page">
              <h1><txp:link_to_home>
<txp:sitename /></txp:link_to_home></h1>
              <txp:article_custom form="preview" 
section="preview" />
              <txp:output_form form="Temp_sidebar
_preview" />
              <txp:output_form form="Temp_footer" />
       </div>
</body>
</html>

Another useful addition I made to my preview section (other than having a customized sidebar with important information) is a “Bookmarks” area. Using the “Links” content section, you can add and output site-related bookmarks that will only be seen in your preview section.

By adding the following code to your customized sidebar and modifying your existing link output tag (if you’re using it) to exclude your special category, you can have your own admin bookmarks.

<txp:linklist form="bookmarks" category="bookmarks"
 limit="10" wraptag="ul" break="li" label="Bookmarks"
labeltag="h4" />

I’ve set up an example section if you want to see what’s possible.

15 Comments

Make your own

Textile help