Add products block config
[MAILPOET-1842]
This commit is contained in:
@ -40,7 +40,7 @@ Module.ProductsBlockModel = base.BlockModel.extend({
|
|||||||
amount: '10',
|
amount: '10',
|
||||||
offset: 0,
|
offset: 0,
|
||||||
contentType: 'product',
|
contentType: 'product',
|
||||||
postStatus: 'publish', // 'draft'|'pending'|'private'|'publish'|'future'
|
postStatus: 'publish', // 'draft'|'pending'|'publish'
|
||||||
terms: [], // List of category and tag objects
|
terms: [], // List of category and tag objects
|
||||||
search: '', // Search keyword term
|
search: '', // Search keyword term
|
||||||
inclusionType: 'include', // 'include'|'exclude'
|
inclusionType: 'include', // 'include'|'exclude'
|
||||||
@ -67,7 +67,7 @@ Module.ProductsBlockModel = base.BlockModel.extend({
|
|||||||
_selectedProducts: [],
|
_selectedProducts: [],
|
||||||
_availableProducts: [],
|
_availableProducts: [],
|
||||||
_transformedProducts: new (App.getBlockTypeModel('container'))(),
|
_transformedProducts: new (App.getBlockTypeModel('container'))(),
|
||||||
}, App.getConfig().get('blockDefaults.posts'));
|
}, App.getConfig().get('blockDefaults.products'));
|
||||||
},
|
},
|
||||||
relations: function relations() {
|
relations: function relations() {
|
||||||
return {
|
return {
|
||||||
@ -107,7 +107,6 @@ Module.ProductsBlockModel = base.BlockModel.extend({
|
|||||||
fetchAvailableProducts: function fetchAvailableProducts() {
|
fetchAvailableProducts: function fetchAvailableProducts() {
|
||||||
var that = this;
|
var that = this;
|
||||||
this.set('offset', 0);
|
this.set('offset', 0);
|
||||||
this.set('contentType', 'product');
|
|
||||||
CommunicationComponent.getPosts(this.toJSON()).done(function getPostsDone(products) {
|
CommunicationComponent.getPosts(this.toJSON()).done(function getPostsDone(products) {
|
||||||
that.get('_availableProducts').reset(products);
|
that.get('_availableProducts').reset(products);
|
||||||
that.get('_selectedProducts').reset(); // Empty out the collection
|
that.get('_selectedProducts').reset(); // Empty out the collection
|
||||||
|
@ -1331,6 +1331,62 @@
|
|||||||
backgroundColor: '#ffffff',
|
backgroundColor: '#ffffff',
|
||||||
backgroundColorAlternate: '#eeeeee',
|
backgroundColorAlternate: '#eeeeee',
|
||||||
},
|
},
|
||||||
|
products: {
|
||||||
|
amount: '10',
|
||||||
|
withLayout: true,
|
||||||
|
contentType: 'product',
|
||||||
|
postStatus: 'publish', // 'draft'|'pending'|'publish'
|
||||||
|
inclusionType: 'include', // 'include'|'exclude'
|
||||||
|
displayType: 'excerpt', // 'excerpt'|'full'|'titleOnly'
|
||||||
|
titleFormat: 'h1', // 'h1'|'h2'|'h3'|'ul'
|
||||||
|
titleAlignment: 'left', // 'left'|'center'|'right'
|
||||||
|
titleIsLink: false, // false|true
|
||||||
|
imageFullWidth: false, // true|false
|
||||||
|
featuredImagePosition: 'alternate', // 'centered'|'left'|'right'|'alternate'|'none',
|
||||||
|
showAuthor: 'no', // 'no'|'aboveText'|'belowText'
|
||||||
|
authorPrecededBy: '<%= __('Author:') | escape('js') %>',
|
||||||
|
showCategories: 'no', // 'no'|'aboveText'|'belowText'
|
||||||
|
categoriesPrecededBy: '<%= __('Categories:') | escape('js') %>',
|
||||||
|
readMoreType: 'link', // 'link'|'button'
|
||||||
|
readMoreText: '<%= __('Read more') | escape('js') %>',
|
||||||
|
readMoreButton: {
|
||||||
|
text: '<%= __('Read more') | escape('js') %>',
|
||||||
|
url: '[postLink]',
|
||||||
|
context: 'posts.readMoreButton',
|
||||||
|
styles: {
|
||||||
|
block: {
|
||||||
|
backgroundColor: '#2ea1cd',
|
||||||
|
borderColor: '#0074a2',
|
||||||
|
borderWidth: '1px',
|
||||||
|
borderRadius: '5px',
|
||||||
|
borderStyle: 'solid',
|
||||||
|
width: '180px',
|
||||||
|
lineHeight: '40px',
|
||||||
|
fontColor: '#ffffff',
|
||||||
|
fontFamily: 'Verdana',
|
||||||
|
fontSize: '18px',
|
||||||
|
fontWeight: 'normal',
|
||||||
|
textAlign: 'center',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sortBy: 'newest', // 'newest'|'oldest',
|
||||||
|
showDivider: true, // true|false
|
||||||
|
divider: {
|
||||||
|
context: 'posts.divider',
|
||||||
|
styles: {
|
||||||
|
block: {
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
padding: '13px',
|
||||||
|
borderStyle: 'solid',
|
||||||
|
borderWidth: '3px',
|
||||||
|
borderColor: '#aaaaaa',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
backgroundColor: '#ffffff',
|
||||||
|
backgroundColorAlternate: '#eeeeee',
|
||||||
|
},
|
||||||
social: {
|
social: {
|
||||||
iconSet: 'default',
|
iconSet: 'default',
|
||||||
styles: {
|
styles: {
|
||||||
|
Reference in New Issue
Block a user