Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-30 17:15:46

Marty
New Member
Registered: 2006-03-30
Posts: 7

<txp:article > to show a single article depended by the link arguments

Does the article tag allow to show only one article on the page? And the the article may be a different if the arguments in the link chage. But I want to use the same page for different articles. At all times it should show only one article. What are some ways of getting this done in textpattern, im a newbee so any suggestions will be greatly appriciated. thnx

Last edited by Marty (2006-03-30 17:39:42)

Offline

#2 2006-03-30 19:01:39

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

Re: <txp:article > to show a single article depended by the link arguments

TextBook: article

Offline

#3 2006-03-30 19:10:05

Marty
New Member
Registered: 2006-03-30
Posts: 7

Re: <txp:article > to show a single article depended by the link arguments

textbook is very hard to read. This textpattern thing is a big waste of time, but unfortunatly i have no choice and have to figure it out. it will propobobly easier to figure it out looking at the text pattern source code. Some body needs rewrite the documentation for this.

Offline

#4 2006-03-30 19:25:26

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

Re: <txp:article > to show a single article depended by the link arguments

Though I don’t agree (if you’re having trouble understanding TextBook, there is always this forum with lots of friendly people who are willing to answer your questions), here’s a tip: have a look at the conditional tags here (that’s all tags starting with txp:if_).
If you need help, ask here. Don’t say TextBook is hard to read just because you are still learning, people have worked and are working very hard to put that documentation together.

Offline

#5 2006-03-30 19:59:56

Marty
New Member
Registered: 2006-03-30
Posts: 7

Re: <txp:article > to show a single article depended by the link arguments

I got lil bit frustrated with textpattern. Im sorry if i offended any one. I am still learning textpattern and i am new at this. Its really good that there are ppl in the forum to help. I should have stayed focused on getting the solution rather than complain. But I still think that textbook needs more attention. There are different technologies and some are harder to learn then others. I dont think textpattern should be all that hard to figure out if it was explained better. But i understand that there is not enough ppl to make things better for textpattern.

Offline

#6 2006-03-30 20:17:52

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: <txp:article > to show a single article depended by the link arguments

First, a possible solution to your problem:

In your page template (Prestentation -> Pages) put something like
<txp:article limit="1" />
That is all what you need to achieve what you want.
Also, you can play with <txp:if_section name="section_name"></txp:if_section> if you need different attributes for different sections.

Marty wrote:

I should have stayed focused on getting the solution rather than complain.

Not one, but two post complaining, not focused in the solution.

This textpattern thing is a big waste of time, but unfortunatly i have no choice and have to figure it out.

A big waste of time? Cant you see it as an investment? is it the right time to say that is a big waste? If you stay here, in one or two weeks tell me if it was a big waste… You have registered today and only made three post (and two are complaining posts…).

Have no choice? It’s plenty of CMS out there. Maybe there are better choices than TXP for you.

Some body needs rewrite the documentation for this.

But I still think that textbook needs more attention.

If you stay here, I will ask you to help with the TXB, if you want.

There are different technologies and some are harder to learn then others. I dont think textpattern should be all that hard to figure out if it was explained better.

This one is hard to learn if you think you are wasting your time will trying to learn.
And also hard to learn if you are complaining… Dont waste your time…

But i understand that there is not enough ppl to make things better for textpattern.

There is the people that there is. Dont know if enough or not. Do you forget that all this “big waste of time” is volunteer?

Last edited by maniqui (2006-03-30 20:31:03)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2006-03-30 20:23:01

Marty
New Member
Registered: 2006-03-30
Posts: 7

Re: <txp:article > to show a single article depended by the link arguments

thnx for the help, im gonne try this. The Forum is really helpfull to get the answears you need

Last edited by Marty (2006-03-30 20:25:56)

Offline

#8 2006-03-30 20:25:06

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: <txp:article > to show a single article depended by the link arguments

BTW:

I can understand you, Marty.
Once, I did exactly the same that you did: complain.
Read my complain at the Drupal CMS forums.

As you did, I have made just two post at Drupal forums.
One, trying to find out how to do something. The second one, complaining.

Well, those days, I spent more than few hours trying to make my head around Drupal (I still have nightmares with the face of the Drupal logo).
I would say that I spent two or three weeks in Drupal learning, and I’m ashamed: it’s few time to learn something.

Ah, Marty, I forget to said it: welcome!

Last edited by maniqui (2006-03-30 20:25:35)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2006-03-31 00:06:31

Marty
New Member
Registered: 2006-03-30
Posts: 7

Re: <txp:article > to show a single article depended by the link arguments

I found a solution to this, its really complicated and hard to explain, i had to see my friends code to understand it, he had to walk me through it. So all you newbies that need to learn how to use textpattern, good luck getting some answears from textbook or the forum. It just doesnt explain enough. So your on your own. don’t count on any help other than your self.

Offline

#10 2006-03-31 00:31:52

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: <txp:article > to show a single article depended by the link arguments

Please, Marty, if you have found a solution, it’s a good practice to share it at forums (in this same thread). This way, other people that have the same question wont be on their own.

To post code here, wrap your code in < code>< /code> (remove the white spaces I left).
This way, other wont be at their own…

Second, I think what you want to achieve isnt very clear.
Let’s see…

Marty wrote:

Does the article tag allow to show only one article on the page?

Yes, it does. As said before: <txp:article limit="1" />. This will output only 1 live article (limit="1") for the current section (if you are in a section). If you are in the frontpage (aka “home”), it will output 1 article (the last article) from those section that you have configured to “Show in frontpage” (in Presentation -> Sections)

And the the article may be a different if the arguments in the link change.

If your URL displays something like www.mysite.com/blog/, the <txp:article limit="1" /> will output 1 live article published on the “blog” section. As said before.
If your URL displays www.mysite.com/complains/, the <txp:article limit="1" /> will output 1 live article published on the “complains” section.

But I want to use the same page for different articles.

That’s why you only need to put <txp:article limit="1" />, because that tag is section-sensitive.
But you can also use <txp:if_section></txp:if_section>.
For example, to use different attributes for the txp:article tag depending on each section.

<code>
<txp:if_section name=“blog”>
<txp:article limit=“1” form=“myspecialform” /><!- this will show your articles using the “myspecialform” ->
</txp:if_section>
<txp:if_section name=“recipes”>
<txp:article limit=“1” form=“myrecipesform” /><!- this will show your articles using the “myrecipesform” ->
</txp:if_section>
<txp:if_section name=“complains”>
<txp:article limit=“999” /><!- this will output your 999 last complains, but I know you have more ->
</txp:if_section>
</code>

At all times it should show only one article.

Limit=“1”

What are some ways of getting this done in textpattern, im a newbee so any suggestions will be greatly appriciated. thnx

I think you didnt appreciated anything greatly…

don’t count on any help other than your self.

Mary, Els and me have tried to help you… why are you telling lies?

Last edited by maniqui (2006-03-31 00:32:23)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#11 2006-03-31 01:07:24

Marty
New Member
Registered: 2006-03-30
Posts: 7

Re: <txp:article > to show a single article depended by the link arguments

Yes I tried this but for some reason the if_section did not work. And it would of propobly be a good solution. But I have accomplished this with a different approach.

What i tried to do is to have a menu with different links, when i click on the link in the menu, i wanted an article to show up. I want the menu and header to stay the same, just change the article. So I wanted to have a link to an article to show in the same page.

this is the code in the page for the menu. This will display a title which links to each article in the “menuoptions” category.
<code>
<txp:article_custom form=“title_list” category=“menuoptions” section=“main” sortby=“Posted” sortdir=“asc” /> </code>
I also needed a form “title_list” which points to this menu custom_article in the menu. The code in the form:
<code><txp:permlink ><txp:title /></txp:permlink></code>

the above will produce a link with a title of each article in the menuoptions category.

then in the body you need a <code> <txp:article form=“home” sortby=“Posted” limit=“1” /> </code> – this will display the article from the link generated in the menu.

I was hoping for some thing simple that directly points to an article. I hope this might help some one…

Last edited by Marty (2006-03-31 01:09:54)

Offline

#12 2006-03-31 01:53:04

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: <txp:article > to show a single article depended by the link arguments

Marty, check the FAQs
It’s very helpful for start learning TXP.

Especially, read this one: Common How Do I Questions


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB