Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-22 16:24:18

blzabub
New Member
Registered: 2008-01-22
Posts: 4

Multiple Static Pages within a Section

Hello all,

I’m fairly new to textpattern. Please forgive me if this question has been answered before, a link to the answer would be much appreciated if this is the case.

I think I understand how to make a static page in textpattern. My problem is that I want to make multiple static pages which are all associated with a single section. I don’t want to create a unique section for each of these static pages. For instance I have a section called “Contact Us”, I need to have 3 or 4 static pages which are all within that section. Is this possible, and if so how? Also, if this is possible, how does one create navigation to those static pages, are there fixed URLs that can be referenced internally within the site as well as from outside the site? Dynamic URL’s scare me because I’m not sure how to code in such a way that changes to the DB won’t screw up links that function as navigation or for routing between PHP script pages. Thanks for any help.

~Ben
textpattern newb

Last edited by blzabub (2008-01-22 16:25:21)

Offline

#2 2008-01-22 17:05:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Multiple Static Pages within a Section

Hi Ben and welcome to txp…

How I would go for this is create the section “Contact Us” and a template for that section. This template “should” have art <txp:article status="live,sticky"/> tab.

then I would go to the “write tab” and write the 3 articles – saving each own with “sticky” status and allocating of course the section for them.

there are a number of ways to deal with the navigation to those pages

  • Hard code them in a form and then call that form using <txp:output_form form="your-form" />
  • Create a link category and add the links to your links db and call them using <txp:linklist category="my_stickies" wraptag="ul" break="li" />
  • Hard code them in your templates

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2008-01-22 17:26:31

blzabub
New Member
Registered: 2008-01-22
Posts: 4

Re: Multiple Static Pages within a Section

Thanks colak,

I’m trying this now…I can’t seem to get the individual static pages to display their article content unless they are set to Status=Live. When they are set to Status=Sticky, they don’t show. I guess I will keep trying. Thanks for the help.

~Ben

Offline

#4 2008-01-22 17:43:17

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Multiple Static Pages within a Section

Did you try using just <txp:article status="sticky"/>. Im not sure if a comma list is valid or not…


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2008-01-22 17:57:09

blzabub
New Member
Registered: 2008-01-22
Posts: 4

Re: Multiple Static Pages within a Section

Still having trouble with “sticky” or “live,sticky”.

If I make the articles all sticky, the section shows the latest article, rather than the specific article I want. If I make the article I want for the section sticky and the others live, it will not show the live articles even with the correct URL.

What I am trying to accomplish is this:

Section: Contact Us, with a main page that shows only static content so this can be done easily enough. But I also want to have a quote request page which is inside the “Contact Us” section. This will also have static content but with a web form that can be submitted. When the form is submitted, a PHP page checks the content and then routes to two possible pages: back to the original web form where it warns the user that the fields were filled incorrectly or to a static page that says, “thank you very much”. All these pages: the main contact us page, the quote request page and the thank you page should all be under the section: Contact Us. When the user goes to the Contact Us section. Structurally I think this should work:

example.com/Contact-us/ (main contact information page) [static]
example.com/Contact-us/x/quote-request-page [static]
example.com/Contact-us/y/thank-you-very-much [static]

(where x and y are article ID numbers)

I guess the problem is that the second two pages must use articles as their basis otherwise they cannot sit within the “Contact-us” section, they have to have their own section (which is not what I want). So I have to build everything, including the main contact information page with articles.

I hope this makes the problem clearer for anyone who would like to help.

Thanks again,

Ben

Last edited by blzabub (2008-01-22 17:59:28)

Offline

#6 2008-01-22 18:13:25

blzabub
New Member
Registered: 2008-01-22
Posts: 4

Re: Multiple Static Pages within a Section

Okay, I think this will work. If I either force the articles to be ordered such that the main contact us information is the most recent article or if I change the page template to reverse the order from oldest to newest rather than the default newest to oldest.

Thanks again for your help…It is a little bit clunky, but I think this will work out fine.

~Ben

Offline

#7 2008-01-22 19:29:15

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

Re: Multiple Static Pages within a Section

Try something like this, only the main article needs to be sticky:

<txp:if_article_list>
<txp:article status="sticky" limit="1" /><!-- for your introductory article -->
<ul>
<txp:article limit="2" form="about_list" />
</ul>
<txp:else />
<txp:article limit="1" /><!-- for the other two pages -->
<ul>
<li><txp:link_to_next><txp:next_title /></txp:link_to_next></li>
<li><txp:link_to_prev><txp:prev_title /></txp:link_to_prev></li>
</ul>
</txp:if_article_list>

Form ‘about_list’:

<li><txp:permlink><txp:title /></txp:permlink></li>

Last edited by els (2008-01-22 19:32:33)

Offline

Board footer

Powered by FluxBB