Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-12-22 01:49:04
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Tricky article layout. Would've loved a little help. (Fixed)
Hello, I’m kind of new to TP, but I like it a lot!
First of all I would like to say that the “article image” function is absolutely wounderfull! That’s the main reason I even picked TP.
Link to my page
- http://musikkprat.com/tp/
- http://2dropsdesign.com/x/x.png (Photoshop Scetch)
My layout problems: (Explanation. You may skip this part)
I have two different templates regarding the posts.
1.News in categories “news, match review, match analysis” and so on are assigned with a article image with width: 500px and height: 300px. These categories should also have some extra ids on some divs.
2. Categories like “Articles, Annoncements”, and such should get the article image with 260*180px. These news should be displayed in groups of two, one left and one right.
- I’ve tried to fix this design matter with making three “forms” under “presentasion”. This works great. The forms are main_news, left and right.
What I can’t manage to do: (The Main problem)
I want just three news on my main page. One of the first category and two of the secound category right under. To do that, I’ve modified my “default” page under presentasion. It now looks like this:
<txp:article form="default" limit="1" listform="default" pgonly="0" sort="Posted asc" status="4" />
<txp:article form="small_news_left" limit="1" listform="small_news_left" offset="0" pgonly="0" sort="Posted desc" />
<txp:article form="small_news_right" limit="1" listform="small_news_right" offset="1" pgonly="0" sort="Posted desc" />
Is there any way of telling TP that the first news should be taken from category “news, review and +” only?
Last edited by Sono Juventino (2007-12-22 20:52:22)
Offline
Re: Tricky article layout. Would've loved a little help. (Fixed)
I’d suggest checking out txp:article_custom
Offline
#3 2007-12-22 03:47:14
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Re: Tricky article layout. Would've loved a little help. (Fixed)
I’ve tried txp:article_custom, and it really works great!
There is just one problem. I’m getting this warning:
Tag error: -> Textpattern Notice: Page template default does not contain a txp:article tag on line 464
This is me code:
<txp:article_custom section="main_news" status="live" limit="1" />
<txp:article_custom section="small_news" status="live" limit="1" form="small_news_left" />
<txp:article_custom section="small_news" status="live" limit="1" offset="1" form="small_news_right" />
The problem is pretty obvious. “Just put in a txp:artice”. The problem isen’t that simple after all, because I just can’t use it. With two different layouts on articles, this is the way I need to handle things. Any suggestions?
Edit: One more thing.
This is my layout displaying the whole article. Were do I have to edit it?
Last edited by Sono Juventino (2007-12-22 03:49:21)
Offline
Re: Tricky article layout. Would've loved a little help. (Fixed)
Don’t worry about the warning, just turn site’s status to Live and it will go away. Your code is good, althought you won’t need those status="live"
-attributes.
If you really want to take that error away, just add <txp:article pgonly="1" />
to your page template. It won’t display anything, but will do an article count and cures that warning.
Cheers!
Last edited by Gocom (2007-12-22 05:45:24)
Offline
#5 2007-12-22 19:15:22
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Re: Tricky article layout. Would've loved a little help. (Fixed)
Thank you all for good and quick support! It’s just wonderfull!
The last thing (I’m hoping so) I’m wondering about is the single-article mode. Were can I edit full articles like this. Just notice that it looks the exact same way as my front page, so don’t be confused.
Offline
Re: Tricky article layout. Would've loved a little help. (Fixed)
Not sure if I understand the question completely, but I think I know what you’re asking. You’ll want to utilize the txp:if_individual_article tag. so something like:
<txp:if_individual_article>
<txp:article />
<txp:else />
<txp:article_custom />
</txp:if_individual_article>
Offline
#7 2007-12-22 19:47:46
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Re: Tricky article layout. Would've loved a little help. (Fixed)
I’ve looked upon the tag you provided, but I’m not sure that is what I’m looking for. I’ll try to explain one more time:
At my front page, there is three different articles alle the time. All these articles shows an Excerpt of the article. The article has a link, “read more”. (Les Videre in Norwegian) When clicking that link, you’ll get the whole shebang. My problem is, when clicking the “Read more” link, you’ll just see an layout exact same as the front page, not the single article selected by the read more-link.
Should I explain further? Sorry for my bad English by the way. :)
Offline
Re: Tricky article layout. Would've loved a little help. (Fixed)
You need exatly what variaas offered to you, as <txp:article_custom />
isn’t context sensitive as <txp:article />
is. So, <txp:article_custom />
can’t show single article by depending the requested URL.
<txp:if_indivivual_article>
<!-- Your single article view here -->
<txp:article />
<txp:else />
<!-- Your article list/frontpage view here -->
<txp:article_custom section="main_news" limit="1" />
<txp:article_custom section="small_news" limit="1" form="small_news_left" />
<txp:article_custom section="small_news" limit="1" offset="1" form="small_news_right" />
</txp:if_indivivual_article>
Cheers!
Last edited by Gocom (2007-12-22 19:58:37)
Offline
Offline
#10 2007-12-22 20:02:30
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Re: Tricky article layout. Would've loved a little help. (Fixed)
Thank you very much guys! The support is just incredible here at TP!
Offline
#11 2007-12-22 20:15:20
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Re: Tricky article layout. Would've loved a little help. (Fixed)
Looks like it just wasen’t that simple after all. After applying the code above, I’m just getting this warning:
Tag error: <txp:if_indivivual_article> -> Textpattern Warning: tag does not exist on line 973
I’ve pasted the code into pages-default at Presentasion. Should I’ve done things different?
Offline
Offline