Previous: X / Next: Y

3 views
Skip to first unread message

Adam

unread,
Apr 29, 2008, 5:54:35 AM4/29/08
to habari-users
After playing with the charcoal theme, I worked out how to use the <?
php $theme->next_page_link('Previous'); ?> <?php $theme-
>prev_page_link('Next;'); ?> tags to navigate though results pages.
However, I am at a loss as to how I convert this to output:

Next Article: xxxx
Previous Article: yyyy

Obviously this output would be better suited to reading individual
articles rather then results pages.

Ali B.

unread,
Apr 29, 2008, 6:35:58 AM4/29/08
to habari...@googlegroups.com
Adam,

I did not try having the next/prev methods for single articles, but I think It would be a great thing to have.
One way that I can think of of the top of my head is to break down the URL to retrieve the slug and then return the post title from the slug. Not exactly the best approach, and also since those methods returns the full <a> elements rather than the url only it would be extra hard to do it. We had a discussion at #habari of having another 2 methods that return only the url, and I will be (hopefully) submitting the patch today.

I am actively working on charcoal to finalize it to a usable theme. I would love enable posts navigation in single templates along with the article name. For people who wouldn't like to have that, it would be an option that you can disable

For home (and other multi templates), charcoal is still using its own method of generating the links, but I will switch it to use the new methods soon.

--
Ali B / dmondark
http://www.awhitebox.com

Adam

unread,
Apr 29, 2008, 6:47:05 AM4/29/08
to habari-users
Hi Ali,

Great, sounds like a new implementation of this navigation system is
well on its way. If it gets implemented in the next charcoal release,
I look forward to creeping in at the dead of night, tucking the code
under my arm and escaping out the back door leaving nothing but
footprints and the echoes of hedonistic laughter.

/ Adam


On Apr 29, 11:35 am, "Ali B." <dmond...@gmail.com> wrote:
> Adam,
> I did not try having the next/prev methods for single articles, but I think
> It would be a great thing to have.
> One way that I can think of of the top of my head is to break down the URL
> to retrieve the slug and then return the post title from the slug. Not
> exactly the best approach, and also since those methods returns the full <a>
> elements rather than the url only it would be extra hard to do it. We had a
> discussion at #habari of having another 2 methods that return only the url,
> and I will be (hopefully) submitting the patch today.
>
> I am actively working on charcoal to finalize it to a usable theme. I would
> love enable posts navigation in single templates along with the article
> name. For people who wouldn't like to have that, it would be an option that
> you can disable
>
> For home (and other multi templates), charcoal is still using its own method
> of generating the links, but I will switch it to use the new methods soon.
>

Ali B.

unread,
Apr 29, 2008, 8:57:02 AM4/29/08
to habari...@googlegroups.com
Great :)

In fact, I think K2 is already achieving what you need when it comes to navigation within single posts. Take a look at K2's entry.single.php, lines 7 through 12.


On Tue, Apr 29, 2008 at 12:47 PM, Adam <akwi...@gmail.com> wrote:

Hi Ali,

Great, sounds like a new implementation of this navigation system is
well on its way. If it gets implemented in the next charcoal release,
I look forward to creeping in at the dead of night, tucking the code
under my arm and escaping out the back door leaving nothing but
footprints and the echoes of hedonistic laughter.

/ Adam


Adam

unread,
Apr 29, 2008, 1:34:20 PM4/29/08
to habari-users
> In fact, I think K2 is already achieving what you need when it comes to
> navigation within single posts. Take a look at K2's entry.single.php, lines
> 7 through 12.

I think you might be looking at a different K2 to me... I can't see
any navigation related stuff there.
The Daring Fireball 'Previous', 'Next' structure is what I am after.

Ali B.

unread,
Apr 29, 2008, 2:18:24 PM4/29/08
to habari...@googlegroups.com


On Tue, Apr 29, 2008 at 8:34 PM, Adam <akwi...@gmail.com> wrote:

The Daring Fireball 'Previous', 'Next' structure is what I am after.


what version are you talking about, I can see that in HEAD (from svn).

Adam

unread,
Apr 29, 2008, 3:05:09 PM4/29/08
to habari-users
Very good point, I'd not done a check out for a week or so.
You are indeed right... thanks.


On Apr 29, 7:18 pm, "Ali B." <dmond...@gmail.com> wrote:

Andy C

unread,
Apr 29, 2008, 5:17:57 PM4/29/08
to habari-users
I also think Next/Prev article is important so will check out the K2
changes.
Reply all
Reply to author
Forward
0 new messages