PeopleVine out of the box provides you with 60+ pages to leverage for each PeopleVine component. At times you may need to hide elements, change elements and/or add new elements to the screen. This tutorial will help you do that.
Each page leverages yours Page Layout to render the look and feel of the page, including the header/footer, style sheets and javascript for the page. When making changes to the page layout, this will reflect across every out of the box page. If you would like to update content for a specific page, follow these steps:
Start by finding out what page you want to edit
Identify the URL in the address bar (e.g. commerce_product.aspx)
or you can leverage the javascript curPath variable which loads at the top of each page
to find the curPath value, click View Source on your page and search for curPath.
Inside your page layout, you can either load a script or add it directly in the header or footer of the page to then do something on this page.
In this example we show how you can check if you're on the commerce_receipt page to call this Google Analytics code with the item and transaction data.
if(curPath == 'commerce_receipt.aspx') {
ga('exampleTracker.require', 'ecommerce');
for(i = 0; i < item.length; i++) {
ga('exampleTracker.ecommerce:addItem', {
'id': item[i].id,
'name': item[i].name,
'sku': item[i].sku,
'category': item[i].attribute,
'price': item[i].price,
'quantity': item[i].quantity,
'currency': 'USD'
});
}
ga('exampleTracker.ecommerce:addTransaction', transaction);
ga('exampleTracker.ecommerce:send');
}