Website CMS documentation

Event object

The event object is available in all voxevent pages :

Property Details
name Return the name of the event
start_date Returns the start date of the event.
end_date Return the end date of the event.

Display url params

Using the Liquid syntax , you can find values of the parameters accross the keys

For example this link:

  http://my-event.com/pages/guests?toto=1234&first-name=John
  Writing in your code:
  {{url_params["toto"]}}
  {{url_params["first-name"]}}

The result displayed on the page will be "1234" for the key "toto"

The result displayed on the page will be "John" for the key "firstname"

Dealing with menus

Once you have created named your_menu_name, you might want to display it this way :

<ul>
   {{ for item in menus.your_menu_name }}
      <li><a href="{{item.url}}">{{item.name}}</a></li>
   {{ endfor }}
</ul>

Dealing with editable fields

Basic editable field

{% editable_text "field_name" %}{% endeditable_text %}

Text area and cktext area

{% editable_text "field_name", type:text_area %}{% endeditable_text %}
{% editable_text "field_name", type:cktext_area %}{% endeditable_text %}

Sort editable fields

The highest the value is, the upper the field is.

{% editable_text "field_name1", priority:2 %}{% endeditable_text %}
{% editable_text "field_name2", priority:1 %}{% endeditable_text %}

Default value

{% editable_text "field_name" %}default value{% endeditable_text %}

Dealing with guests categories

<ul>
 {% for guest_category in mc_event.guest_categories %}
        <li>{{ guest_category.name }}</li>
    {% endfor %}
</ul>

Dealing with collections

Once you have created your collection and added entries, here is how to access them in liquid:

<ul>
 {% for collection in collections.cars %}
        <li>{{ collection.engine }}</li>
        <li>{{ collection.color }}</li>
        <li>{{ collection.weight }}</li>
    {% endfor %}
</ul>

In this example:

  • cars is the key of the collection.
  • engine, color and weight are fields of the cars collection

Dealing with guests

Guest Module configuration

Guest fields

Basic Guests properties
Property Details
uid The uid of the guest
last_name The lastname of the guest
first_name The lastname of the guest.
email The email of the guest.
position the position of the guest.
company_name The company name of the guest.
phone_number The phone number of the guest.
avatar_url The url of the guest avatar.
comment1 The first comment of the guest.
comment2 The second comment of the guest.
avatar_normal The normal size of the guest avatar.
avatar_thumb The small size of the guest avatar.
avatar_big The big size of the guest avatar.
avatar_medium The medium size of the guest avatar.
.guest_metadata.yourmetadata The metadatum from your metadata of the guest.
.all_metadata.order_uid All your metadata from the order uid of the guest.
.all_metadata.your_metadata All your metadata from your metadata of the guest.
.guest_metadata.displayed_password force to set a preset password into the password field.
Use JSON mapping to allow custom synchronisation mapping

JSON field mappings allows to map in a special way Eventmaker fields

For instance if you wish to force to put an uploaded picture named photo from Eventmaker into the avatar

{“metadata/photo”:”remote_avatar_url”,”file/photo”:”true”}

You can also force to set a preset password {{guest.guest_metadata.displayed_password}} into the password field. You just will not be able to display it, unless you would like to keep it also in another field, but we strongly unadvise you to do so.

{“metadata/displayed_password”:”password”}

Loops on guests

Calculate the number of guests

{% assign guest_count = "" %}
{% paginate guests by 10000 %}
{% for guest in paginate.collection %}
{% capture guest_count %}{{ guest_count | plus: 1 }}{% endcapture %}
{% endfor %}
<p>{{ guest_count }} partners</p>
{% endpaginate %}

Loop on guests

<ul>
{% paginate guests by 10000 %}
{% for guest in paginate.collection %}
<li>{{ guest.first_name }} {{ guest.last_name }}</li>
{% endfor %}
{% endpaginate %}
</ul>

limit to a certain guest category

filter by guest_category_id

{% paginate guests by 10000 %}
<ul>
{% for guest in paginate.collection %}
{% if guest.metadata.guest_category_id == 12345678909876543234 %}
<li>{{guest.first_name}}{{guest.last_name}}</li>
{% endif %}
{% endfor %}
</ul>
{% endpaginate %}

filter by guest category name

This workaround is mandatory if you are duplicating event configuration, with different guest categories ids referring to the same reality in two different events.

First you have to retrieve the guest category id associated to the “partners” into a partners_gc_id variable

{% for guest_category in mc_event.guest_categories %}
{% if guest_category.name == "Partner" %}
{% assign partners_gc_id = guest_category.id %}
{% endif %}  
{% endfor %}

And then exclude in your loop guests that do not have this id as for guest category

{% paginate guests by 10000 %}
<ul>
{% for guest in paginate.collection %}
{% if guest.metadata.guest_category_id == partners_gc_id %}
<li>{{guest.first_name}}{{guest.last_name}}</li>
{% endif %}
{% endfor %}
</ul>
{% endpaginate %}

Reverse loop on guests

{% for guest in paginate.collection reversed %}
<li>{{ guest.first_name }} {{ guest.last_name }}</li>
{% endfor %}

Sorted loop on guests

<ul>
{% paginate guests by 10000 %}
{% assign sorted_guests = paginate.collection | sort: "first_name" %}
{% for guest in sorted_guests %}
<li>{{ guest.first_name }} {{ guest.last_name }}</li>
{% endfor %}
{% endpaginate %}
</ul>

Live CMS documentation

Dealing with session

We can display informations of sessions like the name even in the template page which are not bound with sessions by looping on live sessions. For example:

<div class="sessions">
  {% for session in sessions %}
    <div class="session">
      <div class="session-main">
        <p class="session-content">
          <a href="./{{ session.path_name }}">
            <i class="fa fa-group"></i> <span>{{ session.name }}</span>
          </a>
        </p>
      </div>
    </div>
  {% endfor %}
</div>

Dealing will polls

When using the poll functionnality, users can access a list of questions and answer to each one of them through a set of limited choices.

Depending on the associated resource of the templated page, you have access to either the polls variable or the poll variable, the first being an array through which you can loop. When the templated page is associated to a poll, you also have access to the choices variable.

Poll properties

Property Details
label The label of the question
quiz Returns true if question is part of a quiz
info An extra description
closed? Returns true if the poll has been closed
id Unique identifier which can be used in URLs
session_parameterized The path name of the poll's session
nb_votes The number of votes for this poll
next_quiz_id The identifier of the quiz's next question if the current one is a quiz

Choice properties

Property Details
label The label of the choice
id Unique identifier
image_url URL of the associated image in standard format (max: 256x256)
image_big_url URL of the associated image in big format (max: 500x500)
image_thumb_url URL of the associated image in small format (max: 50x50)

Team object

In the case where the Live is activated and a page bounded to a session and that my guests module is activate and that I have a team, I have access at teams object where I can loop. I can display name and score teams.

We can use team object in voxevent page bounded to a session:

Property Details
name Return the name of the team
score Returns the score of the team.

Examples

Looping through polls

  {% for poll in polls %}
    <div class="poll">
      <a href="../{{ poll.session_parameterized }}/polls/{{ poll.id }}">
        <span>{{ poll.label }}</span>
      </a>
    </div>
  {% endfor %}

Displaying poll’s choices

Using the Liquid filter choice_vote enables a clickable link on the poll's label which allows users to vote. See example below:

  <div>
    <p>{{ poll.label }}</p>
    <ul class="choices">
      {% for choice in choices %}
        <li>
          {% if poll.closed? %}
            <span>{{ choice.label }}</span>;
          {% else %}
            {{ choice.id | choice_vote }}<br />
            {% if choice.image_thumb_url != blank %}
              <img src="{{ choice.image_thumb_url }}" />;
            {% endif %}
          {% endif %}
        </li>
      {% endfor %}
    </ul>
  </div>
{{ 'infospratiques.css' | stylesheet_tag}}

which means in html:

<link href="infospratiques.css" rel="stylesheet" type="text/css">

You can add or change media option which is by default at ‘screen’:

{{ 'infospratiques.css' | stylesheet_tag: 'print' }}

which means in html:

<link href="infospratiques.css" media="print" rel="stylesheet" type="text/css">

You can display the URL of the css file for example infopratiques.css with stylesheet_url :

{{ 'infopratiques.css' | stylesheet_url }}

Javascript, style, images tags

We can display informations with html like images but we can use tags to simplify your code. We have 3 tags: stylesheet_tag, javascript_tag, image_tag

Image tag

image_tag enables to display a picture in voxevent, it represent in html :

<img src=""/>

For example you want to include the picture “header-img-blue.png” in a voxevent page:

{{ "header-img-blue.png" | image_tag }}

which means in html:

<img src="header-img-blue.png"/>

You can add or change option of the css file. For example you want to modify the proportion of the picture:

{{ "header-img-blue.png" | image_tag:"width:80px","height:120px" }}

You can display the URL of the picture for example header-img-blue.png with image_url :

{{ 'header-img-blue.png' | image_url }}

Stylesheet tags

stylesheet_tag enables to call css files in voxevent, it represent in html :

<link href="" rel="stylesheet" type="text/css">

For example you want to include “infopratiques.css” in a voxevent page:

Javacript tag

javacript_tag enables to call js file in voxevent, it represent in htmlmm.

<script src=""type="text/javascript"></script>

For example you want to include “base.js” in a voxevent page:

{{"base.js" | image_tag }}

which means in html: <script src=”base.js”type=”text/javascript”></script>

You can display the URL of the javascript file for example base.js with javascript_url :

{{ 'base.js' | javascript_url }}

Dealing with Q&A

You need to create a session which will contains your topics. You can display informations thanks to the topic properties:

Topic properties

Property Details
id Unique identifier of the topic
author_id Unique identifier of the author
author The email of the author who posted the topic
name The name of the topic
answers_count The number of comments in the topics discussion
session_parameterized the name of the session to use it with the id of the topic to build the URL

You can display the button to like a topic:

{% for topic in topics %}
  {{ topic.id | topic_upvote }}
{% endfor %}

You can display a private form of the topic with the field to write the name of the author, the textarea for the message with the button to submit:

{% new_topic_form %}
  <textarea name="topic[name]" rows="3" placeholder="Your topic..."></textarea><br />
  <input type="submit" class="form-button" />
{% endnew_topic_form %}

You can display a public form of the topic with the field to write the name of the author, the textarea for the message with the button to submit:

{% new_public_topic_form %}
  <input type="text" name="topic[anonymous_guest][full_name]" /> <!-- auteur public -->
  <textarea name="topic[name]" rows="3" placeholder="Your topic..."></textarea><br />
  <input type="submit" class="form-button" />
{% endnew_public_topic_form %}

You can modify the content of “Like” button at “+1” for example:

{% topic_upvote_block %}
  +1
{% endtopic_upvote_block %}

Dealing with answer in Q&A

answer properties

Property Details
id Unique identifier of the answer
nb_vote The number of the vote in the discussion
content The content of the discussion
posted_by The user who posted the answer
posted_at The date when you post your answer

You can display the button to like an answer:

{% for answer in answers %}
  {{ answer.id | answer_upvote }}
{% endfor %}

You can display a private answer form of the Q&A with the input field to write the name of the author, the textarea for the answer with the button to submit:

{% new_answer_form %}
  <textarea name="answer[content]" rows="3" placeholder="Your answer..."></textarea><br />
  <input type="submit" class="form-button" />
{% endnew_answer_form %}

You can display a public answer form of the Q&A with the input field to write the name of the author, the textarea for the answer with the button to submit:

{% new_public_answer_form %}
  <input type="text" name="answer[anonymous_guest][full_name]" /><br />
  <textarea name="answer[content]" rows="3" placeholder="Your answer..."></textarea><br />
  <input type="submit" class="form-button" />
{% endnew_public_answer_form %}

Displaying quizz choice

Using the Liquid filter `quizz_choice` enables to select an answer in the quizz, for example:

<div class="poll-question">
  <p><i class="fa fa-question"></i> {{ poll.label }}</p>
  <ul class="choices">
    {% for choice in choices %}
      <li><i class="fa fa-lemon-o"></i>
        {% if poll.closed? %}
          <span>{{ choice.label }}</span>
        {% else %}
          {{ choice.id | quiz_choice }}
        {% endif %}
      </li>
    {% endfor %}
  </ul>
</div>
### Dealing with conditional display from logged in/out status

You can display an element only if you are logged out with the following Liquid block:

  {% show_if_signed_out %}

You can display an element only if you are logged in with the following Liquid block:

  {% show_if_signed_in %}

You can log out with the following Liquid block:

  {% sign_out %}Sign out{% endsign_out %}

By default, the following URL is used to display a log in form:

  <a href="/guests/sign_in">Sign in</a>
Example :
  {% show_if_signed_out %}
    <a href="/guests/sign_in" style="color: {{text_color}};">CONNEXION</a>
  {% endshow_if_signed_out %}
  {% show_if_signed_in %}
    {% sign_out %}
      <span style="color: {{text_color}};">DECONNEXION</span>
    {% endsign_out %}
  {% endshow_if_signed_in %}