Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #42250
    Anonymous
    Inactive

    Is it possible for me to define two different templates for my events lists? For instance, right now, in my “default events list header”, I have:

    <table>

    <tr>

    <td><b>Date</b></td>

    <td><b>Organization</b></td>

    <td><b>Location</b></td>

    <td><b>Ministry</b></td>

    </tr>

    In the center of my template code, in the “Default event list format” I have:

    <tr>

    <td>#M #j – #@M #@j, #o</td>

    <td>#_LINKEDNAME</td>

    <td>#_TOWN</td>

    <td>#_CATEGORIES</td>

    </tr>

    And in my footer, in the “Default event list format footer”, I have

    </table>

    I would like to be able to, in some instances, include the #_CATEGORIES column in some instances, as it is set up to do now, but in other instances, I would like to exclude the #_CATEGORIES from the events list and perhaps call other functions in that column. How do I do this?

    Does the eme_get_events_list command have anything to do with returning the information that I need? If so, how would I use the code to return and display the information that I want (I’m sorry, I’m not understanding on the examples page).

    #45439
    Franky
    Keymaster

    The way events are shown using the shortcodes is not conditional, so that’s not going to help you.

    You could use the function “eme_get_events” in your templates, it has about the same options as “eme_get_events_list” but it doesn’t return a html-list, but just an array of events and all the info, eg:

    $resulting_events=eme_get_events(10, "future", "ASC");

    will return an array of 10 events in the future, ordered ASC, in the variable $resulting_events.

    After this, you can loop through the array and print what you like yourself. Use the php-function print_r to see what it looks like and use any info wanted.

    print_r($resulting_events);

    and looping through it:

    foreach ($resulting_events as $event) {
    print $event['event_name'];
    ...
    }

    #45440
    Anonymous
    Inactive

    Ok, I think I get the concept.

    May I make a suggestion for creating multiple “template ID’s” that can be assigned to the event list? So that, say, I could use the code [events_list category=3 template=2] and it would return all the items of category 3 in the template form number 2 (as defined by me). You could create an additional menu item in the Events toolbar on the left that would enable the user to create, define, and maintain multiple event list templates (much like we can currently do for people, locations, and categories).

    #45441
    Franky
    Keymaster

    Goog suggestion! I’ll file this under feature requests!

    #45442
    Franky
    Keymaster

    Btw, you can use “format” as an option to the [events_list] shortcode, this in fact gives you what you want, so you can change the formatting per occurence of the shortcode, eg:

    [events_list scope=today format="<li>#j #M #Y - #H:#i #_LINKEDNAME<br>#_TOWN </li>"]

    ==> Don’t do this in the visual editor, but in the html-code editor (otherwise the “<” gets translated etc)

    ==> if you use your own formatting, make sure to use correct beginning and endings as well in your post (eg. ul-codes before and after the shortcode in this example:

    <ul>
    [events_list scope=today format="<li>#j #M #Y - #H:#i #_LINKEDNAME<br>#_TOWN </li>"]
    </ul>

    Since this seems like a good workaround, I’ll close this feature request.

    #45443
    Anonymous
    Inactive

    I’m trying to use this workaround, but I can’t get it to work. Despite the formatting changes I make to the shortcode the events list on the “Events” page that I made (Not the one created by the plugin) just reverts to the formatting on the settings page. Here is my code:

    <ul class="page_events">
    [events_list showperiod=monthly format="
    <li class="page_date">#F #d</li>
    <li class="page_name">#_NAME</li>
    <li class="page_time">#_12HSTARTTIME - #_12HENDTIME</li>
    <li class="page_location">#_LOCATION</li>
    "]</ul>

    Any ideas? Am I doing something incorrectly?

    #45444
    Franky
    Keymaster

    Escape the quotes

    #45445
    Anonymous
    Inactive

    Sorry to rehash this, but I think this workaround is limited. I’m having issues getting it to work. The following code is not working in this way, and I think it’s because I’m using conditional tags.

    <table width="100%">

    <tr>

    <td>

    <h3>Date</h3>

    </td>

    <td>

    <h3>Organization</h3>

    </td>

    <td>

    <h3>City/State</h3>

    </td>

    </tr>[events_list limit=200 scope=2012-00-00--2012-12-31 format="<tr><td>#_{M j}[events_if tag="#ESC_{j M Y}" notvalue="#ESC@_{j M Y}"]-[events_if2 tag="#ESC_{M}" notvalue="#ESC@_{M}"]#@_{M }[/events_if2]#@_{j}[/events_if], #o</td><td>#_EVENTNAME</td><td>#_TOWN</td></tr>"]

    </table>

    #45446
    Franky
    Keymaster

    I believe it to be your double quotes inside your double quotes to be the problem, try this (untested):

    <table width="100%">
    <tr>
    <td>
    <h3>Date</h3>
    </td>
    <td>
    <h3>Organization</h3>
    </td>
    <td>
    <h3>City/State</h3>
    </td>
    </tr>[events_list limit=200 scope=2012-00-00--2012-12-31 format='<tr><td>#_{M j}[events_if tag="#ESC_{j M Y}" notvalue="#ESC@_{j M Y}"]-[events_if2 tag="#ESC_{M}" notvalue="#ESC@_{M}"]#@_{M }[/events_if2]#@_{j}[/events_if], #o</td><td>#_EVENTNAME</td><td>#_TOWN</td></tr>']
    </table>

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