• Home
  • Family Photos
  • About
  • Papermoney Portfolio
  • Disclaimer
  • Wordpress Plugins
  • RSS Feed
 
« some thoughts on google
when to get in… a business »

textpattern basics - part 2

Posted on March 2, 2006 at 4:03 pm         By Ryan in Options Trading | Disclaimer

In my last article textpattern basics – part 1 I reviewed some of the basic concepts in textpattern. As promised, this article will dive a bit deeper into sections, and I’ll start to peel the onion on page forms.

Sections
First off – I’m going to give credit to Thame at erratic wisdom and quote some of his tutorial. Then I’ll dive into my read on sections and try to elaborate a bit..

Textpattern Sections are by far the most misused aspect of Textpattern and I am often guilty of employing them when they are entirely unnecessary. Textpattern sections are strong content and presentation dividers and are powerful enough to create different blogs or web sites from the same installation.
Separate sections should only be used if you are trying to:

  • Create ?static? pages ? Tutorial
  • Create different ?blogs? with entirely different layouts and styles
  • Manage archives

Sections should not be used solely for content division; there are categories for that purpose as well as other external tagging services
erratic wisdom: Textpattern Sections

I think that pretty much puts sums up what sections are. They are your first line of content separation, and should by used for that and that alone. Sections create “mini websites”. They are not just for “other content” – use a category for that! Sections allow you to create complete and totally different areas of your website. Take for example how I employed them here at ryanbarr.com. I have 10 sections—ten sections you might say… let me run them down.

  1. about – basically my about page. I don’t want content from there to be syndicated and I don’t want it on the front page.
  2. archivescat – this is for the archives page by category. I’m using a section because it allows flexibility to re-style it if needed and provides a solid division from other content. I’ll dive into this a bit more when talking about forms later in the series
  3. archivesmonth – see archivescat; but monthly :)
  4. article – this is were all of my “articles” go. anything that is regular content to the website gets dropped in this section.
  5. contact – the contact form. It has its own page due to the different layout of the page
  6. disclaimer – my disclaimer. I added this because I started to talk about investing and options and wanted to cover my butt. Again, this isn’t syndicated but you can search it.
  7. family – my wife own little section :) Okay, not really. This section is a bit like article, but its specifically for our “family” stuff. The family content goes here because we always have the most recent family article on the home page, and because eventually if we want to style it differently we can.
  8. links – for the links – again this section is used to change the output form used
  9. pictures – all of our photo galleries use the pictures section. The content for these is substantially different and the layout is totally different than a regular article. I have pictures associated and all of that good stuff. So a new section was required.
  10. search – again, just like the archives pages, search has its own layout so I gave it a section.

As you can see, most of these are pretty straight forward. Some come from the design I had up by Stuart, and some are due to my own hacking and customization. I think that generally each one is required to get the feel I was looking for. Notice that there is not an investing section, or a wedding pictures section or anything like that. All of that content is categorized using categories not sections. The only slight exception to this rule is the family category; however, those articles are treated differently and are not in with the regular article lists. Because of those differences, I chose a new section.

In my list of sections, I referred to syndication, homepage, search and some other stuff. Basically, as of textpattern 4.0.3 there are eight options that you can setup for each section. They are as follows:

  • Section name: The name of the section – used in your code and in the admin gui.
  • Section title: The title used for display purposes
  • Uses page: What “page form” to use when in this section. More on this later
  • Uses style: What “style” to use when in this section. Again, more later
  • Selected by default?: Convenience feature for the admin gui
  • On front page?: Should content from this section show up when on the “front page” or in the default section
  • Syndicate?: Should articles in this section show up in your RSS or Atom feeds
  • Include in site search?: Should these articles be searchable

Some of these items, like name and title are used in code. Some define outputs and some define where content goes… If you have different needs for your content, then you probably need different sections!

So, when your actually writing code – how do you handle sections… First off textpattern comes with a few out of the box tags that are helpful.

<txp:if_section name=”[section name here]“> - Determine if we are in a section.
<txp:page_title /> - The title of this section
<txp:if_article_section /> - Conditional output to be used in an article form.
<txp:section_list /> - Shows a list of sections (navigation anyone??)

And to make it even better, I like to use some of the great plugin’s at rDS and Johan Nilsson to enhance what you can do with sections; take a look at glx_if and ob1_title. If those won’t fit what your looking to do, don’t’ forget the textpattern resources website!

Page Forms

Well, this article has already become quite long, so I’ll just “start” to peel the onion on this and go into more detail in the next article. I view page forms as your “starting” point for display. Each section has an associated page form – and textpattern installs three by default.

  1. default – the default form – used by most sections
  2. archive – used by articles (in the default install)
  3. error_default – used for reporting error pages

Each of these forms allows you to define how the page should be displayed. The rules for where articles go, how links are handled and what not are all in this form. Remember that each section is associated to one page form, so in theory, you can have a page form for each section if you wanted to!

I’ll go into more detail in my next article. Let me know if you have any questions or comments, I’m always happy to discuss it. If your looking forward to the next article – grab my feed Thanks!

Tags: textpattern

Categories: Options Trading

No Responses to “textpattern basics - part 2”

RSS feed for the comments of this post

Places to go....

  • Barr Family Blog (40)
  • Business School (12)
  • Economics (7)
  • Investing (55)
  • Options Trading (82)
  • Papermoney (57)
  • Personal Finance (10)
  • Politics (3)
  • Real Estate (1)
  • Web Development (11)

Stock Quotes

Russell 2000 Inde514.71  chart+9.68
S&P 500934.70  chart+7.25
S&p 100 Index442.72  chart+1.89
DJIA9015.10  chart+62.21
NASDAQ1652.38  chart+24.35
Cboe Volatility I38.56  chart-0.52
2009-01-06 16:59

A sample from the gallery

Sonogram012508

Sonogram012508

Advertisements

Tags

auto bailout baby bear bull business cfc covered call dia dji Economics economy exit strategy expiration fed federal reserve fxp google inflation iron condor iwm kellogg nasdaq oex paper money php Politics pregnant profit qld qqqq recession risk rut school sds sonogram spx spy textpattern thinkorswim time decay vix volatility wordpress wpg2

Archives

  • January 2009 (5)
  • December 2008 (24)
  • November 2008 (9)
  • October 2008 (7)
  • September 2008 (11)
  • August 2008 (3)
  • July 2008 (5)
  • June 2008 (3)
  • May 2008 (2)
  • April 2008 (12)
  • March 2008 (5)
  • February 2008 (6)
  • January 2008 (29)
  • December 2007 (11)
  • November 2007 (1)
  • September 2007 (1)
  • July 2007 (1)
  • June 2007 (1)
  • January 2007 (1)
  • December 2006 (1)
  • November 2006 (7)
  • October 2006 (4)
  • September 2006 (2)
  • August 2006 (4)
  • July 2006 (6)
  • June 2006 (14)
  • May 2006 (16)
  • April 2006 (5)
  • March 2006 (11)
  • February 2006 (9)
  • January 2006 (2)
  • August 2000 (1)

Links

  • Useful Links

    • CNN Money After Market Data
    • CNN Money Pre Market Data
    • Evil Speculator
    • Firefox
    • Ryan’s Linkedin Profile
    • The Slope of Hope w/ Tim Knight
    • thinkorswim
    • Yahoo Finance
  • Log in

Creative Commons License This work is licensed under a Creative Commons License.
Grab our feed!
  Add to Google Reader or Homepage    Powered by FeedBurner