Suggestion for a more flexibleTemplate system
-
Hi Stephen,
I hope you don’t mind suggestions.
I have an idea that will make EO a lot more versatile as well as easier to use, especially for users who do not know how to program in PHP.
In the current version of EO, you have 2 options: use the build-in event template, coded in PHP. Or disable the template system and type everything directly into the description field of the event.
I have always used the second option myself.
Then one day I was looking for a shortcode that I was sure had to exist. I just didn’t know what it was called. So I searched and searched the documentation. Turns out, it doesn’t exist…
What I was looking for was a shortcode like [eo_startdate] or maybe [eo_event]%start%[/eo_event]. Notice the singular form “eo_event” in this example.
It turns out that all events shortcodes are meant to be used in posts or pages where they list all events that satisfy certain criterea. But inside the description field of an Event itself, there is no shortcode to display for example the start date of the current event (even though there is one for for example the event venue map).
So I came up with this idea of entering shortcodes in the description field of the Event to create a sort of template, like this:
https://www.wordpress.technova.us/1_event_template.jpgBut, although useful like this, it would be much more useful if this template would somehow propagate through to other events within the same category. So I though, why not put the template-text in the description field (or a new “template” field) of the Category, like this:
https://www.wordpress.technova.us/2_category_template.jpg
Now all events within this category could use this template.And with just one additional shortcode, the user could specify to use this category template in any event he wishes. In fact, with one extra attribute he could even specify the template of another category if the wanted to, like this:
https://www.wordpress.technova.us/3_event_category_template.jpgNow, I’ve looked at the code, and it doesn’t seem to be too difficult. A Copy&Paste of the [eo_events] code in the shortcodes PHP and replace the loop with $this. Add one extra [eo_template] shortcode. And make the Category description field behave like a template.
Also, this would be backward compatible with the existing template system, so EO would still work for existing users.
Well, I hope this gave you some inspiration.
Thanks for taking the time to read this!
Cheers, Aspegic
- The topic ‘Suggestion for a more flexibleTemplate system’ is closed to new replies.