ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

weblog entries list of older posts

June 08, 2011 7:43pm

Subscribe [3]
  • #1 / Jun 08, 2011 7:43pm

    Jim.

    36 posts

    In the “members area” of my web site I have a page that shows the current “article” and on the left side of the page the links to the most recent 25 articles.

    This is the working line of code for that list of links.

    {exp:weblog:entries orderby="date" sort="desc" limit="25" weblog="{my_weblog}" category="5" dynamic="off" member_group="5|1"}

    What I want to do is create an “archive” section for people that are not members as a “demo” of the web site.

    For this archive I want it to display articles that are over a month old.  [now - 1 month]

    I know that I would do away with the member_group part of that line of code so it can be seen by everyone.  But how do I get it to give me a list of the 25 articles in descending order, where that list starts at the first article that is more than 1 month old and gets the next 24 older ones?

    Thanks,

    Jim.

  • #2 / Jun 09, 2011 6:26am

    Matt:P

    277 posts

    Hi Jim

    Use the Start On and Stop Before parameters.

    {exp:weblog:entries orderby="date" sort="desc" limit="25" dynamic="off" start_on="2004-06-05 20:00"}

     

    Its’ a great question by the way. You can read a bit more about how to make this dynamic, here…

  • #3 / Jun 09, 2011 10:04am

    Jim.

    36 posts

    Matt,

    Thanks for the reply and pointing me to the right section.

    The “stop_before” would be the best way to set it to a specific date.
    I noticed that to do a dynamic date such as [now minus 1 month] is a bit more involved.

    As I scrolled that page I came across the “offset” tag, and I believe that is going to be the one I will use, as it is much simpler and will fit in with what I was looking for much better based on the frequency of the posts that I make.

    “This parameter offsets the display by X number of entries. For example, if you want to show all entries except the three latest ones, you would do this:”
    offset=“3”

    So, to take that and relate it to what I am doing, the code would look like this:

    {exp:weblog:entries orderby="date" sort="desc" offset="25" limit="25" weblog="{my_weblog}" category="5" dynamic="off" member_group="5|1"}

    The most current 25 would be in the “members” area, and the previous 25 would be in the “archives”.

    Thanks for the help, that is exactly what I was looking for!

    Jim.

  • #4 / Jun 09, 2011 10:11am

    Matt:P

    277 posts

    Hi Jim

    Yes, that’s exactly right. Your Members would see the most recent 25 articles and site Guests would see entries 26-50 using your code above.

    Well done!

    Matt

  • #5 / Jun 09, 2011 12:57pm

    Sue Crocker

    26054 posts

    Thanks for the assist, Matt.

    Jim.. sounds like you’re ready to continue.. Feel free to start a new thread if you have any more questions.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases