-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Johann Barbie edited this page Oct 25, 2015
·
15 revisions
-
Open up your Shopify Admin interface at:
https://<shopname>.myshopify.com/admin/themes
On your installed theme, select "Customize Theme" -> "Theme Options" -> "Edit HTML/CSS".
-
In the Folder "Assets", open scripts.js.liquid for editing and add following code to the file:
//PROVENANCE
(function(hookEl, findSlugEl) {
'use strict';
//search dom and check preconditions
var slugRegEx = /.*\/stories\/([\w-]*)/;
var el = $(findSlugEl).find('[href*="provenance.org"]')[0];
var slug = (el) ? $(el).attr('href').match(slugRegEx)[1] : undefined;
if (!slug || $(hookEl).length === 0) {
return;
}
//insert new element
var newEl = $('<div class="section provenance-StoryCard" data-slug="' + slug + '"></div>');
newEl.insertAfter(hookEl);
//load javascript
$.getScript('//drj5wi2x4lz96.cloudfront.net/js/prov.min.js');
//remove data element
$(el.parentNode).remove();
})('div.space-under', 'div.product-description');
- Save file, and verify functionality. Make sure you test a product with a linked story.