Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-08-16 20:06:50
- Lare2
- New Member
- Registered: 2006-07-27
- Posts: 7
Static pages question
I’m in the process of moving my site to textpattern. But there’s still something I don’t get about how the system works.
———————————————————-
MY HOME PAGE [ Static page ]
———————————————————-
On my home page I’m planning on putting the html code for the home page on the DEFAULT PAGE TEMPLATE, with no textpattern tags at all.
QUESTION 1
Is this the right approach or the default page template serves another purpose?
Because if I follow this approach, I found that whenever I navigate to a category (http://example.com/category/news/) it lands me to the home page without any article displayed.
Can anyone explain me the basic procedure for a site that does not use the home page to display articles.
I’ll display articles on a different section but that question will come later :)
Thanks in advance.
Offline
Re: Static pages question
I believe that you can make separate pages for the different pages on your site. So your homepage would be coded as the default page template. You should then set up another page template to hold your articles. Let’s call it articles. :-) If you want to get to that page, your address would look like this: http://example.com/index.php?s=articles
If you want to name the page somethingelse, the address would be: http://example.com/index.php?s=somethingelse
From what I understand, you need to make a new page that would hold your articles with a category of news. I would probably name that page “news”. Then, when you link to that page, the address would be either: http://example.com/index.php?s=news (in messy mode) or http://example.com/news (in title mode).
Someone please correct me if I’m wrong. It seems this is how I do it on my site.<br /><br />-Brian<br />——————-<br /><a href=“http://zollinhofer.com”>Zollinhofer.com</a>
“It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt.”
- Mark Twain
Offline
#3 2006-08-17 00:29:57
- deronsizemore
- Member

- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Static pages question
Don’t feel bad. For my first Textpattern site I wanted some static pages and it seemed like the hardest thing in the world to do. It’s really not. First off, whatever is on the “default” page, that will be your homepage. So when people surf to http://www.yoursite.com they will see what’s on the default page. I’ll give you the exact code you need to get you started and then you should be off and running from there because it wont seem so hard. So, to get some static pages set up:
<br />
1. You need to make a new form to use. Go to Presentation>Forms and Create a new form, call it “static” (or really whatever else you want to call it) and inside the form, you will want to put the textpattern tag <code><txp:body /></code>
<br />
2. Go to Presentation>Sections and create a new section called “article”. This will be the section you’re working with. In this case, the homepage/default page. Check the bubble where it says “Display on homepage” to YES, because this will be displaying on your homepage. So when you’re writing a static peice of content, and you want to affiliate it with the homepage, you will select the “article” section (which I’ll show you more of in step 3)
<br />
3. Go to Content>Write. This is where your static content will come from. So for the title, it can be whatever you want. We’ll say this static section of your homepage is going to be the welcome message. So for the title, just put “welcome” (you wont use it other than to differentiate what each article is.) At the left before you submit your new article, go to “Advanced Options” and for Article and Excerpt I like to select “leave text untouched”, because I like to add my own html tags, I don’t want textpattern doing it for me with Textile. In the body of your article type this:
<br />
<code>
<h1>Welcome to my Page</h2>
<p>Hi, welcome to my new page.</p>
</code>
<br />
Now that you’ve got your static text, you need to select a section for where it will go. As I said eariler it will go in the “article” section. So to the right of your body text in your article, set the status to “Sticky” and use the drop down box and select the section “article.” Now you can click Publish.
<br />
4. Now you will want to go to the Content>Articles tab and you should be able to see your article that you just created in the list. It should say “Welcome”, with a section of “article”. Now what you will want to do is hover your mouse over your newly created article (“welcome”) and in the status bar at the bottom of your browser (may be in a different place depending on what browser you’re using), you can see a link in the status bar when you hover over “Welcome”. It should be something like http://www.yoursite.com/textpattern/?event=article&step=edit&ID=2. What you will want to look at is the “ID=”. Make a mental note of what that number is, whether it be “2” or “20”.
<br />
5. Now all you’ll need to do is go back to your “default” page and edit the template. So, where you’d like to have your welcome message, just put this code:
<br />
<code>
<div id=“rightcontent”>
<txp:article form=“static” section=“article” id=“2” />
</div>
</code>
<br />
So with that little textpattern tag, you’re calling your “welcome” article to that particular spot in your template. You can see it says “form=static”, this is the form you made earlier with <code><txp: body/></code>, therefore when it pulls your article, it’s only displaying the body text of your article, not the title or anything else (which is what we did in step number 3). Section is pretty self explanitory, this will be the section of your article, and then the important part is the “ID=”. This is the number you got from hovering over your article in step 4. This is how it knows exactly what article to display.
<br />
And that’s it. That should be the start of a static page. Just repeat as many times as neccessary to get desired result.
<br />
I hope this is clear. I tried my best to be as clear as possible. Just post back if there is something you don’t understand. I’m sure there are other ways to do this, but this is the way someone showed me.
Last edited by deronsizemore (2006-08-17 01:36:47)
Offline
#4 2006-08-17 16:27:26
- deronsizemore
- Member

- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Static pages question
Sorry, after re-reading your post, most of what I said above didn’t have anything to do with what you asked.
The default page is for the homepage. So really, if you just want a simple page, rather than going through the steps I outlined above, you could simply just put every single bit of your html in the default page template, and there’s your static homepage.
I’m not sure you’re using categories right within txp. I think what you’re trying to do with categories, is reserved for sections within txp. You need to create a section called news and then set it to NOT display on the homepage. So when you surf to http://www.yoursite.com/news you will see your news section.
Sorry, hopes this makes sense.
Offline
#5 2006-08-17 18:41:55
- Lare2
- New Member
- Registered: 2006-07-27
- Posts: 7
Re: Static pages question
Thanks, both replies helped me achieve what I wanted.
Not only the textpattern system is amazing, but their community is great also.
Offline
Pages: 1