Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-10-08 13:48:50

Gallex
Member
Registered: 2006-10-08
Posts: 1,331

list of article, pagination, different frontpage

i have a long list of articles where the first three articles is displayed differently. using ob1_pagination and soo_if_frontpage i’d like to use pagination in my list : first 3 articles with excerpt + 7 next article titles in frontpage and 10 article titles in next pages. something similar like here + pagination. but can’t get it to work propely

page:

<txp:if_section name="artiklid">
<txp:if_article_list>
<txp:soo_if_frontpage>
<txp:article limit="3" />
<ul class="pealkirjad"><txp:article form="article_b" offset="3" limit="7" /></ul>
<txp:ob1_pagination previoustext="Eelmine" nexttext="Järgmine" ulclass="pagination" liselected="active" />
<txp:else />
<ul class="pealkirjad"><txp:article form="article_b" offset="0" limit="10" /></ul>
<txp:ob1_pagination previoustext="Eelmine" nexttext="Järgmine" ulclass="pagination" liselected="active" />
</txp:soo_if_frontpage>
</txp:if_article_list>
</txp:if_section>

article_b form:

<li><txp:permlink><txp:title /></txp:permlink></li>

Offline

#2 2009-10-08 21:32:36

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

Re: list of article, pagination, different frontpage

I’m not sure how ob1_pagination works, but using the regular pagination (older/newer) you’d need to use pageby="10" in both the article tags for the front page.

Offline

#3 2009-10-09 09:57:14

Gallex
Member
Registered: 2006-10-08
Posts: 1,331

Re: list of article, pagination, different frontpage

Els wrote:

I’m not sure how ob1_pagination works, but using the regular pagination (older/newer) you’d need to use pageby="10" in both the article tags for the front page.

like this?

<txp:if_section name="artiklid">
<txp:if_article_list>
<txp:soo_if_frontpage>
<txp:article limit="3" />
<ul class="pealkirjad"><txp:article form="article_b" offset="3" pageby="10" /></ul>
<txp:newer>Newer</txp:newer><txp:older>Older</txp:older>
<txp:else />
<ul class="pealkirjad"><txp:article form="article_b" offset="0" pageby="10" /></ul>
<txp:newer>Newer</txp:newer><txp:older>Older</txp:older>
</txp:soo_if_frontpage>
</txp:if_article_list>
</txp:if_section>

no difference. the first 3 differently styled (title+excerpt) articles stay at the top of each page till to the end of list. i’m using this <txp:soo_if_frontpage> plugin uncorrectly…mhh

Offline

#4 2009-10-09 10:33:43

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,319

Re: list of article, pagination, different frontpage

You deleted limit="7" / limit="10". What happens when you enter these again?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2009-10-09 10:45:38

Gallex
Member
Registered: 2006-10-08
Posts: 1,331

Re: list of article, pagination, different frontpage

uli wrote:

You deleted limit="7" / limit="10". What happens when you enter these again?

no help. take a look

Offline

#6 2009-10-09 11:09:05

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,319

Re: list of article, pagination, different frontpage

Gallex wrote:

no help.

It didn’t cure all the problems, but it changed the behavior essentially: Now we have pages! Thus I presume it really might be a problem with the if_frontpage tag.
Though I doubt it will help: have you tried the pg attribute?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#7 2009-10-09 11:57:26

Gallex
Member
Registered: 2006-10-08
Posts: 1,331

Re: list of article, pagination, different frontpage

uli wrote:

It didn’t cure all the problems, but it changed the behavior essentially: Now we have pages!

actually the pages had before as well – i changed back to old solution when i saw it didn’t work

Thus I presume it really might be a problem with the if_frontpage tag.
Though I doubt it will help: have you tried the pg attribute?

…but it did help :) thank’s.

surprisingly i discovered i has lost individual pages now.

working page:

<txp:if_section name="artiklid">
<txp:if_article_list>
<txp:soo_if_frontpage pg="1">
<txp:article limit="3" />
<ul class="pealkirjad"><txp:article form="article_b" offset="3" pageby="10" limit="7" /></ul>
<txp:newer>Newer</txp:newer><txp:older>Older</txp:older>
<txp:else />
<ul class="pealkirjad"><txp:article form="article_b" offset="0" pageby="10" limit="10" /></ul>
<txp:newer>Newer</txp:newer><txp:older>Older</txp:older>
</txp:soo_if_frontpage>
</txp:if_article_list>
</txp:if_section>

article form (not working with page above):

<div class="article">
<txp:if_article_list>
<txp:if_excerpt>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:excerpt />
<p class="meta"><txp:permlink>Loe edasi</txp:permlink></p>
<txp:else />
<h3><txp:title /></h3>
<txp:body />
</txp:if_excerpt>
<txp:else />
<h3><txp:title /></h3>
<txp:body />
</txp:if_article_list>
</div>

Last edited by Gallex (2009-10-09 12:19:17)

Offline

#8 2009-10-09 13:19:09

Gallex
Member
Registered: 2006-10-08
Posts: 1,331

Re: list of article, pagination, different frontpage

added this 2 lines before the end of a code and get it work

...</txp:soo_if_frontpage>
<txp:else />
<txp:article />
</txp:if_article_list>
</txp:if_section>

now i’ll try again with ob1_pagination

Offline

#9 2009-10-09 15:28:10

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: list of article, pagination, different frontpage

<txp:soo_if_frontpage pg="1" section="artiklid">
<txp:article limit="3" />
<ul class="pealkirjad"><txp:article form="article_b" offset="3" pageby="10" limit="7" /></ul>
<txp:newer>Newer</txp:newer><txp:older>Older</txp:older>
<txp:else />
<txp:article />
</txp:soo_if_frontpage>

Hard for me to follow this on my iPod ;) Note the above simplification.


Code is topiary

Offline

#10 2009-10-09 16:37:16

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

Re: list of article, pagination, different frontpage

You need the pageby attribute in both frontpage article tags:

<txp:article limit="3" pageby="10" />
<ul class="pealkirjad"><txp:article form="article_b" offset="3" pageby="10" limit="7" /></ul>

Last edited by els (2009-10-09 16:38:30)

Offline

#11 2009-10-09 18:37:31

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,319

Re: list of article, pagination, different frontpage

Gallex wrote

actually the pages had before as well – i changed back to old solution when i saw it didn’t work

Gallex, that’s good to know! And I don’t mean that ironic!
That’s important information for us in order to diagnose your problem. Not until knowing that paging worked I could locate the problem coming from the if:frontpage tag. Please try to see it a little more from our perspective. Statements like can’t get it to work propely don’t give us a clue what’s wrong with your site.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#12 2009-10-09 19:38:06

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: list of article, pagination, different frontpage

If I am following this correctly on my tiny screen, there wasn’t a problem with soo_if_frontpage, but simply a conditional logic problem: not enough “else” blocks. Another reason to try the simplification I suggested (with Els’s addition).


Code is topiary

Offline

#13 2009-10-10 13:48:09

Gallex
Member
Registered: 2006-10-08
Posts: 1,331

Re: list of article, pagination, different frontpage

jsoo wrote:

If I am following this correctly on my tiny screen, there wasn’t a problem with soo_if_frontpage, but simply a conditional logic problem: not enough “else” blocks. Another reason to try the simplification I suggested (with Els’s addition).

actually it was a problem with soo_if_frontpage as well until i added pg=“1” (uli’s suggestion).
secondly, jeff, your simplification not working. only frontpage displayed properly (3 first articles with excerpt+7 article titles) , second page displayed 10 articles with excerpts (but needed 10 article titles).

then i tried to remove <txp:if_section> (added name=“artiklid” to <txp:soo_if_frontpage pg=“1”>) conditionals and then <txp:if_article_list> to make code shorter, but both affected badly my other sections.

right now i left this code below, which works like i ment

<txp:if_section name="artiklid">
<txp:if_article_list>
<txp:soo_if_frontpage pg="1">
<txp:article limit="3" pageby="10" />
<ul class="pealkirjad"><txp:article form="article_b" offset="3" pageby="10" limit="7" /></ul>
<txp:newer>Newer</txp:newer><txp:older>Older</txp:older>
<txp:else />
<ul class="pealkirjad"><txp:article form="article_b" offset="0" pageby="10" limit="10" /></ul>
<txp:newer>Newer</txp:newer><txp:older>Older</txp:older>
</txp:soo_if_frontpage>
<txp:else />
<txp:article />
</txp:if_article_list>
</txp:if_section>

Offline

#14 2009-10-10 18:31:32

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: list of article, pagination, different frontpage

OK, sorry for misunderstanding (again, tiny Internet device not conducive to code evaluation). Glad you have it working. You should be able to slim it a little, by eliminating the if_section tags and adding the section attribute to soo_if_frontpage (keeping the if_article_list block as the outer block).

I wouldn’t say you had a “problem” with soo_if_frontpage, in the sense of a bug. Again, glad it’s working.


Code is topiary

Offline

#15 2009-10-10 23:26:41

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,319

Re: list of article, pagination, different frontpage

jsoo wrote:

I wouldn’t say you had a “problem” with soo_if_frontpage, in the sense of a bug.

Jeff, I was the first one in this thread to put the words “problem” and “if_frontpage” in one sentence, so I feel the need to answer. Apparently my words can have a second meaning. I actually wanted to express that there’s a problem in the way the if_frontpage tag is applied. Sorry if you felt bad, was not my intention.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB