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.

Start on today's month

October 26, 2011 5:40pm

Subscribe [7]
  • #1 / Oct 26, 2011 5:40pm

    Dalton Agency

    5 posts

    http://www.cca.daltontestweb.com/index.php/calendar

    I’d like to get my calendar to start on today’s month. I’m sure I’m doing something wrong, but I’m not sure what. Currently is starts at the oldest entry (August), but I’d like it to start in October (the current month)

    Here’s my weblog entries pair code:

    {exp:weblog:entries weblog="calendar" show_expired="yes" show_future_entries="yes" display_by="month" sort="asc" orderby="date" paginate="bottom" limit="1" dynamic="on"}
    
    ... stuff here ...
    
    {/exp:weblog:entries}

     

  • #2 / Oct 26, 2011 10:14pm

    joann22

    176 posts

  • #3 / Oct 27, 2011 10:05am

    Dalton Agency

    5 posts

    Yes, I did try that. However it doesn’t work as expected. I’ve added it in so you can see:

    http://www.cca.daltontestweb.com/index.php/calendar

  • #4 / Oct 27, 2011 10:55am

    Sue Crocker

    26054 posts

    Thanks for the assist, JoAnn.

    Dalton Agency, I’m not seeing a traditional EE calendar here. Are you talking about the items off to the right?

  • #5 / Oct 27, 2011 1:40pm

    Dalton Agency

    5 posts

    I’m not using a the calendar tag, I’m just using a regular weblog. Is not so much a calendar as a list of events displayed by month. Is the thing on the left. Not to the right.

  • #6 / Oct 29, 2011 6:33am

    Mark Bowen

    12637 posts

    Hi Dalton Agency,

    To do this sort of thing you are going to need to use some PHP in the template to set the start_on=”“ and stop_before=”“ parameters dynamically as I don’t believe there will be another way of doing this.

    Does that help at all?

    Thanks,

    Mark

  • #7 / Oct 31, 2011 10:04am

    Dalton Agency

    5 posts

    Is there some example PHP code you can point me to?

    Would this be better to do with the Calendar tags instead?

  • #8 / Nov 02, 2011 5:01pm

    Lisa Wess

    20502 posts

    Hi, DA - did you see the Common Uses part of the documentation for start_on?  That should help you get started.

    I do think the channel entries tag is best for this.

  • #9 / Nov 02, 2011 6:05pm

    I tried that and got a weird error.

    So I made a very simple PHP thingy. I changed the Template Preferences to Allow PHP and Parse Inward.

    This is the snipit of code:

    That I added

    <?php
            $start_time = Hello;
    ?>
    
    <?php echo $start_time; ?>

    THIS IS THE ERROR MESSAGE:
    http://www.cca.daltontestweb.com/index.php/calendar

    Notice: Use of undefined constant Hello - assumed ‘Hello’ in /home/ccadalton/cca.daltontestweb.com/praise/core/core.functions.php(663) : eval()‘d code on line 7
    Hello


    I am okay at editing PHP that already exists, but I am by no means a PHPer. This may be the reason I am having trouble.

  • #10 / Nov 02, 2011 6:05pm

    Also I responded with a different user account I use for personal things, the OP is me, just from my work place user account.

    Sorry for any confusion.

  • #11 / Nov 03, 2011 5:41pm

    Robin Sowell

    13255 posts

    Hrm- think you should be fine with just:

    start_on="{current_time format='%Y-%m-01 00:00'}"

    Year and month are dynamic, hard code the day and time to beginning of the month.

  • #12 / Nov 03, 2011 5:56pm

    Dear Robin,

    Thank You!

    How do I keep pagination working though?

  • #13 / Nov 04, 2011 5:43pm

    Kevin Smith

    4784 posts

    Hi gofreshdesign,

    Using Robin’s suggested parameter in your weblog tag, does pagination stop working? Or did it not work before at all?

    Are you including the necessary tags according to the User Guide article on weblog pagination?

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

ExpressionEngine News!

#eecms, #events, #releases