Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-11 18:38:40

thegrb
New Member
Registered: 2007-07-11
Posts: 3

Sections within content

Sort of a basic question, I hope someone can point me in the right direction.

Lets say I have pages that are kind of divided into sections. For example content of any individual page is as follows

—-
Introduction
(content)

Bio
(content)

Added notes
(content)

——

Lets say someone needs to edit only the ‘added notes’. Would you recommend using something similar to the default template to go in and just edit that part or is there a better way to separate each part similar to the way header, footer, content, and sidebar are separated,

I hope I make sense here, I guess my question is to what degree can we divide content into individual pieces and if there is an easy way with templates in textpattern to do this. Thanx

Last edited by thegrb (2007-07-11 18:40:27)

Offline

#2 2007-07-11 18:49:42

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Sections within content

Separate articles seems the way to go. You can modify the way they’re being rendered on a specific page/section with a custom article form and/or custom template if you want to get rid of any distracting dividers.

Cheers Martin

Offline

#3 2007-07-11 19:22:38

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Sections within content

You can also add, then modify, static content in your page templates by using forms <txp:output_form form=“yourform” />. You can then reuse your forms in different templates and update or change all instances by updating your form.

Offline

#4 2007-07-11 19:22:54

thegrb
New Member
Registered: 2007-07-11
Posts: 3

Re: Sections within content

Thanx for the quick reply
Do you mean the option like I am displaying 3 (or other number) articles on one page? How do I keep track of the individual pages? I can or have to name each (3 article) page to correspond to the specific entry somehow

Offline

#5 2007-07-11 19:37:23

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Sections within content

Just use misc forms or another kind of forms to design a layout. Example, you can do like this, just making couple of form, and writing some lines in the pagetemplate.

In pagetemplate default:

<txp:output_form form="header" />
<txp:output_form form="content" />
<txp:output_form form="footer" />

In misc form header:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fi" lang="fi">
<head>
<!-- And another header's staff -->
<title>Your Site Title</title>
</head>
<body>

In misc form footer:

</body>
</html>

In misc form content:

Just now it’s the trickiest part. You have to make sections for those every section: bio, added-notes, introduction. Then you put inside misc form named content simple lines that call content depending a specific section.

<txp:if_section name="bio">
Your bio content here
</txp:if_section>
<txp:if_section name="added-notes">
Your Add notes content here
</txp:if_section>
<txp:if_section name="introduction">
Your introduction content here
</txp:if_section>

Offline

#6 2007-07-12 17:29:50

thegrb
New Member
Registered: 2007-07-11
Posts: 3

Re: Sections within content

Thanx, I will try that.
In the meanwhile I am also trying to work out clean URLs, I have looked at the faq and threads here, thats another story I know

Offline

Board footer

Powered by FluxBB