Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-10-12 22:27:41
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Trying to figure out whether or not to use article_custom or other??
Hi.
On the golf site I’ve been working on: <a href=“http://www.kentuckygolfing.com”>Kentucky Golfing</a>
On the homepage I’m trying to make it so that under the “featured course” section, only articles with the category “featured course” shows up. How can I do this?
Currently I’m using and article custom tag: <txp:article_custom form="featured_course" listform="excerpt_featured_course" limit="1" section="featured-course" />
to display the featured course excerpt on the homepage. I want it to only display articles associated with the “featured-course” section which it’s doing, but it’s also showing under the “featured article” section which is suppose to be every other article NOT in the “featured course” section. As you can see, the same article (Test for featured course) is showing up both areas of the homepage.
I’m just confused on what I need to do? Do I need to use 1 section explicitly for all articles (like call that section “article”), and then use categories for what I’m trying to accomplish with only showing certain articles with a certain criteria in different areas of the site or do I need to do something else?
I guess it would be the same thing for a “news” area of the site. If I wanted to just have a very small area on the homepage where I have the most recent news, would I use a section called “news” or use categories or what so that ONLY the news articles showed up there and the news articles didn’t show up in any other area on the site?
My head is spinning with this! lol
Thanks,
Deron
Offline
#2 2006-10-12 23:01:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Trying to figure out whether or not to use article_custom or other??
If I were you I’d use sections, and three article_custom tags:
<code>
<txp:article_custom form=“excerpt_featured_course” limit=“1” section=“featured-course” />
</code><code>
<txp:article_custom form=“excerpt_featured_course” limit=“1” section=“featured-article” />
</code><code>
<txp:article_custom form=“whatever” limit=“1” section=“news” />
</code>
The second ‘featured-course’ article is probably showing because you also have an article tag on the page.
Edit: oh, and I don’t think you have to (or even can) use listform in article_custom.
Last edited by els (2006-10-12 23:05:51)
Offline
#3 2006-10-12 23:42:21
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Trying to figure out whether or not to use article_custom or other??
Ah, I see now, thank you! You’re right about having another article tag. What you gave me fixed my initial problem, but a second problem has came up. Before, with the article tag, I was using the listform for the excerpt and then when people clicked on “Full Article” it would take them to the full article which used the “default” form. So now, I’ve got everything looking okay on the homepage with the excerpts but if you click “Full Article” it takes you know where. I need it to take me to the full article. It’s not showing because the forms I’m using in the article_custom tags are the forms for the excerpt, and since I can’t use list form I’ve run into a road block here.
Last edited by deronsizemore (2006-10-12 23:43:47)
Offline
#4 2006-10-13 11:10:52
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Trying to figure out whether or not to use article_custom or other??
You can use conditionals:
<code>
<txp:if_individual_article>
<txp:article form=“featured_course” />
<txp:else />
(your article_custom tags)
</txp:if_individual_article>
</code>
or something like this:
<code>
<txp:if_section name=”“>
(your article_custom tags)
<txp:else />
<txp:article />
</txp:if_section>
</code>
Or you can give the sections for the individual articles their own page template.
Offline
#5 2006-10-13 17:27:40
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Trying to figure out whether or not to use article_custom or other??
Thank you very much! I just went with the separate page templates for each article method.
I always get confused on conditionals, don’t know why but they never seem to work for me. I need to read up I guess.
Thanks again.
Offline