Google Groups Home Help | Sign in
Several Liquid template questions (recent posts, paging)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
chuyeow  
View profile
 More options Sep 30 2006, 8:25 am
From: "chuyeow" <chuy...@gmail.com>
Date: Sat, 30 Sep 2006 12:25:40 -0000
Local: Sat, Sep 30 2006 8:25 am
Subject: Several Liquid template questions (recent posts, paging)
Is there a way to get at the X most recent articles in the Liquid
templates? If so, what is the Liquid tag(s) I should be using? Also,
pagination - how do I get at them? I managed to figure it out for
seach.liquid by looking at the code for Mephisto (the 'search' method
in MephistoController) and using the 'next_page' and 'previous_page'
drops, but when I try to do the same for home.liquid and
section.liquid, it gives a URL which tries to contains the Pagination
object printed as a string (like '<Pagination:023AD...>'.

One last thing - is it possible to get at the next and previous article
relative to the current article (in single.liquid)?

I've been trying to figure these out by looking at the Mephisto wiki
and at the source to no avail. The Liquid template system is proving to
be pretty restrictive and somewhat unnecessary when we have eRb
templates the more I try to work with it :/

(I'm using the 0.6 release of Mephisto.)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bleything  
View profile
 More options Sep 30 2006, 12:16 pm
From: Ben Bleything <b...@bleything.net>
Date: Sat, 30 Sep 2006 09:16:23 -0700
Local: Sat, Sep 30 2006 12:16 pm
Subject: Re: Several Liquid template questions (recent posts, paging)

On Sat, Sep 30, 2006, chuyeow wrote:
> Is there a way to get at the X most recent articles in the Liquid
> templates? If so, what is the Liquid tag(s) I should be using?

I built a "recent stuff" doohickey for my sidebar, which shows the 10
most recent posts with the 5 most recent comments on each.  Here it is:

<dl>
{% for article in articles limit: 10 %}
  <dt>{{ article | link_to_article }}</dt>
  {% if article.comments_count > 0 %}
  {% for comment in article.comments limit: 5 %}
    <dd>{{ comment.body | truncatewords: 10 }}</dd>
  {% endfor %}
  {% else %}
    <dd>No comments</dd>
  {% endif %}
{% endfor %}
</dl>

I'm a total liquid/mephisto newbie, so there might be a better way to do
that.  If someone knows one, I'd like to hear it!

One interesting side effect (that I like, actually) is that if you're
looking at a single article, it'll only show that article.  I presume
that if you're looking at search results, you'll only see those.  I like
that.

I don't know the answer to any of your other questions, sorry.

Ben


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
chuyeow  
View profile
 More options Sep 30 2006, 12:31 pm
From: "chuyeow" <chuy...@gmail.com>
Date: Sat, 30 Sep 2006 16:31:29 -0000
Local: Sat, Sep 30 2006 12:31 pm
Subject: Re: Several Liquid template questions (recent posts, paging)
Ahh thanks for the reply Ben. I actually can get that working for the
home page, no problem, but if I'm understanding you correctly you also
only can get it working for the home page.

I guess I'm looking for something like a 'recent_articles' drop or
'all_articles | recent: 5' drop + filter.

Thanks anyway!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Olson  
View profile
 More options Sep 30 2006, 12:44 pm
From: "Rick Olson" <technowee...@gmail.com>
Date: Sat, 30 Sep 2006 11:44:15 -0500
Local: Sat, Sep 30 2006 12:44 pm
Subject: Re: Several Liquid template questions (recent posts, paging)
On 9/30/06, chuyeow <chuy...@gmail.com> wrote:

> Ahh thanks for the reply Ben. I actually can get that working for the
> home page, no problem, but if I'm understanding you correctly you also
> only can get it working for the home page.

> I guess I'm looking for something like a 'recent_articles' drop or
> 'all_articles | recent: 5' drop + filter.

> Thanks anyway!

Filters:

http://svn.techno-weenie.net/projects/mephisto/trunk/app/filters/drop...

Mephisto doesn't do article paging except for in search results.
That's what the monthly archives are for.

--
Rick Olson
http://weblog.techno-weenie.net
http://mephistoblog.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
chuyeow  
View profile
 More options Sep 30 2006, 1:02 pm
From: "chuyeow" <chuy...@gmail.com>
Date: Sat, 30 Sep 2006 17:02:51 -0000
Local: Sat, Sep 30 2006 1:02 pm
Subject: Re: Several Liquid template questions (recent posts, paging)
Eek so those are new in trunk (I'm still using 0.6). Guess I should try
and get a trunk deploy going. Thanks.

Regarding paging, unless trunk has changed the way articles are
displayed, wouldn't that mean that if the 'article per page' is set to
say 10, and you browse a particular section's articles, you would be
limited to showing only the latest 10 since you can't page further?

Thanks for the reply!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Olson  
View profile
 More options Sep 30 2006, 1:10 pm
From: "Rick Olson" <technowee...@gmail.com>
Date: Sat, 30 Sep 2006 12:10:22 -0500
Local: Sat, Sep 30 2006 1:10 pm
Subject: Re: Several Liquid template questions (recent posts, paging)
On 9/30/06, chuyeow <chuy...@gmail.com> wrote:

> Eek so those are new in trunk (I'm still using 0.6). Guess I should try
> and get a trunk deploy going. Thanks.

> Regarding paging, unless trunk has changed the way articles are
> displayed, wouldn't that mean that if the 'article per page' is set to
> say 10, and you browse a particular section's articles, you would be
> limited to showing only the latest 10 since you can't page further?

> Thanks for the reply!

Yup.  It's used for searching too.

--
Rick Olson
http://weblog.techno-weenie.net
http://mephistoblog.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Bleything  
View profile
 More options Sep 30 2006, 1:09 pm
From: Ben Bleything <b...@bleything.net>
Date: Sat, 30 Sep 2006 10:09:32 -0700
Local: Sat, Sep 30 2006 1:09 pm
Subject: Re: Several Liquid template questions (recent posts, paging)

On Sat, Sep 30, 2006, chuyeow wrote:
> Ahh thanks for the reply Ben. I actually can get that working for the
> home page, no problem, but if I'm understanding you correctly you also
> only can get it working for the home page.

If nothing else, it gets you going in the right direction.  I like the
way it works for my install... when people are looking at a single
article, they only see the stuff that's happening in that article.

> I guess I'm looking for something like a 'recent_articles' drop or
> 'all_articles | recent: 5' drop + filter.

That would be cool.  Plugin!

Ben


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
chuyeow  
View profile
 More options Oct 1 2006, 8:59 am
From: "chuyeow" <chuy...@gmail.com>
Date: Sun, 01 Oct 2006 12:59:59 -0000
Local: Sun, Oct 1 2006 8:59 am
Subject: Re: Several Liquid template questions (recent posts, paging)

Rick Olson wrote:
> On 9/30/06, chuyeow <chuy...@gmail.com> wrote:

> > Eek so those are new in trunk (I'm still using 0.6). Guess I should try
> > and get a trunk deploy going. Thanks.

> > Regarding paging, unless trunk has changed the way articles are
> > displayed, wouldn't that mean that if the 'article per page' is set to
> > say 10, and you browse a particular section's articles, you would be
> > limited to showing only the latest 10 since you can't page further?

> > Thanks for the reply!

> Yup.  It's used for searching too.

Wouldn't that be rather restrictive then? How am I going to show my
users articles from the, say, 'Mozilla' section past the first 10
articles? Pointing them to the monthly archives is one way but it's not
ideal. I'd suggest allowing pagination sometime in the future :)

And also, how do you display monthly archives since you mention it? Is
there a drop/filter that would allow me to loop through all the monthly
archives I have (skipping over those months for which there are no
entries)?

Thanks.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Olson  
View profile
 More options Oct 1 2006, 11:02 am
From: "Rick Olson" <technowee...@gmail.com>
Date: Sun, 1 Oct 2006 10:02:50 -0500
Local: Sun, Oct 1 2006 11:02 am
Subject: Re: Re: Several Liquid template questions (recent posts, paging)
On 10/1/06, chuyeow <chuy...@gmail.com> wrote:

I don't like paginated posts.  I especially hate doing google searches
on something for http://blog/foo/page/2, but finding out that was
cached 3 months ago and it's now on page 7.  However,
/foo/archives/2006/6 never changes.  If you really want pagination,
write a plugin.

> And also, how do you display monthly archives since you mention it? Is
> there a drop/filter that would allow me to loop through all the monthly
> archives I have (skipping over those months for which there are no
> entries)?

http://svn.techno-weenie.net/projects/mephisto/trunk/themes/default/t...

Jamis has a better one that counts the articles in each month.  I
planned to yank that for Mephisto at some point.

--
Rick Olson
http://weblog.techno-weenie.net
http://mephistoblog.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google