Forum Discussion

princely-oclc's avatar
16 days ago
Solved

Classic - Event Board Page force List View

Hi,

Is there a way to configure a particular event board to always default to List View? Ideally, this would be via:

  • Query Parameter loading the page.
  • Quilt component parameter for the viewToggle or occasionsListView component. 

Context: The event board is part of an Annual conference that happens in the future. So, this month's events are empty for most of the year. Registered users have the option to select List or Calendar View using the viewToggle component. This setting is preserved. For this event board, the Calendar View will show as empty.

Any ideas? Thanks in advance!

Mark

  • Alright, after some sleuthing, looks like it might be a user setting of sorts.

    occasion.current_view_for_user

    Maybe you can use freemarker to check and set that setting for the user in common.init. For anonymous users, it seems to also use a cookie lia.anon.occasion.current_view_for_user.

    The valid values for the setting are: list or calendar

    Hopefully that gets you going in the right direction.

3 Replies

  • MattV's avatar
    MattV
    Khoros Staff
    15 days ago

    Alright, after some sleuthing, looks like it might be a user setting of sorts.

    occasion.current_view_for_user

    Maybe you can use freemarker to check and set that setting for the user in common.init. For anonymous users, it seems to also use a cookie lia.anon.occasion.current_view_for_user.

    The valid values for the setting are: list or calendar

    Hopefully that gets you going in the right direction.

  • Hey MattV!

    Yes, the quilt looks like that. By default a user will always use List View. However, if a registered user switches to Calendar View on another Event board, that setting is maintained across Event boards.

    Our challenge is that we have event boards for two use cases:

    1. Rolling events - training classes, user group meetings, etc.
    2. Special events - One week/month there are events

    Most of our event boards are rolling events. If a user switches to Calendar view while looking at rolling events and then goes to a special events board, they will see the current calendar month (blank) instead of the list of special events (next month or later).

    We are weighing removing the viewToggle component entirely. That is an option if users don't use the calendar view for rolling events. It would be ideal if we could, instead, configure the Special Event boards to explicitly use List View. 

    Does that help?

    Mark

  • MattV's avatar
    MattV
    Khoros Staff
    15 days ago

    Hey Mark,

    What does the quilt XML look like? On our test community, the event board page is loading in list view by default already. 

    For reference, the default OccasionBoardPage.quilt.xml XML looks like:

    <?xml version="1.0" encoding="UTF-8"?>
    <quilt extends="Common" layout="one-column">
      <add to="common-header">
        <component id="primary-post-button" wrapper="lia-page-header"/>
      </add>
      <add to="main-content">
        <component id="viewToggle"/>
        <component id="occasionsListView"/>
      </add>
    </quilt>