Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-08-17 01:39:11
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Problems with magazine style layout
Hello
I am trying to create a site with a magazine kind of layout. The layout starts with a large article, then two small lined horisontally with each other. After that, another large article, followed by the advertisment.
The layout should look like this Juvenorge.com/dev/
But looks like this 2Dropsdesign.com/textpattern
I have big problems creating a Txp-theme that gives me the correct news style. This is my default page:
<txp:article listform="article_large" limit="5" />
<txp:article_custom allowoverride="0" form="advertisment" limit="1" pgonly="0" section="advertisment" sort="Posted asc" status="5"/>
<txp:if_individual_article>
<txp:article pgonly=“1” allowoverride=“0” form=“article_large_full” />
<span class=“pag”><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev></span>
<span class=“pag”><txp:link_to_next><txp:next_title /> »</txp:link_to_next></span>
<txp:else />
<span class=“pag”><txp:older>« <txp:text item=“Forrige side” /></txp:older></span>
<span class=“pag”><txp:newer><txp:text item=“Neste side” /> »</txp:newer></span>
</txp:if_individual_article>
I have tried to use the article_custom, and that acctually gives me the right front page. The problem is that when I read permlinks, it does display a total mess of all news cramped together.
I would really have apriciated some help here. I have try to read about template building, but I guess I not much of a coder. Anyone got any tips for me?
Thanks
Last edited by Sono Juventino (2008-08-17 03:42:10)
Offline
Re: Problems with magazine style layout
Hi Thomas,
could you try this?
<txp:if_article_list>
<txp:article form="article_large" limit="5" />
<txp:article_custom allowoverride="0" form="advertisment" limit="1" section="advertisment" sort="Posted asc" status="5"/>
<span class="pag"><txp:older>« <txp:text item="Forrige side" /></txp:older></span>
<span class="pag"><txp:newer><txp:text item="Neste side" /> »</txp:newer></span>
<txp:else />
<txp:article allowoverride="0" form="article_large_full" />
<span class="pag"><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev></span>
<span class="pag"><txp:link_to_next><txp:next_title /> »</txp:link_to_next></span>
</txp:if_article_list>
Offline
#3 2008-08-17 03:41:34
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Re: Problems with magazine style layout
Thank you very much. That helped me to get the layout right. The only problem is that the “older news” link doesn’t make any sense anymore. I know it is because of that I use limit=“1” on <txp:article />, but that’s the only way I have found to get my layout right.
default page code:
<txp:if_article_list>
<txp:article form="article_large" limit="1" />
<txp:article allowoverride="0" limit="1" form="article_small_left" offset="1" pgonly="0" sort="Posted asc" />
<txp:article allowoverride="0" limit="1" form="article_small_right" offset="2" pgonly="0" sort="Posted asc" />
<txp:article allowoverride="0" limit="1" form="article_large" offset="3" pgonly="0" sort="Posted asc" />
<txp:article_custom allowoverride="0" form="advertisment" limit="1" pgonly="0" section="advertisment" sort="Posted asc" status="5"/>
Article-large form:
<div class="article-header">
<txp:permlink title="Les resten av nyheten"><txp:article_image /></txp:permlink>
<h2 class="overlay" title="Les hele nyheten">
<txp:permlink><span class="article-category"><txp:category1 title="1" />: </span><txp:title /></txp:permlink>
</h2>
</div>
<div class="article">
<span class="author"><txp:author />, <txp:posted /></span>
<txp:excerpt />
</div>
Article-small-left/right forms: (Only difference is the class article-s-l/r… l=left or r=right)
<div class="article-small article-s-l">
<txp:article_image thumbnail="1" />
<h3 title="Les hele nyheten"><txp:permlink><txp:title /></txp:permlink></h3>
<txp:excerpt />
</div>
Is is possible to get the pagination more logical, or does I just have to live with it?
Thanks for wonderfull help, maniqui! :D
Last edited by Sono Juventino (2008-08-17 03:42:33)
Offline
Re: Problems with magazine style layout
Hi Thomas,
the solution may be the pageby attribute for txp:article
Try this on your default page code:
<txp:if_article_list>
<txp:article form="article_large" limit="1" pageby="4" />
<txp:article allowoverride="0" limit="1" form="article_small_left" offset="1" pgonly="0" sort="Posted asc" pageby="4" />
<txp:article allowoverride="0" limit="1" form="article_small_right" offset="2" pgonly="0" sort="Posted asc" pageby="4" />
<txp:article allowoverride="0" limit="1" form="article_large" offset="3" pgonly="0" sort="Posted asc" pageby="4" />
<txp:article_custom allowoverride="0" form="advertisment" limit="1" pgonly="0" section="advertisment" sort="Posted asc" status="5"/>
You have to set the pageby value to the total number of articles you want to paginate (in this case, 4 articles —the ad doesn’t count—). And I think it’s necessary to put it on all txp:article
(but you could try putting it just on the last or the first txp:article
and tell us if it works)
Offline
#5 2008-08-17 05:02:49
- Sono Juventino
- Member
- From: Skedsmo, Norway
- Registered: 2007-12-22
- Posts: 81
Re: Problems with magazine style layout
Thanks. Works like a charm on the default page.
I will answer your last question once I’ve created more pages with this kind of layout, but that will be tommorow. Time for bed. :)
Thanks for all the help, maniqui! It’s people like you that let noobs like me play with such a wonderful tool that Txp is!
Offline
Re: Problems with magazine style layout
Hi Thomas,
you are welcome, glad to help you.
BTW, the Juventus… the Juventus… I think I know that team… ah… now I remember… our team won the 1973 Intercontinental Cup against them ;), with a goal by Bochini, the confessed idol of Maradona ;)
Offline