Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sample Theme Settings
<!-- /my_theme/views/admin/settings.html.erb -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><%= t('.top_offer', default: 'Top Offer') %></h3>
<div class="panel-body">
<div class="form-group">
<label><%= t('.top_offer_product', default: 'Offer Product') %></label><br>
<%= select_tag "theme_option[top_offer]", options_from_collection_for_select(post_type.posts.public_posts.decorate, :id, :the_title, current_theme.get_option('top_offer')), include_blank: true, class: 'form-control' %>
<div class="form-group">
<label><%= t('.top_offer_image', default: 'Offer Image') %></label><br>
<%= hidden_field_tag "theme_option[top_offer_image]", current_theme.get_option('top_offer_image'), class: 'form-control input_upload', 'data-dimension' => '275x395' %>
<div class="form-group">
<label><%= t('.top_offer_percentage', default: 'Percentage Disccount') %></label><br>
<%= text_field_tag "theme_option[top_offer_percentage]", current_theme.get_option('top_offer_percentage', 0), class: 'form-control number' %>
Copy link

owen2345 commented Nov 11, 2016

To use the values:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment