-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/abecms/abecms
- Loading branch information
Showing
27 changed files
with
364 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Abe block each | ||
|
||
> group elements | ||
###Basic example | ||
|
||
```html | ||
{{#each myblock}} | ||
<div> | ||
{{abe type='text' key='myblock.text' desc='text item of the block'}} | ||
</div> | ||
<img src="{{abe type='image' key='myblock.image' desc='image item of the block'}}" /> | ||
|
||
<button> | ||
{{abe type='text' key='button' desc='this button label is not part of this each statement'}} | ||
</button> | ||
{{/each}} | ||
``` | ||
|
||
*Result :* | ||
|
||
![Each](../assets/abe-each.png) | ||
|
||
We have now a block each myblock that can be repeated as many time as we want with the '+' icon | ||
|
||
Notice that since the <button> doesn't have ```key='myblock.button'``` but instead ```key='button'``` it won't be part of the each statement | ||
|
||
When the input button will have some content, any item each from myblock will have the same text for the element button | ||
|
||
Use case : | ||
|
||
Each statement are usefull for exemple for Carousel, list of element with un unknow number of item etc ... | ||
|
||
|
||
###Grouped element | ||
|
||
Sometime we want to have a group of element but not inside of each statement because this group won't be repeated. | ||
|
||
To do that, just use the same syntaxe as each block element but without wrapping them inside {{#each}} ... {{/each}} tag | ||
|
||
```html | ||
<div> | ||
{{abe type='text' key='myblock.text' groupdesc='description for my group' desc='text item of the block'}} | ||
</div> | ||
<img src="{{abe type='image' key='myblock.image' groupdesc='description for my group' desc='image item of the block'}}" /> | ||
``` | ||
|
||
Notice groupdesc attribut that is use to write a description for our single grouped element | ||
|
||
*Result :* | ||
|
||
![SIngleEach](../assets/single-group.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {coreUtils} from '../../../' | ||
|
||
export default function cleanTab(obj) { | ||
obj = coreUtils.text.replaceUnwantedChar(obj.replace(/ |&/g, '_')) | ||
obj = coreUtils.text.replaceUnwantedChar(obj.replace(/ |&/g, '_'), {'\\(': '', '\\)': '', '\\[': '', '\\]': ''}) | ||
|
||
return obj | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var tweets = twitterFetcher.fetch({ | ||
// "profile": {"screenName": 'rihanna'}, | ||
"profile": {"screenName": 'abe_cms'}, | ||
"domId": 'tweets-slider', | ||
"maxTweets": 10, | ||
"enableLinks": true, | ||
"showUser": true, | ||
"showTime": true, | ||
"showImages": false, | ||
"lang": 'en', | ||
"showRetweet": false, | ||
"customCallback": function (tweets) { | ||
var x = tweets.length; | ||
var n = 0; | ||
var element = document.getElementById('tweets-slider'); | ||
var html = '<div class="swiper-wrapper">'; | ||
while(n < x) { | ||
html += '<div class="swiper-slide">' + | ||
tweets[n] | ||
.replace(/>Posted on /, '>') | ||
.replace(/<p class=\"interact\">(.*)/, '') + | ||
'</div>'; | ||
n++; | ||
} | ||
html += '</div><div class="swiper-pagination"></div>'; | ||
element.innerHTML = html; | ||
|
||
var swiper = new Swiper('.swiper-container', { | ||
pagination: '.swiper-pagination', | ||
slidesPerView: 3, | ||
paginationClickable: true, | ||
spaceBetween: 30 | ||
}); | ||
} | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.