Content last modified Monday 6 March 2017
hop to #bottom
About It:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

txp:output_form = includes

One of the obvious benefits of Textpattern is it's ease of use and the control it offers over various parts of a site... without the aid of an FTP SFTP program. Some would argue that once Textpattern is installed and running there would be NO need for anything other than the TxP control panel. It really doesn't matter, the point is allot of things can be accomplished/controlled within the TxP control panel. For example...instead of using php includes for repetitive code on a site use Textpatterns txp:output_form.

The following was copied and pasted directly from a live site using TextPattern

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="en" lang="en">
<txp:output_form form="meta" />
<txp:output_form form="css" />
<txp:output_form form="js" />
<style type="text/css" media="screen">
#sub_nav_3 a:visited {
<txp:output_form form="cssactive" />
<div id="prime">
<txp:output_form form="masthead" />
<div id="left">
<txp:output_form form="nav" />
<txp:output_form form="pullexcerpts" />
<div id="right">
<txp:article form="content" limit="1" />
<div id="footer"><txp:output_form form="footer" /></div>
<div id="copyright"><txp:output_form="copyright" /></div>

Each of the output_forms contains information (or in some cases code) that pertains to that forms use. For example, the mast head output_form contains the following (note the homelink form nested in the masthead form)...
<div id="toplid"><txp:output_form form="homelink" /></div> <div id="lid"><img src="/images/logo.gif" title="xxxxxx" width="230" height="53" border="0" align="left" class="whatever" /></div>

The nav output_form would contain all the... nav markup...
<ul id="navlist">
<li><span id="one"><a href="/#/" >Link One</a></span></li>
<li><span id="two"><a href="/#/">Link Two</a></span></li>
<li><span id="three"><a href="/#/" >Link Three</a></span></li>
<li><span id="four"><a href="/#/">Link Four</a></span></li>
<li><span id="five"><a href="/#/">Link Five</a></span></li>

Each form was saved as a file. The js form contains all the necessary JavaScript's. The meta form contains all the sites meta tags and relevant information. The masthead form contains all the information (including markup) for the sites masthead. Same for the nav form, the pullexcerpts form etc etc.

Article Request Count:
Posted here:
01 Jun 2005
Article modified:
28 Oct 2006

Comments/questions? Leave a message in the form.

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (1)


How can you structure the folder system for files included with output_form? if i want to keep all my js files in one folder and my css in another?

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern