Last active
August 29, 2015 14:05
-
-
Save expl0ratory/725b7f904561c428a03c to your computer and use it in GitHub Desktop.
Add an editable text area to subscription term
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- macro term_cell(np, loop, term_price) -%} | |
{% if term_price.term.enabled %} | |
{% set term = term_price.term %} | |
{{ cell_div(np, loop.first) }} | |
<div class="promo-border"> | |
<h2 data-barley="term.{{ term.id }}.name" data-barley-editor="simple"> | |
{{ term.name | safe }} | |
</h2> | |
<div class="product_image_container" data-barley="term.{{ term.id }}.img" data-barley-editor="image-logo"> | |
{{ ("images/style2/shaving-box" ~ loop.index ~ ".png") | asset_url | img_tag(css_class="product_image") }} | |
</div> | |
<p class="sml-promo-text sml-sub-text"> | |
{{ term.description | safe }} | |
</p> | |
<p data-barley="term_price.{{ term_price.id }}.price" data-barley-editor="simple"> | |
{{ term_price.price | currency }} | |
</p> | |
<span data-barley="term_addtl_{{ term_price.id }}" data-barley-editor="simple"> | |
Example text | |
</span> | |
{{ ship_option(product) }} | |
<div class="select-button-container"> | |
<a class="primary-button" href="{{ product | product_subscribe_url(chosen_values, term_price.term) }}"> | |
Select | |
</a> | |
</div> | |
</div> | |
</div> | |
{% endif %} | |
{%- endmacro -%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Within subscribe.html look for the macro term_cell (shown above).
You can create editable text areas by adding DOM elements with data-barely and data-barely-editor tags. In the above example I've added a span after the price with the id of term_price.{{ term_price.id }}.new_stuff
It is very important that the barely ids are unique, no duplication.
I've put "Example text" in the new element. This is for two purposes.