Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-03-02 22:21:58

claytonbellmor
Member
Registered: 2007-03-02
Posts: 10

Directing Different Articles from the same Category

I tried installing some plug-ins that would allow more categories, but I couldn’t find anything.

Supposing that you’re only allowed the “Article Category” and it’s subsequent sections, how would I make one section under the Articles Category go to one section of my layout, and another section go to another area?

Here’s my little site design”>

Any help would be great. I spent a long time on this site and other forums looking for solutions but honestly didn’t find anything.

Thanks!

Offline

#2 2007-03-02 23:36:14

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

Re: Directing Different Articles from the same Category

I don’t really understand what you’re saying about categories, but here’s a try: txp:article_custom.

<txp:article_custom section="front" category="..." />

in the ‘pagecontent’ div.

<txp:article_custom section="news" category="..." />

in the ‘news’ div.

Last edited by els (2007-03-02 23:39:31)

Offline

#3 2007-03-03 01:17:08

claytonbellmor
Member
Registered: 2007-03-02
Posts: 10

Re: Directing Different Articles from the same Category

I can sort of see what you are trying to explain to me.

Let me see if this will help explain what I’m trying to accomplish better.

My Categories
My Publishing Section
(The images are redundant, but better more than less.)

What I’m trying to accomplish is a system so that when my client is in /Content/Write and decides to publish something new he can decide where his published text will go; whether on the right side of the main page or the left side (main content or news updates, respectively).

So how do I write the txp: tag to only include posts from a certain section within the Articles Category?

ex. <txp:article section=“frontpage” />

I hope this helped,

thanks for the interest in assisting me.

Last edited by claytonbellmor (2007-03-03 01:19:47)

Offline

#4 2007-03-03 01:25:57

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Directing Different Articles from the same Category

What I would do is create a new custom field and pull the articles where you want with the customfield attribute.

For instance, let’s say we call these two areas “main” and “sidebar”. You make a new custom field, say it’s named “Type” or something like that.

Then in your page (if I can see where you’re wanting to put these):

<div id="pagecontent">
<txp:article Type="main" />
</div>

<div id="newsman">
<txp:article Type="sidebar" />
</div>

All your users has to do is type in “main” or “sidebar” in his “type” field, and it will go where he wants it.

Make sense?

If you go this route, make sure you pick descriptive but still somewhat generic labels for these, so it will still make sense when the site layout gets changed again.

Offline

#5 2007-03-03 01:40:06

claytonbellmor
Member
Registered: 2007-03-02
Posts: 10

Re: Directing Different Articles from the same Category

That looks great. I’ve gotta run but I’ll give it a try tomorrow.

Thanks, I’ll repost whether it works!

Offline

#6 2007-03-03 07:43:42

claytonbellmor
Member
Registered: 2007-03-02
Posts: 10

Re: Directing Different Articles from the same Category

Okay, I plugged in the code and tried it out.

I have a few clarifying questions though.

You said to make a ‘custom field’, how do I go about doing that? Is that done in /Content/Categories/?

Here’s how I understand Textpattern so far, there’s 4 publishing titles: Articles, Links, Images, File categories. And then within each four, you have the ability to make more “sections”.

So how do I make custom fields?

Thanks so much for this, I really do appreciate it.

Offline

#7 2007-03-03 14:41:43

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

Re: Directing Different Articles from the same Category

In Admin > Preferences > Advanced you can name your custom fields. So for example in ‘Custom field 1 name’ you enter ‘Type’.
Now in the write screen, under ‘Advanced options’, there is a custom field ‘Type’. The user enters there where he wants the article to go, e.g. ‘main’ or ‘sidebar’. If you use Mary’s code on your page, the articles will be displayed where you want them.
Mind that the user has to take care to avoid typos in the custom field, it only works if the custom field content exactly matches the ‘Type’ attribute in your article tag.

Offline

Board footer

Powered by FluxBB