Guest User

Untitled

a guest
Jun 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. $context = Timber::get_context();
  2. $page = new TimberPost();
  3.  
  4. $context['page'] = $page;
  5.  
  6. if ($photos = $page->get_field('photos')) {
  7. $context['photos'] = $photos;
  8. }
  9.  
  10. {% if page.photos %}
  11.  
  12. {% for p in page.photos %}
  13.  
  14. <img src="{{ p.sizes.gallery|relative }}" alt="{{ p.alt }}" />
  15.  
  16. {{ p.caption }}
  17.  
  18. {% endfor %}
  19.  
  20. {% endif %}
Add Comment
Please, Sign In to add comment