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 parameter "Random" and "stop_before" are not playing nice

July 09, 2010 12:42pm

Subscribe [4]
  • #1 / Jul 09, 2010 12:42pm

    [email protected]

    108 posts

    Hi all,

    I am trying to show at random entries from a weblog up to a certain date so I am not showing entries that are too old. Here’s the code.


    {exp:weblog:entries weblog="features" orderby="random" limit="5" dynamic="off" disable="member_data|trackbacks" stop_before="2009-12-01 20:00"}

    When I leave in orderby=“random” the “stop_before” parameter no longer seems to have any effect. When I remove the “orderby” the functionality works properly.

    I would like both to work together if possible…is it possible?

  • #2 / Jul 09, 2010 6:23pm

    Brandon Jones

    5500 posts

    hungrysquirrel, which version and build of EE are you using?

  • #3 / Jul 09, 2010 7:34pm

    [email protected]

    108 posts

    Build 20100430 on 1.6.9

  • #4 / Jul 09, 2010 8:01pm

    Brandon Jones

    5500 posts

    Have you tried that weblog tag by itself in an otherwise blank template?

  • #5 / Jul 09, 2010 8:05pm

    [email protected]

    108 posts

    No, I can though.

    Will you be around later tonight or this weekend? If not I will give it a run now…

  • #6 / Jul 09, 2010 8:45pm

    Brandon Jones

    5500 posts

    I’ll be back on Monday, but Greg Salt will be here over the weekend. Essentially, we want to make sure we are testing with an isolated tag to eliminate other variables.

  • #7 / Jul 09, 2010 8:55pm

    [email protected]

    108 posts

    Well I am getting the same kinda results when I test this on a clean slate page…it’s showing me entries from 2007 :(
    Any suggestions?

    Here’s the entries tag:

    {exp:weblog:entries weblog="features" orderby="random"  limit="5" dynamic="off" disable="member_data|trackbacks" stop_before="2009-12-01 20:00"}
  • #8 / Jul 10, 2010 1:52pm

    Greg Salt

    3988 posts

    Hi hungrysquirrel,

    If you only wish to show entries after a certain date then please try the start_on parameter instead of the stop_before one.

    Cheers

    Greg

  • #9 / Jul 10, 2010 2:04pm

    [email protected]

    108 posts

    Greg,

    I may have confused you but I am trying to get the entries tage to show me entries from most current to a particular cut-off date (ex from present day to say March 4, 2009 and have these qualifying entries display at random.

    The start_on parameter does not seem to address this but please advise.

    Many thanks for the support.

  • #10 / Jul 10, 2010 4:38pm

    Greg Salt

    3988 posts

    Hi hungrysquirrel,

    Unless I’ve completely misunderstood what you are trying to do, you wish to:

    1. Get all entries after a certain date (2009-03-04)
    2. Order them randomly

    Is that correct? If it is, I believe that you will need to use the start_on parameter and not stop_before. The stop_before parameter is used when you wish show only entries before the date used in that parameter.

    Cheers

    Greg

  • #11 / Jul 10, 2010 8:08pm

    [email protected]

    108 posts

    Hi Greg,

    Ahh…as you can see I got confused about the wording of the parameters and now my brain is untwisted. Thanks for the support. Things seem to be working fine now. Out of curiosity is there anyway to set a date dynamically w/o using PHP?

  • #12 / Jul 11, 2010 3:29pm

    Greg Salt

    3988 posts

    Hi hungrysquirrel,

    Glad that you’ve got that working properly now. What did you have in mind as a way of setting a date? The example in the documentation should be straightforward to use for most purposes.

    Cheers

    Greg

  • #13 / Jul 11, 2010 4:53pm

    [email protected]

    108 posts

    I was thinking to have the ability to set it to always be “x” days from the current date w/o using PHP in the template…is this possible?

  • #14 / Jul 12, 2010 2:41am

    John Henry Donovan

    12339 posts

    hungrysquirrel,

    I was thinking to have the ability to set it to always be “x” days from the current date w/o using PHP in the template…is this possible?

    Not without PHP, no. Was there a reason you didn’t want to use PHP in this case? Its a pretty straightforward example

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

ExpressionEngine News!

#eecms, #events, #releases