Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-16 11:49:34

edge
New Member
From: Hertfordshire, England
Registered: 2005-09-02
Posts: 7

Different articles/topics on same page

Well, I am starting to get to grips with textpattern, its still early days but I really do like many aspects of this software.

I can create forms, pages, sections now but I am wondering how I can add two different forms to one page. I am thinking that I may have a brochure site, the top section is lets say a full article and below this I have a two column list. I think this would need two forms (I am mindful of trying to keep it simple for users).

Maybe its just a question of posting two articles using different forms or using sticky? but how would I control which is displayed first on the page, is it it simply based on date or where I add the form code in the html of my section page.

I don’t feel I have all the logic right just yet and clearly there is still a lot for me to grasp so I may be overlooking something. Most of my site are small business brochure / content sites rather than bogging type sites.

Am I also correct is thinking that if I have a section, lets say “Cars” and within that section I have BMW, Ford, Jaguar sub sections, each of these would be another section. Then again, if each of these sub-sections used the same layouts could I simply use an existing form and just another page. Guess I have not grasped as much as I think really as I don’t know how you write content to specific pages I will want to display such as the ford, Jaguar pages(Do these have to be sections). I am sure you would not need to create a section for every page that you want to target with different content.

Confused, in the dark right now and would appriciate someone turning the light on for me.

Offline

#2 2005-11-16 14:40:06

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Different articles/topics on same page

To have a single article at the top could be done in a number of ways depending on what you require. First you could use <code><txp:article limit=“1” form=“formName” /></code>. This will always show the latest article or you could use <code><txp:article_custom id=“10” form=“formName” /></code> which will always show article number 10 at the top or <code><txp:article status=“sticky” /></code> which always shows a sticky article however this will appear on all pages of that section if you have “paging”. Then follow this with another article tag using a different form for your other articles. If you are using the first tag above then this second tag could use the offset=“1” attribute so that the first article isn’t repeated in the second block. If you are using the “sticky” version you could add the status=“live” attribute to the second tag for the same reason.

If your car marques are setup as categories you can use <code><txp:article_custom section=“cars” category=“jaguar” /></code> to split them up.

You can use the same page template for different categories or sections by using conditionals eg:-

<code>
<txp:if_category name=“jaguar”>
<txp:article_custom section=“cars” category=“jaguar” />
<txp:if_category></code>
<br />

This can be done for sections as well but in either case the category or section must appear in the page URL so you will have to have linked to it using either the category or section in your link.

Last edited by thebombsite (2005-11-16 14:46:21)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2005-11-16 14:50:30

edge
New Member
From: Hertfordshire, England
Registered: 2005-09-02
Posts: 7

Re: Different articles/topics on same page

thanks, thats helpful.

I think the problem being a newbie is that there are several different ways to approach the same problem and its difficult to decide which way is right or best as its not possible to visualise exactly how the end result will work as part of the overall site

By the way, I like the idea of setting limit=“1”, this would allow users to keep old articles when new ones are published in their place, although I guess they could also make the other article a draft when adding a new one to that page section.

On the categories answer, I guess that would work, except I want to vary the navigation within those models, although I guess I could also vary the list by category also?

Offline

#4 2005-11-16 15:00:50

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Different articles/topics on same page

You could create different navigation forms and call them to the page template with <code><txp:output_form form=“formName” /></code> and put that inside the “if_category” tags as well.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#5 2005-11-16 15:13:26

edge
New Member
From: Hertfordshire, England
Registered: 2005-09-02
Posts: 7

Re: Different articles/topics on same page

Cool. All of a sudden its starting to make sense. Seems textpattern is a pretty flexible tool (hence the initial learning curve). Coming form creating static pages using dreamweaver templates and editing with Contribute, I like that textpattern does not limit me in the layouts as other CMS solutions do.

Still wondering those about images directories, but maybe its just as well I work through the demo site I am attempting to create first rather than making too many posts

By the way, do you work freelance? I get really busy sometimes and have to turn projects away, but being a fussy git, I like to make sure sites are fully accesssibility compliant, use CSS-P and look really good for the client. A lot of web designers still seem to be producing either poor design work or it’s based on outdated standards. Email me at my email address if you think there is any mileage?

Offline

#6 2005-11-16 22:26:44

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Different articles/topics on same page

It’s probably the most flexible CMS out there and it gets better. Email on the way.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#7 2005-11-17 20:49:25

nasv
Member
Registered: 2005-11-14
Posts: 22

Re: Different articles/topics on same page

<p>hey, thebombsite, I have a couple questions about the following that you said:</p>
<p>THEBOMBSITE:…or you could use [txp:article_custom id=“10” form=“formName” /] which will always show article number 10 at the top or [txp:article status=“sticky” /] which always shows a sticky article however this will appear on all pages of that section if you have “paging”.</p>
<p>I’m just trying to understand TXP logic with the first part… if you specify an article with its ID to have a single article at the top of a page, how (why) does it work that within that same section you can permlink to another article of that same section and it will show… I guess I just thought that since the page template specifies an article with an id, it would only show that article within that section.<br>Secondly, regarding the sticky article, I can understand how txp works with the sticky showing up everywhere when used, but I was wondering what you meant by paging and if there was a way around this?</p>

<p>thanks,<br>~Nico</p>

Last edited by nasv (2005-11-17 20:50:23)

Offline

#8 2005-11-17 21:18:47

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Different articles/topics on same page

Paging is when you set a limit in the article tag so that only that number of articles appears on a page. If you have more articles and have the paging links in your template you will get next page/prevous page links so that you can navigate through them.

With the article_custom tag you can call any article you like whether it is in that section or not. That’s what it is for. The normal article tag on the other hand is context-sensitive so it will only call articles that are in the section you are viewing. Because of that it is also a bit less flexible and has fewer attributes that you can add. This is slightly complicated by the fact that all your articles belong to the default section which is why you have the option in the “Section” tab to not allow certain sections on the front-page.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB