Data structure

Displaying the right information from your social posts.

{

  “platform”: “string”,

  “post_id”: “string”,

  “post_data”: {

    “id”: “number”,

    “page”: {

      “id”: “number”,

      “name”: “string”,

      “username”: “string”

    },

    “message”: “string”,

    “created_at”: “string”,

    “media”: “string”,

    “media_type”: “string”

  },

  “post_date”: “string”,

  “fetched_at”: “string”

}

So a complete twig social post can look something like this:

<article class="social-post">

  <p class="social-post__platform">{{ spcialPost.platform }}</p>

  {% if socialPost.post_data.media and socialPost.post_data.mediaType == 'picture' %}

    <figure class="social-post__figure">

      <img class="social-post__image" src="{{ socialPost.post_data.media }}"/>

    </figure>

  {% endif %}

  <p class="social-post__message">{{ socialPost.post_data.message }}</p>

</article>