ticket #3 - Added learning cartridge with all complete examples
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var Template = require('dw/util/Template');
|
||||
var HashMap = require('dw/util/HashMap');
|
||||
|
||||
/**
|
||||
* Render logic for storefront.imageAndText component.
|
||||
* @param {dw.experience.ComponentScriptContext} context The Component script context object.
|
||||
* @param {dw.util.Map} [modelIn] Additional model values created by another cartridge.
|
||||
*
|
||||
* @returns {string} The markup to be displayed
|
||||
*/
|
||||
module.exports.render = function (context, modelIn) {
|
||||
var model = modelIn || new HashMap();
|
||||
var content = context.content;
|
||||
|
||||
model.title = content.title ? content.title : null;
|
||||
model.comment = content.comment ? content.comment : null;
|
||||
model.name = content.name ? content.name : null;
|
||||
|
||||
return new Template('experience/components/commerce_assets/feedback').render(model).text;
|
||||
};
|
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "Feedback",
|
||||
"description": "Hardcoded customer feedback",
|
||||
"group": "Custom",
|
||||
"attribute_definition_groups": [
|
||||
{
|
||||
"id": "feedback_content",
|
||||
"name": "Feedback Content",
|
||||
"description": "Enter feedback below, all fields required",
|
||||
"attribute_definitions": [
|
||||
{
|
||||
"id": "title",
|
||||
"name": "Title",
|
||||
"description": "title of feedback",
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"id": "comment",
|
||||
"name": "Comment",
|
||||
"description": "Text body of feedback",
|
||||
"type": "markup",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"id": "name",
|
||||
"name": "Username",
|
||||
"description": "User who submitted this feebback",
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"region_definitions": []
|
||||
}
|
Reference in New Issue
Block a user