Add products block config

[MAILPOET-1842]
This commit is contained in:
Ján Mikláš
2019-03-28 13:47:06 +01:00
committed by M. Shull
parent 9ec31ae39d
commit 06ed6cf61a
2 changed files with 58 additions and 3 deletions

View File

@ -40,7 +40,7 @@ Module.ProductsBlockModel = base.BlockModel.extend({
amount: '10',
offset: 0,
contentType: 'product',
postStatus: 'publish', // 'draft'|'pending'|'private'|'publish'|'future'
postStatus: 'publish', // 'draft'|'pending'|'publish'
terms: [], // List of category and tag objects
search: '', // Search keyword term
inclusionType: 'include', // 'include'|'exclude'
@ -67,7 +67,7 @@ Module.ProductsBlockModel = base.BlockModel.extend({
_selectedProducts: [],
_availableProducts: [],
_transformedProducts: new (App.getBlockTypeModel('container'))(),
}, App.getConfig().get('blockDefaults.posts'));
}, App.getConfig().get('blockDefaults.products'));
},
relations: function relations() {
return {
@ -107,7 +107,6 @@ Module.ProductsBlockModel = base.BlockModel.extend({
fetchAvailableProducts: function fetchAvailableProducts() {
var that = this;
this.set('offset', 0);
this.set('contentType', 'product');
CommunicationComponent.getPosts(this.toJSON()).done(function getPostsDone(products) {
that.get('_availableProducts').reset(products);
that.get('_selectedProducts').reset(); // Empty out the collection

View File

@ -1331,6 +1331,62 @@
backgroundColor: '#ffffff',
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: {
iconSet: 'default',
styles: {