1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To combat forum spam, new accounts will need to make at least one (valid) post.
    Otherwise, we will periodically purge all users without posts or that haven't confirmed their account.

Display name of category in event, list view

Discussion in 'Customizations (Themes / Templates)' started by gregwoods, Mar 28, 2011.

Thread Status:
Not open for further replies.
  1. I'd like to display category names at the top of every event in the list view.

    What I'm looking for is something along these lines (in templates/events.php):

    HTML:
    <!--body-->
    <div class="event">
      <h1>[category_name]</h1>
      <span class="event_date">[date]</span> &nbsp;
      <span class="event_time">[time]</span>
      <span class="event_title">[title]</span>
      [descr]
    </div>
    <!--body-->
    
    <!--foot-->
    
    <!--foot-->
    
    <!--empty-->
    <p class="notice">There are no entries to display.</p>
    <!--empty-->
    
    Of course the above doesn't work, as [cateogory_name] is just a variable I made up here. I'm hoping there is a pre-existing template variable available that I can just stick in there and call it a day. I tried [category] but that only gives me the category ID number, it seems.

    Along those lines, a list of all the possible template variables would be handy.
  2. Brian

    Brian EPC Developer Staff Member

    Are you looking for the main category name? As the main category is usually for coloring the events. All other categories should display their name.
  3. When the client creates an event they pick one of serveral cateogories from a drop down menu (I guess thats considered a main category?), and they wish for that name to appear in the event listing. Currently the only information displayed is the date, time, title, and description.

    I'm not sure I'm understanding the distinction between main and non-main categories. I'd rather not introduce a second category drop-down menu for the client to have to pick from if its essentially going to mirror the first one anyway.
  4. Brian

    Brian EPC Developer Staff Member

    Right now, the main category sets the colors when events are viewed. Any other created category will display the name of the category and it's selection.
  5. I ended up hacking it in using text images that corresponded to the ID number presented by the [category] template variable. Feels ugly doing it this way but it got the job done. In the future it would be nice to be able to access the text value of a main category directly.

    Anyway, I hope that idea helps others who might be looking for a similar effect.
Thread Status:
Not open for further replies.

Share This Page