Events Made Easy › Forums › Bug fixed or feature request implemented › Single event format, multiple templates
Tagged: single event, template
- This topic has 18 replies, 3 voices, and was last updated 10 years, 3 months ago by Anonymous.
-
AuthorPosts
-
Thu 29 May 2014 at 18:55 #52270AnonymousInactive
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.Thu 29 May 2014 at 23:24 #52272FrankyKeymasterThe templates are only honoured when displaying an event, not when creating it. This is a very difficult feature request, based on current implementation ideas …
Fri 30 May 2014 at 09:11 #52273AnonymousInactiveThanks 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?
Fri 30 May 2014 at 11:10 #52276FrankyKeymasterCan you be a bit more specific? Examples would help …
Fri 30 May 2014 at 13:20 #52277AnonymousInactiveHallo 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');
Fri 30 May 2014 at 13:22 #52278Fri 30 May 2014 at 13:27 #52279AnonymousInactiveI appears unable not insert a link
http://testinstallation.lkc-lueneburg.de/termine/445/test-event/
Fri 30 May 2014 at 14:53 #52282FrankyKeymasterYou 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.Fri 30 May 2014 at 15:51 #52283AnonymousInactiveThank’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.Fri 30 May 2014 at 23:51 #52288FrankyKeymasterThe 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.Sat 31 May 2014 at 01:26 #52289FrankyKeymasterImplemented the template select in trunk.
Sat 31 May 2014 at 11:32 #52292AnonymousInactiveHey 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”.Sat 31 May 2014 at 13:33 #52293FrankyKeymasterThanks 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) 🙂Sat 31 May 2014 at 23:58 #52294FrankyKeymasterEt voila: code is in trunk for this too now.
Sun 1 Jun 2014 at 17:39 #52296AnonymousInactiveOk 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 form3. 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
Mon 2 Jun 2014 at 00:20 #52297FrankyKeymasterFor 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).Fri 12 Sep 2014 at 14:46 #52820AnonymousInactiveMy 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!
Sun 14 Sep 2014 at 21:01 #52824FrankyKeymasterThe 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.Mon 15 Sep 2014 at 03:41 #52828AnonymousInactiveAs 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!
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.