WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] Playing with template event forms impact admin forms

[Resolved] Playing with template event forms impact admin forms

  • Hello,

    I’ve defined some guest forms to allow anonymous events.
    I’ve done this with the templates and it works fine.

    But now, in the admin Part, all the event creation uses the forms I’ve customized.

    For example ; in my custom form I only define start day and start time.
    Now in the admin, I can’t set the stop date/time for all events..

    Any idea ?

    Thanks

    http://wordpress.org/extend/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    you can try to add condition that will deactivate your customization once using admin/dashboard.

    e.g.

    if ( !is_admin() ){
    ...
    }else{
    ...
    }

    I did not try this because for mee is too late in the process.

    I’m in my template part so I need to include (or copy) ,( in the else part of your code), a call to the original template, the one used in admin part.

    I’ve deleted (or commented) some part of the form in my template, I’ll reintroduce them with specifics CSS to hide them.

    The best thing I think is that the admin part does not use the customized form.

    I’ll play around and came back later 😉

    In fact I chose the first solution here is the trick.

    Here’s my when.php in <my-theme>/plugins/event-manager/template/forms/event directory

    <?php
    if (!is_admin()) {
    get_template_part('convocations','when');
    } else {
     load_template(EM_DIR.'/templates/forms/event/'.basename(__FILE__),false);
    }
    ?>

    But I almost sure that the best to do is inside the em_locate_template() function. IMO, the admin part must not be impacted by the templating which is theme related.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Playing with template event forms impact admin forms’ is closed to new replies.
Skip to toolbar