ce0c291192bd9f34afe26ff45e8ad7e2e0f9b25ec852f700e0031097d3abd8cb.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <?php
  2. /* modular.html.twig */
  3. class __TwigTemplate_83132030e3a04f02dab32e4d7c3c04a4515041b2678c791bfc38e3aee82996a6 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. // line 1
  9. $this->parent = $this->loadTemplate("partials/base.html.twig", "modular.html.twig", 1);
  10. $this->blocks = array(
  11. 'javascripts' => array($this, 'block_javascripts'),
  12. 'bottom' => array($this, 'block_bottom'),
  13. 'header_navigation' => array($this, 'block_header_navigation'),
  14. 'hero' => array($this, 'block_hero'),
  15. 'body' => array($this, 'block_body'),
  16. );
  17. }
  18. protected function doGetParent(array $context)
  19. {
  20. return "partials/base.html.twig";
  21. }
  22. protected function doDisplay(array $context, array $blocks = array())
  23. {
  24. // line 3
  25. $context["show_onpage_menu"] = (($this->getAttribute(($context["header"] ?? null), "onpage_menu", array()) == true) || (null === $this->getAttribute(($context["header"] ?? null), "onpage_menu", array())));
  26. // line 1
  27. $this->parent->display($context, array_merge($this->blocks, $blocks));
  28. }
  29. // line 6
  30. public function block_javascripts($context, array $blocks = array())
  31. {
  32. // line 7
  33. echo " ";
  34. if (($context["show_onpage_menu"] ?? null)) {
  35. // line 8
  36. echo " ";
  37. $this->getAttribute(($context["assets"] ?? null), "add", array(0 => "theme://js/singlepagenav.min.js"), "method");
  38. // line 9
  39. echo " ";
  40. }
  41. // line 10
  42. echo " ";
  43. $this->displayParentBlock("javascripts", $context, $blocks);
  44. echo "
  45. ";
  46. }
  47. // line 13
  48. public function block_bottom($context, array $blocks = array())
  49. {
  50. // line 14
  51. echo " ";
  52. $this->displayParentBlock("bottom", $context, $blocks);
  53. echo "
  54. ";
  55. // line 15
  56. if (($context["show_onpage_menu"] ?? null)) {
  57. // line 16
  58. echo " <script>
  59. // singlePageNav initialization & configuration
  60. \$('ul.navigation').singlePageNav({
  61. offset: \$('#header').outerHeight(),
  62. filter: ':not(.external)',
  63. updateHash: true,
  64. currentClass: 'active'
  65. });
  66. </script>
  67. ";
  68. }
  69. }
  70. // line 28
  71. public function block_header_navigation($context, array $blocks = array())
  72. {
  73. // line 29
  74. echo " ";
  75. if (($context["show_onpage_menu"] ?? null)) {
  76. // line 30
  77. echo " <ul class=\"navigation\">
  78. ";
  79. // line 31
  80. $context['_parent'] = $context;
  81. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["page"] ?? null), "collection", array(), "method"));
  82. foreach ($context['_seq'] as $context["_key"] => $context["module"]) {
  83. // line 32
  84. echo " ";
  85. $context["current_module"] = ((($this->getAttribute($context["module"], "active", array()) || $this->getAttribute($context["module"], "activeChild", array()))) ? ("active") : (""));
  86. // line 33
  87. echo " <li><a class=\"";
  88. echo ($context["current_module"] ?? null);
  89. echo "\" href=\"#";
  90. echo $this->getAttribute($this, "pageLinkName", array(0 => $this->getAttribute($context["module"], "menu", array())), "method");
  91. echo "\">";
  92. echo $this->getAttribute($context["module"], "menu", array());
  93. echo "</a></li>
  94. ";
  95. }
  96. $_parent = $context['_parent'];
  97. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['module'], $context['_parent'], $context['loop']);
  98. $context = array_intersect_key($context, $_parent) + $_parent;
  99. // line 35
  100. echo " ";
  101. $context['_parent'] = $context;
  102. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["site"] ?? null), "menu", array()));
  103. foreach ($context['_seq'] as $context["_key"] => $context["mitem"]) {
  104. // line 36
  105. echo " <li>
  106. <a ";
  107. // line 37
  108. if ($this->getAttribute($context["mitem"], "class", array())) {
  109. echo "class=\"";
  110. echo $this->getAttribute($context["mitem"], "class", array());
  111. echo "\"";
  112. }
  113. echo " href=\"";
  114. echo $this->getAttribute($context["mitem"], "url", array());
  115. echo "\">
  116. ";
  117. // line 38
  118. if ($this->getAttribute($context["mitem"], "icon", array())) {
  119. echo "<i class=\"fa fa-";
  120. echo $this->getAttribute($context["mitem"], "icon", array());
  121. echo "\"></i>";
  122. }
  123. // line 39
  124. echo " ";
  125. echo $this->getAttribute($context["mitem"], "text", array());
  126. echo "
  127. </a>
  128. </li>
  129. ";
  130. }
  131. $_parent = $context['_parent'];
  132. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['mitem'], $context['_parent'], $context['loop']);
  133. $context = array_intersect_key($context, $_parent) + $_parent;
  134. // line 43
  135. echo " </ul>
  136. ";
  137. } else {
  138. // line 45
  139. echo " ";
  140. $this->displayParentBlock("header_navigation", $context, $blocks);
  141. echo "
  142. ";
  143. }
  144. }
  145. // line 49
  146. public function block_hero($context, array $blocks = array())
  147. {
  148. // line 50
  149. echo " ";
  150. $context['_parent'] = $context;
  151. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["page"] ?? null), "collection", array(), "method"));
  152. foreach ($context['_seq'] as $context["_key"] => $context["module"]) {
  153. if (($this->getAttribute($context["module"], "template", array()) == "modular/hero")) {
  154. // line 51
  155. echo " <div id=\"";
  156. echo $this->getAttribute($this, "pageLinkName", array(0 => $this->getAttribute($context["module"], "menu", array())), "method");
  157. echo "\"></div>
  158. ";
  159. // line 52
  160. echo $this->getAttribute($context["module"], "content", array());
  161. echo "
  162. ";
  163. }
  164. }
  165. $_parent = $context['_parent'];
  166. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['module'], $context['_parent'], $context['loop']);
  167. $context = array_intersect_key($context, $_parent) + $_parent;
  168. }
  169. // line 56
  170. public function block_body($context, array $blocks = array())
  171. {
  172. // line 57
  173. echo " ";
  174. $context['_parent'] = $context;
  175. $context['_seq'] = twig_ensure_traversable($this->getAttribute(($context["page"] ?? null), "collection", array(), "method"));
  176. foreach ($context['_seq'] as $context["_key"] => $context["module"]) {
  177. if (($this->getAttribute($context["module"], "template", array()) != "modular/hero")) {
  178. // line 58
  179. echo " <div id=\"";
  180. echo $this->getAttribute($this, "pageLinkName", array(0 => $this->getAttribute($context["module"], "menu", array())), "method");
  181. echo "\"></div>
  182. ";
  183. // line 59
  184. echo $this->getAttribute($context["module"], "content", array());
  185. echo "
  186. ";
  187. }
  188. }
  189. $_parent = $context['_parent'];
  190. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['module'], $context['_parent'], $context['loop']);
  191. $context = array_intersect_key($context, $_parent) + $_parent;
  192. }
  193. // line 4
  194. public function getpageLinkName($__text__ = null, ...$__varargs__)
  195. {
  196. $context = $this->env->mergeGlobals(array(
  197. "text" => $__text__,
  198. "varargs" => $__varargs__,
  199. ));
  200. $blocks = array();
  201. ob_start();
  202. try {
  203. echo twig_replace_filter(twig_lower_filter($this->env, ($context["text"] ?? null)), array(" " => "_"));
  204. } catch (Exception $e) {
  205. ob_end_clean();
  206. throw $e;
  207. } catch (Throwable $e) {
  208. ob_end_clean();
  209. throw $e;
  210. }
  211. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  212. }
  213. public function getTemplateName()
  214. {
  215. return "modular.html.twig";
  216. }
  217. public function isTraitable()
  218. {
  219. return false;
  220. }
  221. public function getDebugInfo()
  222. {
  223. return array ( 204 => 4, 193 => 59, 188 => 58, 182 => 57, 179 => 56, 168 => 52, 163 => 51, 157 => 50, 154 => 49, 146 => 45, 142 => 43, 131 => 39, 125 => 38, 115 => 37, 112 => 36, 107 => 35, 94 => 33, 91 => 32, 87 => 31, 84 => 30, 81 => 29, 78 => 28, 64 => 16, 62 => 15, 57 => 14, 54 => 13, 47 => 10, 44 => 9, 41 => 8, 38 => 7, 35 => 6, 31 => 1, 29 => 3, 11 => 1,);
  224. }
  225. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  226. public function getSource()
  227. {
  228. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  229. return $this->getSourceContext()->getCode();
  230. }
  231. public function getSourceContext()
  232. {
  233. return new Twig_Source("{% extends 'partials/base.html.twig' %}
  234. {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}
  235. {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
  236. {% block javascripts %}
  237. {% if show_onpage_menu %}
  238. {% do assets.add('theme://js/singlepagenav.min.js') %}
  239. {% endif %}
  240. {{ parent() }}
  241. {% endblock %}
  242. {% block bottom %}
  243. {{ parent() }}
  244. {% if show_onpage_menu %}
  245. <script>
  246. // singlePageNav initialization & configuration
  247. \$('ul.navigation').singlePageNav({
  248. offset: \$('#header').outerHeight(),
  249. filter: ':not(.external)',
  250. updateHash: true,
  251. currentClass: 'active'
  252. });
  253. </script>
  254. {% endif %}
  255. {% endblock %}
  256. {% block header_navigation %}
  257. {% if show_onpage_menu %}
  258. <ul class=\"navigation\">
  259. {% for module in page.collection() %}
  260. {% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
  261. <li><a class=\"{{ current_module }}\" href=\"#{{ _self.pageLinkName(module.menu) }}\">{{ module.menu }}</a></li>
  262. {% endfor %}
  263. {% for mitem in site.menu %}
  264. <li>
  265. <a {% if mitem.class %}class=\"{{ mitem.class }}\"{% endif %} href=\"{{ mitem.url }}\">
  266. {% if mitem.icon %}<i class=\"fa fa-{{ mitem.icon }}\"></i>{% endif %}
  267. {{ mitem.text }}
  268. </a>
  269. </li>
  270. {% endfor %}
  271. </ul>
  272. {% else %}
  273. {{ parent() }}
  274. {% endif %}
  275. {% endblock %}
  276. {% block hero %}
  277. {% for module in page.collection() if module.template == 'modular/hero' %}
  278. <div id=\"{{ _self.pageLinkName(module.menu) }}\"></div>
  279. {{ module.content }}
  280. {% endfor %}
  281. {% endblock %}
  282. {% block body %}
  283. {% for module in page.collection() if module.template != 'modular/hero' %}
  284. <div id=\"{{ _self.pageLinkName(module.menu) }}\"></div>
  285. {{ module.content }}
  286. {% endfor %}
  287. {% endblock %}
  288. ", "modular.html.twig", "/mnt/data/Sites/r2c.net/user/themes/r2c/templates/modular.html.twig");
  289. }
  290. }