0

I have the need to allow site editors to be able to create groups of "events" and assign a title, body, icon, etc to those events, order them, and place them where they like inside of their "pages".

Currently, I have an "Events" channel set up and each entry in that channel is 1 individual event. The reason for this is that they would like those events to "expire" at a date/time they specify. Each of those entries are assigned one or more categories. From there, I have an embed code similar to this...

{embed="embeds/events" category="25"}

This code is entered into any page (Structure) they want that category of events to show up in.

This works pretty good but we are in the middle of a major re-design and I am wondering if this is the "best" way to accomplish this.

Thoughts? Would you do it the same way or would you have an easier method?

Some of the downfalls to doing it this way is that you have to have content editors worried about entering the specific embed code. Also, they have to look up the category ID which can be annoying if they are looking to set something up quick.

Thanks for your help!

2 Answers 2

3

Another option that I have used in the past is with Playa:

  1. Create as many channels as you need modules (text, events, video, 1 big image, image gallery, etc.) and enter content

  2. Create a "page" channel with a playa field linking to your modules channels. Use conditionals / ifelse / switchee to test on the channel_short_name and display module fields:

simplified code in your "page" template

{exp:playa:children status="open"}
    {if channel_short_name == "mod_events"}
        ... display code and custom fields for event module ...
    {/if}
    {if channel_short_name == "mod_text"}
        ... display code and custom fields for text module ...
    {/if}
    {if channel_short_name == "mod_video"}
        ... display code and custom fields for video module ...
    {/if}
{/exp:playa:children}

Users can now compose their page by creating modules / combining them / ordering them. It's a very flexible system if you need to enable your users to create rich pages. With only a small set of modules, you give them a lot of possible variations and no room for errors.

Possibilties are endless.

0

I never ask my clients to enter embed code. as the events are channel entries, you can have them selected easily with something like playa, or http://devot-ee.com/add-ons/nsm-entry-select. and for the categories, i guess you could use something like http://devot-ee.com/add-ons/jp-category-select. Than, you can have a template that says: {exp:channel:entries bla bla bla} {embed="_inc/myembed" theentry=='{my_entry_field_name}' thecategory='{my_categories}'}

and the embed itself would be something like:

{exp:channel:entries channel='events' entry_id=='{embed:theentry}' category=='{embed:thecategory}'} bla {title} {/exp:channel:entries}

6
  • I would love to use Playa or any of those other ideas, the issue comes when they need the ability to put those events anywhere within other "page" code. So some pages, it may be in the middle of other content and other times it may be at the top/bottom, etc. Thoughts?
    – Jacob Graf
    Mar 9, 2013 at 19:07
  • you might be able to do this with low reeorder and or a custom number field which you evaluate with stash, or maybe even with content elements. you can also do this by putting all of this in a matrix Mar 9, 2013 at 19:11
  • Hmmm. Matrix might be an option. Interesting idea.
    – Jacob Graf
    Mar 9, 2013 at 19:21
  • i guess what you are trying is more or less page builder: give admins an ability to build their pages the want them to appear. content elements is built specifically to meet this demand, but with matrix you can achieve good results, however, if the number of options it to big, you will get a very wide matrix field... Mar 9, 2013 at 19:29
  • I've heard of content elements. And yes, that is exactly what I am looking to do. I am going to look into that add-on as well. Thanks!
    – Jacob Graf
    Mar 9, 2013 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.