You are here

views-view-row-fia.html.twig in Facebook Instant Articles 8

Default theme implementation to display an item in a views FIA (facebook instant articles) feed.

Available variables:

  • options.title: RSS item title.
  • options.subtitle: RSS item subtitle.
  • options.kicker : teaser short text for the article
  • options.created : created datetime
  • options.modified : modified datetime
  • options.link: RSS item link.
  • options.figure: a full html markup for a header image (syntax below)
  • options.authors : htmls <address> tags for article authors (syntax below)
  • content : HTML content for the article
  • footer : HTML content for the article footer

The syntax for the figure allows: <figure> <img src="http://mydomain.com/path/to/img.jpg" /> <figcaption>This image is amazing</figcaption> </figure>

The Syntac for the author <address>: <address> <a rel="facebook" href="http://facebook.com/brandon.diamond">Brandon Diamond</a> Brandon is a avid zombie hunter. </address> <address> <a>TR Vishwanath</a> Vish is a scholar and a gentleman. </address>

datetime="2014-11-11T04:44:16Z">November 11th, 4:44 PM

File

templates/views-view-row-fia.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display an item in a views FIA (facebook instant articles) feed.
  5. *
  6. * Available variables:
  7. * - options.title: RSS item title.
  8. * - options.subtitle: RSS item subtitle.
  9. * - options.kicker : teaser short text for the article
  10. * - options.created : created datetime
  11. * - options.modified : modified datetime
  12. * - options.link: RSS item link.
  13. * - options.figure: a full html markup for a header image (syntax below)
  14. * - options.authors : htmls <address> tags for article authors (syntax below)
  15. *
  16. * - content : HTML content for the article
  17. *
  18. * - footer : HTML content for the article footer
  19. *
  20. * The syntax for the figure allows:
  21. * <figure>
  22. * <img src="http://mydomain.com/path/to/img.jpg" />
  23. * <figcaption>This image is amazing</figcaption>
  24. * </figure>
  25. *
  26. * The Syntac for the author <address>:
  27. * <address>
  28. * <a rel="facebook" href="http://facebook.com/brandon.diamond">Brandon Diamond</a>
  29. * Brandon is a avid zombie hunter.
  30. * </address>
  31. * <address>
  32. * <a>TR Vishwanath</a>
  33. * Vish is a scholar and a gentleman.
  34. * </address>
  35. *
  36. * datetime="2014-11-11T04:44:16Z">November 11th, 4:44 PM
  37. *
  38. * @see template_preprocess_views_view_row_rss()
  39. *
  40. * @ingroup themeable
  41. */
  42. #}
  43. <item>
  44. <title>{{ options.title }}</title>
  45. <link>{{ options.link.url }}</link>
  46. <guid>{{ options.guid }}</guid>
  47. <pubDate>{{ options.created|date("Y-d-m\\TH:i:sT") }}</pubDate>
  48. <author>{{ options.author }}</author>
  49. <description>{{ options.kicker }}</description>
  50. <content:encoded>
  51. <![CDATA[
  52. <!doctype html>
  53. <html lang="{{ options.langcode }}" prefix="op: http://media.facebook.com/op#">
  54. <head>
  55. <meta charset="utf-8">
  56. <link rel="canonical" href="{{ options.link.url }}">
  57. <meta property="op:markup_version" content="v1.0">
  58. {% if options.automatic_ad %} <meta property="fb:use_automatic_ad_placement" content="true"> {% endif %}
  59. </head>
  60. <body>
  61. <article>
  62. <header>
  63. <!-- The title and subtitle shown in your Instant Article -->
  64. <h1>{{ options.title }}</h1>
  65. {% if options.subtitle -%}
  66. <h2>{{ options.subtitle }}</h2>
  67. {% endif %}
  68. <!-- The date and time when your article was originally published {{ options.created }} -->
  69. <time class="op-published" datetime="{{ options.created|date("Y-d-m\\TH:i:sT") }}">{{ options.created|date("F jS, g:i A") }}</time>
  70. <!-- The date and time when your article was last updated {{ options.modified }} -->
  71. <time class="op-modified" datetime="{{ options.modified|date("Y-d-m\\TH:i:sT") }}">{{ options.modified|date("F jS, g:i A") }}</time>
  72. {% if options.automatic_ad %}
  73. <!-- Ad to be automatically placed throughout the article -->
  74. <figure class="op-ad">
  75. {{ options.automatic_ad }}
  76. </figure>
  77. {% endif %}
  78. {% if kicker -%}
  79. <!-- A kicker for your article -->
  80. <h3 class="op-kicker">{{ kicker }}</h3>
  81. {% endif %}
  82. {% if options.figure -%}
  83. <!-- The cover image shown inside your article -->
  84. {{ options.figure }}
  85. {% endif %}
  86. {% if options.author -%}
  87. <!-- The author of your article -->
  88. <address>{{ options.author }}</address>
  89. {% endif %}
  90. </header>
  91. <!-- Article body started -->
  92. {{ row }}
  93. <!-- Article body finished -->
  94. {% if footer -%}
  95. <footer>
  96. {{ footer }}
  97. </footer>
  98. {% endif %}
  99. </article>
  100. </body>
  101. </html>
  102. ]]>
  103. </content:encoded>
  104. </item>