Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-18 01:39:13

etoile
New Member
Registered: 2007-04-17
Posts: 6

Sections, categories, articles, forms...I'm confused

I am brand-new to Textpattern and I’m hoping it will work for a personal project I’m doing. According to the folks on the job board, this SHOULD be doable in TXP, but I’m not sure how to do it. This is the site I’d like to convert to management with TXP:
http://www.amanita.net/cruiseaccess/

I can’t figure out what should be a section, what should be a category, or what should be an article. I think I am supposed to use forms for the repeated chunks of text that create every ship’s stats, and I think the custom fields would be the easiest way to manage the data, but I can’t figure out what goes where or how or what.

Can anybody help? I know how to write code, so don’t worry about talking “over my head” or anything, but I’m at a loss to understand what bits of information belong in what TXP areas. Thanks in advance!

Offline

#2 2007-04-18 03:39:23

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Sections, categories, articles, forms...I'm confused

Sure. Here’s the closest I can come to a metaphor:

  • Section = file box
    • Category = file folder, can be removed from file box (ie. all posts belonging to a category, regardless of section)
      • Article = file, can be separated from the file folder and file box.

For your site, I would try the following:

  1. Create a new section for each ship name
  2. Create the following custom fields (Admin>Preferences>Adv.)
    1. lowest available
    2. highest available
    3. inside
    4. outside
    5. balcony
    6. suite
    7. total
    8. and any others you need
  3. Post articles to the ship name-section and fill out custom fields in the left column of content>write.

For a possible page template, edit the default one as such:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en-us" xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><txp:page_title /></title>
</head>
<body>
	<txp:if_category>
		<!--we are on a category list...save for future use-->
		<txp:article />
	<txp:else />
		<txp:if_search>
			<!--search results-->
			<txp:article />
		<txp:else />
			<!--homepage-->
				<txp:section_list break="li" wraptag="ul" />
		</txp:if_search>
	</txp:if_category>
</body>
</html>

Then create a new section page, called ship (or something). For each ship section, set it to use the ship page template. For the ship template:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en-us" xml:lang="en-us" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><txp:page_title /></title>
</head>
<body>
	<txp:article limit="999" sort="custom_1 asc" /><!--use the custom field to sort, or if you're going by post title, remove the attribute-->
</body>
</html>	

As far as displaying all the information, check out the TextBook’s entry then edit your default form.

Last edited by jm (2007-04-18 03:40:16)

Offline

#3 2007-04-18 13:24:43

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Sections, categories, articles, forms...I'm confused

This article might also be helpful: Textpattern Semantic Model (also follow the links at the bottom).

Offline

#4 2007-04-18 14:22:03

etoile
New Member
Registered: 2007-04-17
Posts: 6

Re: Sections, categories, articles, forms...I'm confused

Wow, thank you! Your comments were both tremendously helpful. I actually think I get it now, and I’m making progress. There’s a lot of data entry to do and that should be about it!

Offline

Board footer

Powered by FluxBB