WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Playing with template event forms impact admin forms (4 posts)

  1. Christian
    Member
    Posted 1 year ago #

    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/

  2. agelonwl
    Member
    Posted 1 year ago #

    Hi,

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

    e.g.

    if ( !is_admin() ){
    ...
    }else{
    ...
    }
  3. Christian
    Member
    Posted 1 year ago #

    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 ;)

  4. Christian
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.