Skip to content

Instantly share code, notes, and snippets.

@owen2345
Created February 10, 2016 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owen2345/b58fb66549efeff810c5 to your computer and use it in GitHub Desktop.
Save owen2345/b58fb66549efeff810c5 to your computer and use it in GitHub Desktop.
Camaleon CMS Custom Fields
<h1><%= @post.the_title %></h1>
<div>
<%= raw @post.the_content %>
</div>
<hr>
<h2>Custom fields here:</h2>
<div>
Author name: <%= @post.get_field('author-name') %>
</div>
<div>
Author photo:
<%= image_tag(@post.get_field('author-photo', 'http://camaleon.tuzitio.com/media/132/slider/slide33.jpg')) %>
</div>
<div>
Author Comments: <%= @post.the_field('author-details') %>
</div>
<h4>Photos</h4>
<ul>
<% @post.get_fields('photos').each do |url| %>
<li><%= image_tag(url, style: 'width: 50px; height: 50px;') %></li>
<% end %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment