fixed #7, javascript filter for pongo2 with context in this variable
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Sebastian Frank
2019-02-28 18:36:36 +01:00
parent 9e2f16dde9
commit 079534ab71
9 changed files with 102 additions and 6 deletions

View File

@@ -4,8 +4,8 @@
{{ Body }}
{% for e in fnRequest("https://cockpit.basiscms.de/api/collections/get/mark2webBlog?filter[published]=true&sort[date]=-1&limit=1").entries %}
<h2>
<small>{{ e.date }}</small>
{{ e.title }}
<div class="datum">{{ e.date|datum }}</div>
</h2>
{{ e.teaser|markdown }}
{% if e.body %}
@@ -21,8 +21,8 @@
{% endcomment %}
{% for e in fnRequest("https://cockpit.basiscms.de/api/collections/get/mark2webBlog?filter[published]=true&sort[date]=-1&skip=1&limit=100").entries %}
<h2>
<small>{{ e.date }}</small>
{{ e.title }}
<div class="datum">{{ e.date|datum }}</div>
</h2>
{{ e.teaser|markdown }}
{% if e.body %}

View File

@@ -2,8 +2,8 @@
{% block part0 %}
<h1>
<small>{{ Data.details.date }}</small>
{{ Data.details.title }}
<div class="datum">{{ Data.details.date|datum }}</div>
</h1>
{{ Data.details.teaser|markdown }}
{% endblock part0 %}

View File

@@ -0,0 +1,13 @@
function datum(str, param) {
if (!param) {
param = "$3.$2.$1";
}
/*
this.context.Meta.Title ist hier z.B. möglich
*/
return str.replace(/^([0-9]+)[^0-9]+([0-9]+)[^0-9]+([0-9]+).*/, param)
}
datum;