• Resolved dozza

    (@dozza)


    Hi Dave

    I have a Gravity Form on a page that needs to display for two regular periods of time every 12 months. As Gravity only allow a single schedule, I will leave the form on constantly and wrap the GF Shortcode with your plugins repeat shortcode, suitably configured.

    The time periods are between 1st April and 31st July and subsequently from 1st October and 28/29th February. In between these periods I’ll use the ‘else’ attribute to show a message about when the form will be available.

    So far I’ve got the following:

    [time-restrict-repeat type=”annually” onmonth=”April” offmonth=”July” ondate=”01″ offdate=”31″ else=”The Form is currently unavailable. It will be available between 1st April and 31st July and subsequently from 1st October and 28/29th February each year.”]
    Gravity Form ID X Shortcode Here
    [/time-restrict-repeat]
    [time-restrict-repeat type=”annually” onmonth=”October” offmonth=”February” ondate=”01″ offdate=”29″ else=”The Form is currently unavailable. It will be available between 1st April and 31st July and subsequently from 1st October and 28/29th February each year.”]
    Gravaity Form ID X Shortcode Here
    [/time-restrict-repeat]

    My concerns are;

    a) the end of year overlap,
    b) the February leap year issue for ‘offdate’ attribute (could be 28th or 29th), and
    c) will the ‘else’ text display twice when the date falls outside both active time periods?

    I’d rather you run your eye over this than wait for it to appear wrong on the live site! Is there a neat way to test such scheduling by ‘tricking’ a webserver or website into thinking it is actually a different date/time? Would love this ability occasionally.

    Appreciate your confirmation or tweaks.

    • This topic was modified 4 years, 9 months ago by dozza. Reason: typo
    • This topic was modified 4 years, 9 months ago by dozza. Reason: additional info
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dave Clements

    (@thewanderingbrit)

    a) The end of year overlap should work just fine
    b) Maybe to get around this, turn the content off at 00:00:01 on March the 1st.
    c) Yes, the else text will show twice. To avoid this, create two more scheduled (Aug 1 – Sep 30, and Mar 1 – Mar 31) for the off times and don’t use the else attribute.

    Thread Starter dozza

    (@dozza)

    Dave, that is very kind of you to reply and very reassuring. I can see what I have to do now, assuming you meant ‘dont use the else attribute’ at all in any of the four shortcodes.

    So I’ve now gone with the following:

    [time-restrict-repeat type=”annually” onmonth=”April” offmonth=”July” ondate=”01″ offdate=”31″]
    [gravityform id=”XX” title=”false” description=”false” ajax=”true” tabindex=”1″]
    [/time-restrict-repeat]

    [time-restrict-repeat type=”annually” onmonth=”August” offmonth=”September” ondate=”01″ offdate=”30″]
    The Form is currently unavailable. It will be available next between 1st October this year and 28/29th February next year and subsequently between 1st April to 31st July next year.
    [/time-restrict-repeat]

    [time-restrict-repeat type=”annually” onmonth=”October” offmonth=”March” ondate=”01″ offdate=”01″ offtime=”00:00:01″]
    [gravityform id=”XX” title=”false” description=”false” ajax=”true” tabindex=”1″]
    [/time-restrict-repeat]

    [time-restrict-repeat type=”annually” onmonth=”March” offmonth=”March” ondate=”01″ offdate=”31″]
    The Form is currently unavailable. It will be available next between 1st April and 31st July this year and subsequently between 1st October this year and 28/29th February next year.
    [/time-restrict-repeat]

    This results in the display of the form, which I’d expect during May. I’ll diarise to check it turns off and displays not available message on 1st August. Do you see any errors within my shortcode syntax?

    • This reply was modified 4 years, 6 months ago by dozza.
    • This reply was modified 4 years, 6 months ago by dozza.
    • This reply was modified 4 years, 6 months ago by dozza.
    Plugin Author Dave Clements

    (@thewanderingbrit)

    Yes, at a glance, that should generally do the trick.

    Let me know how it goes

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display content twice a year’ is closed to new replies.