Events Made Easy Forums Bug fixed or feature request implemented Single event format, multiple templates

Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #52270
    Anonymous
    Inactive

    Hey Franky,

    I’m looking for a way to use multiple standart templates for the single event standard view.
    e.g. event-category 1 then use template 1.
    Or the user can during creating a event, choose a suitable template.
    Do you have any idea how I could transpose it?

    At the moment I copy the templates to create an event in the field individual-template, this works well.
    For the normal user that is not a practical solution that would create a new event.

    #52272
    Franky
    Keymaster

    The templates are only honoured when displaying an event, not when creating it. This is a very difficult feature request, based on current implementation ideas …

    #52273
    Anonymous
    Inactive

    Thanks for your answer Franky.
    I have a bit of testing.
    I have a few new templates created => template / creat new
    I’m using a short code, under settings / event / single event format
    The short code determined from the category the appropriate template.
    If I keep showing the event, the appropriate template is displayed.
    This is good, but all the placeholder does not work.

    Do you have any idea?

    #52276
    Franky
    Keymaster

    Can you be a bit more specific? Examples would help …

    #52277
    Anonymous
    Inactive

    Hallo Franky,

    at the moment I am testing only in the test installation.
    Here is the link to the results:

    For the shortcode I use this:

     function eme_fj_single_event_format_nach_kategorie($atts) {
        /*  angegeben werden muß die ID der Vorlage/Template für das entsprechende Ereigniss */
        $template_ohne_cat = 10;            // ID für Events ohne Kategorie
        $template_multiple_cats = 11;       // ID für Events mit mehr als einer Kategorie
        $template_standard = 12;            // standard Layout, wenn für die gewählte Kategorie kein spezielles Template vorh. ist
        $template_slalomregatta = 13;        // Template Slalomregatta
    
        extract ( shortcode_atts ( array ('id'=>0), $atts));
    
        $event=eme_get_event($id);
        $txt_categories=$event[event_category_ids];
    
        if ($txt_categories =="") {                                     // abprüfen ob eine Kategorie ausgewählt wurde
            $template = eme_get_template($template_ohne_cat);
            return  ($template[format]);                    // Aufruf Template mit Hinweise keine Kategorie ausgewählt
        }else {
            $category_ids= explode(',', $txt_categories);
            $anzahl_cat= count($category_ids);
        }
        if ($anzahl_cat >1) {
            $template = eme_get_template($template_multiple_cats);
            return  ($template[format]);           // Aufruf Template mit Hinweise: es wurden mehrere Kategorie ausgewählt
        }else {
            switch ($category_ids[0]) {
                case "8":
                    $template = eme_get_template($template_slalomregatta);
                    return  ($template[format]);
                    break;
                default:
                    $template = eme_get_template($template_standard);
                    return  ($template[format]);
            }
        }
     }
     add_shortcode ('eme_fj_Vorlage_nach_Kategorie', 'eme_fj_single_event_format_nach_kategorie');
    #52278
    Anonymous
    Inactive

    here is the promised link above

    #52279
    Anonymous
    Inactive
    #52282
    Franky
    Keymaster

    You need to call the function eme_replace_placeholders on the template format, otherwise nothing gets replaced.
    See eme_events.php for the usage and parameters.

    #52283
    Anonymous
    Inactive

    Thank’s, now it worked!
    Great plugin, very flexible and great support.
    But that was only the first part of the work.
    It is possible to implement the same with the RSVP and the emails.

    #52288
    Franky
    Keymaster

    The most correct method here would be that upon creation of the event, you use the filter eme_event_preinsert_filter (will be in the next version) to change the settings to your liking: you get the category ID and then copy the relevant template settings to that event. That way, you can change the layout of the single event based on the category and do the same for the rsvp mails.
    Concerning the mails you send afterwards, there I will implement a dropdown selection of templates to choose from for subject and body.

    #52289
    Franky
    Keymaster

    Implemented the template select in trunk.

    #52292
    Anonymous
    Inactive

    Hey Franky,

    thanks for the information and your work.
    I have installed the trunk, but I can’t find info for the syntax, for the new filter.
    In which file can I find the function?

    Small bug in the trunk.
    When I open in the dashboard the site templates- or categories, i see a messagebox on the top, with this content “Successfully ed template or category”.

    #52293
    Franky
    Keymaster

    Thanks for the bug in trunk: fixed in trunk 🙂
    Concerning the filter: it is already in the regular doc.
    But to make you even more happy: I’ll try to add code this weekend so when creating an event, you can choose the template for all format settings too.
    Now that I have the code developed for the mail thingie, I can reuse the same logic. And it makes templates more known then (since nobody reported the delete bug before) 🙂

    #52294
    Franky
    Keymaster

    Et voila: code is in trunk for this too now.

    #52296
    Anonymous
    Inactive

    Ok it works!
    For normal user, I think is too complicated.
    The ability to make errors is relatively large.

    1. The table of templates requires an additional field.
    We now have many different templates in the table.
    Templates for:
    -Event lists, body, header, footer
    -single event format
    -single event RSVP mails, with different custom fields
    -single event registration form, with different custom fields
    With a new field, you can differentiate which kind of template it is.
    When creating an event the contents of the dropdown list can be adjusted accordingly.

    2. New table for templates combinations.
    Complete format for events consisting of:
    -single event format
    -single event RSVP mails
    -single event registration form

    3. New dropdown field in the event creating form to select the compl. format
    => the normal user has no chance to make a mistake.

    Nice to have:
    Create an event, select an event template:
    1. In the drop list of custom attributes are displayed only the custom attributes used in the selected template.
    2. A new form of custom attributes, similar to the custom fields. A dropdown list with pre-fixed contents.

    Please look again, Dashboard, Templates, Listview
    The list is order by the creation date, perhaps it is better to order them according to the description.

    Many ideas, I hope you do not kill me!

    Have a nice day

    #52297
    Franky
    Keymaster

    For now templates can be used for anything, that’s correct. And I’d like it to stay that way, differentiating there or afterwards doesn’t make that much difference.
    Persons creating events should always pay attention, a template choice won’t change that. I suggest that you give the template a meaningful description, so it’s easier to distinguish. In the end, you can still put an event “private” or “draft” and check it out before making it “public”.
    I’ll take a look at the sorting though.
    For the dropdown custom attribute: please create a new feature request.
    For the template extra field: please create a new feature request (but it’s not for now).

    #52820
    Anonymous
    Inactive

    My current project requires a lot of templates.

    Rather than using the template options when creating an event, I was using a lot of conditional logic (based on category) everywhere to determine my “templates”. This is nice because it makes creating a new event easier, but I ran into a problem with the RSVP forms.

    RSVP Form Code Example:
    [eme_if tag="#_EVENTCATEGORIES" value=Soccer]
    #_NAME
    #_EMAIL
    #_SPACES
    #_SUBMIT
    [/eme_if]

    [eme_if tag="#_EVENTCATEGORIES" value=Baseball]
    #_NAME
    #_EMAIL
    #REQ_FIELD{1}
    #REQ_FIELD{2}
    #REQ_FIELD{3}
    #_SPACES
    #_SUBMIT
    [/eme_if]

    The Single Event page would automatically display the appropriate form just fine, but if a user attempted to submit a “Soccer” registration, the form would produce an error (“Please enter #REQ_FIELD{1}, #REQ_FIELD{2}, #REQ_FIELD{3}”) even though the fields were not even there. Of course, submitting a “Baseball” registration would be fine – provided all required fields were completed.

    I was going to continue to use this method of implementing “templates” for mailings, but I have not gotten that far yet. Until I began to work with the RSVP forms, using conditional logic to produce my “templates” was working very well.

    What are your thoughts on this approach? Is it possible to fix the form error?

    Unfortunately, I know very little PHP. Forgive me if I am missing an obvious roadblock when using this conditional logic approach.

    Thanks for your input!

    #52824
    Franky
    Keymaster

    The code checks for the fields defined in the rsvp form. Since I don’t know at that time which fields are going to be required (if using conditional tags), I take all of the required fields into account.
    But since I now added the extra “required” part to each and every required input form field, the browser prevents form submission anyway. So I could just remove that extra check from the backend and then your code would work.
    Feel free to make a feature request for that.

    #52828
    Anonymous
    Inactive

    As long as removing the extra check in the backend does not mess something else up for you I guess I am all for it!

    I like the conditional tag approach because it keeps everything quite automated, and my event creation has a few less clicks and inputs to remember! 🙂

    Will submit feature request. Thank you for all your great support!

Viewing 19 posts - 1 through 19 (of 19 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top