Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#76 2007-12-15 15:48:05

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] ob1_pagination

Alex007 wrote:

<txp:chh_article_custom category="Latest-News" limit="4" listform="news" sort="posted desc" />
<txp:if_article_list>
<txp:article />
<div class="paginationwrap">
<txp:ob1_pagination firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulclass="pagination" />
</div>
</txp:if_article_list>

If you take out the chh_article_custom tag, and just use the txp article tag, what do you get? Assuming you are in a section that has articles in it, your pagination will work fine.

For example, if you have 10 articles in a section, if you change the article tag to article limit=“5”, you should get a second page in your pagination list.

Last edited by ruud (2007-12-16 12:44:47)

Offline

#77 2007-12-15 16:14:43

Alex007
Member
Registered: 2007-10-24
Posts: 57

Re: [plugin] [ORPHAN] ob1_pagination

Yes if i only want to show articles in a section this works but when i want to show them in a category it wont. thats why i am stying to use the chh_article_custom

Offline

#78 2007-12-15 17:05:46

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] ob1_pagination

The TXP article_custom tag should give you all you need. I don’t think you even need chh_article_custom anymore, but I could be wrong as I don’t know this particular plugin.

I have the following in one older site, which might be helpful for you, in case you are looking to paginate within categories. Its well commented to explain what it does.

<txp:if_individual_article>
<!-- article page: display the individual article -->
<txp:article form="article" limit=1 />
</txp:if_individual_article>

<txp:if_article_list>

<txp:if_category>
<!-- category page: display the sticky article first -->
<txp:article status="sticky" form="article_sticky" limit=1 />
<!-- then the rest of the category articles -->
<txp:article listform="list_articles" form="article" limit="10" />
<txp:ob1_googlenav linkcurrent="1" ulid="googlenav" liselected="current" firsttext="First" previoustext="&laquo; Previous" nexttext="Next &raquo;" lasttext="Last" />
<txp:else />
<!-- section page: display the sticky article -->
<txp:article status="sticky" form="article_sticky" limit=1 />
<!-- then the rest of the articles -->
<txp:article listform="list_articles" form="article" limit="10" />
</txp:if_category>

</txp:if_article_list>

Offline

#79 2007-12-16 11:51:01

Alex007
Member
Registered: 2007-10-24
Posts: 57

Re: [plugin] [ORPHAN] ob1_pagination

Thanks for this – I have tried it with the following but it still doesn’t seem to show the pagination, I can see you are using the

  • ob1_googlenav
I dont have this plugin installed – i have ob1_pagination v2.5 but tried it with both taggs…
<txp:if_individual_article>
<!-- article page: display the individual article -->
<txp:article form="news" limit="1" />
</txp:if_individual_article>

<txp:if_article_list>

<txp:if_category>
<!-- category page: display the sticky article first -->
<txp:article_custom category="Latest-News" form="news" limit="10" />

<txp:ob1_googlenav linkcurrent="1" ulid="googlenav" liselected="current" firsttext="First" previoustext="&laquo; Previous" nexttext="Next &raquo;" lasttext="Last" />

<txp:ob1_pagination firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulclass="pagination" />

<txp:else />
<!-- section page: display the sticky article -->
<txp:article_custom status="live" category="Latest-News" form="news" limit=1 />
<!-- then the rest of the articles -->
<txp:article listform="list_articles" form="news" limit="10" />
</txp:if_category>
<txp:ob1_pagination firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulclass="pagination" />
</txp:if_article_list>

Anyyone have any idea whats going worng here?? this should work all i want to do is list 6 articles in the Latest-News category and then show pagination ;(

Edit: Alex, if you edit this post (and your previous ones), you’ll see how code quoting works here on the forum ;)

Offline

#80 2007-12-16 12:04:09

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] ob1_pagination

Sorry about the ob1_googlenav – the code is copied from an older site. If you replace all those instances with ob1_pagination you should be fine.

Its a little unclear what is wrong because I don’t know what actually happens, nor what you want to happen…?

Offline

#81 2007-12-16 12:55:24

Alex007
Member
Registered: 2007-10-24
Posts: 57

Re: [plugin] [ORPHAN] ob1_pagination

OK I will try and show you what i am trying to do…

these pages show the pagination <prev 1 2 last> etc

  • http://www.westlondonlln.org/heathrow-news
  • http://www.westlondonlln.org/stem-news
  • http://www.westlondonlln.org/health-social-care-news

and in the

  • http://www.westlondonlln.org/news

I am trying to display all the news articles from the above sections and then have the pagination.

So each article I have gets added into their unique section and any of the article i want in the /news section i add to the category Latest-News.

So concluding… news section to display list of articles in category Latest-News.

Make sense?

Offline

#82 2007-12-16 13:06:44

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] ob1_pagination

So why not just use:

<txp:article status="live" category="Latest-News" form="news" limit=1 />

Instead of:

<txp:article_custom status="live" category="Latest-News" form="news" limit=1 />

I don’t think article_custom supports paging.

Offline

#83 2007-12-16 14:04:25

Alex007
Member
Registered: 2007-10-24
Posts: 57

Re: [plugin] [ORPHAN] ob1_pagination

I have changed it to the following code on here

  • http://www.westlondonlln.org/news

It now shows the first article, then 4 articles that are in the ‘news’ section, and then pagination – but as you paginate through it only shows 1 article in the ‘news’ section.

<!-- section page: display the sticky article -->
<txp:article status="live" category="Latest-News" form="news" limit="1" />
<!-- then the rest of the articles -->
<txp:article form="news" limit="10" />
<div class="paginationwrap">
<txp:ob1_pagination firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulclass="pagination" />
</div>

Offline

#84 2007-12-16 14:35:37

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] ob1_pagination

I think you can change that to:

<!-- section page: display the first two articles then paginate -->
<txp:article status="live" category="Latest-News" form="news" limit="2" />
<div class="paginationwrap">
<txp:ob1_pagination firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulclass="pagination" />
</div>

That would show the first two articles before paginating. It appears you have 4 articles in your section, hence the limit=“2” so you can check the pagination.

Last edited by jstubbs (2007-12-16 14:36:03)

Offline

#85 2007-12-16 14:41:26

Alex007
Member
Registered: 2007-10-24
Posts: 57

Re: [plugin] [ORPHAN] ob1_pagination

This paginates but through the ‘news’ section not all of that articles in category ‘Latest-News’

I don’t think the pagination works with <txp:article />

Offline

#86 2007-12-16 14:51:34

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] ob1_pagination

It does work with txp:article, but its just not the way you want it. Assuming you are in News section, and the articles you want to pull are in other sections, you are correct, we need article_custom:

<!-- section page: display the first two articles then paginate -->
<txp:article_custom status="live" section="heathrow-news,stem-news,health-social-care-news" category="Latest-News" form="news" limit="2" />
<div class="paginationwrap">
<txp:ob1_pagination firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulclass="pagination" />
</div>

Offline

#87 2007-12-16 15:00:58

Alex007
Member
Registered: 2007-10-24
Posts: 57

Re: [plugin] [ORPHAN] ob1_pagination

Ok So i have tried this, in the news and it displays nothing – am in doing something wrong at the article level?

<!-- section page: display the first two articles then paginate -->
<txp:article_custom status="live" section="heathrow-news,stem-news,health-social-care-news,news" category="Latest-News" form="news" limit="2" />
<div class="paginationwrap">
<txp:ob1_pagination firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulclass="pagination" />
</div>

Last edited by Alex007 (2007-12-16 15:06:15)

Offline

#88 2007-12-16 15:09:39

Alex007
Member
Registered: 2007-10-24
Posts: 57

Re: [plugin] [ORPHAN] ob1_pagination

This is all of the code – am i doing something wrong somewhere else, this shows all articles in “Latest-News” but no pagination – so almost ther just without the pagination!

<txp:if_individual_article> 
	<h3 id="othernews">Other News</h3>
<ul class="othernews">
<txp:article_custom  form="news_list" section="news"  limit="999" pgonly="0" status="4" time="any" />
</ul>
<txp:else />
<txp:if_article_list>
<!-- section page: display the first two articles then paginate -->
<txp:article_custom  status="live" category="Latest-News" listform="news" limit="12" />
<div class="paginationwrap">
<txp:ob1_pagination firsttext="First" previoustext="Previous" nexttext="Next" lasttext="Last" ulclass="pagination" />
</div>
</txp:if_article_list>
</txp:if_individual_article>

Offline

#89 2007-12-16 15:34:08

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] ob1_pagination

Alex007, I think article_custom does not support pagination (I don’t know, because its not clear from the TextBook entry).

OK – after some testing on one of my sites, it definitely appears article_custom does NOT support paging. I think if you really want to use this pagination plugin, you will have to change your articles and place them in the “news” section, then use categories for organisation.

Pagination is only going to pull articles from within a given section.

What you could do is use if_category conditionals to pull out all the articles within the category you want to show, and use TXP’s built in tags (like next/prev) for pagination within the categories.

Offline

#90 2007-12-16 17:08:35

Alex007
Member
Registered: 2007-10-24
Posts: 57

Re: [plugin] [ORPHAN] ob1_pagination

Thanks jstubbs for all your help with this.

This is why i think i was trying it with chh_article_custom as iblastoff suggested you can paginate through articles within a category here

I hope i can get to the bottom of this as it seems crazy u cant do this with the standard txp library.

Thanks again.
A.

Offline

Board footer

Powered by FluxBB