collections as one navigation level

This commit is contained in:
Sebastian Frank
2019-03-10 16:02:53 +01:00
parent e3dfbcb591
commit 38820e6baf
6 changed files with 157 additions and 47 deletions

View File

@@ -1,9 +1,21 @@
This:
Collections:
- Name: blog1st
URL: https://mark2web.basiscms.de/api/collections/get/mark2webBlog?token=89ff216524093123bf7a0a10f7b273&filter[published]=true&sort[date]=-1&skip=0&limit=1
GoToTemplate: '{{ date|add:"-"|add:title|slugify }}'
EntriesJSON: '{{ fnRequest("https://mark2web.basiscms.de/api/collections/get/mark2webBlog?token=89ff216524093123bf7a0a10f7b273&filter[published]=true&sort[date]=-1&skip=0&limit=1").entries|json }}'
NavTemplate:
GoTo: '{{ date|add:"-"|add:title|slugify }}'
Navname: '{{ title }}'
Body: '{{ body }}'
Template: base_blog_details.html
DataKey: details
Hidden: true # hide from nav, but use this feature for rendering detail sites
- Name: blog1skip
URL: https://mark2web.basiscms.de/api/collections/get/mark2webBlog?token=89ff216524093123bf7a0a10f7b273&filter[published]=true&sort[date]=-1&skip=1&limit=100
GoToTemplate: '{{ date|add:"-"|add:title|slugify }}'
EntriesJSON: '{{ fnRequest("https://mark2web.basiscms.de/api/collections/get/mark2webBlog?token=89ff216524093123bf7a0a10f7b273&filter[published]=true&sort[date]=-1&skip=1&limit=100").entries|json }}'
NavTemplate:
GoTo: '{{ date|add:"-"|add:title|slugify }}'
Navname: '{{ title }}'
Body: '{{ body }}'
Template: base_blog_details.html
DataKey: details
Hidden: true

View File

@@ -2,7 +2,7 @@
{% block part0 %}
{{ Body }}
{% for e in NavElement.ColMap.blog1st.entries %}
{% for e in NavElement.ColMap.blog1st %}
<h2>
{{ e.title }}
<div class="datum">{{ e.date|datum }}</div>
@@ -10,7 +10,6 @@
{{ e.teaser|markdown }}
{% if e.body %}
<a href="{{ e.date|add:"-"|add:e.title|slugify }}" class="btn">mehr lesen &raquo;</a>
{{ fnRender("base_blog_details.html", e.date|add:"-"|add:e.title, e, "details", e.body) }}
{% endif %}
{% endfor %}
{% endblock part0 %}
@@ -19,7 +18,7 @@
{% comment %}
limit wird für skip in Query gebraucht
{% endcomment %}
{% for e in NavElement.ColMap.blog1skip.entries %}
{% for e in NavElement.ColMap.blog1skip %}
<h2>
{{ e.title }}
<div class="datum">{{ e.date|datum }}</div>
@@ -27,7 +26,6 @@
{{ e.teaser|markdown }}
{% if e.body %}
<a href="{{ e.date|add:"-"|add:e.title|slugify }}" class="btn">mehr lesen &raquo;</a>
{{ fnRender("base_blog_details.html", e.date|add:"-"|add:e.title, e, "details", e.body) }}
{% endif %}
{% endfor %}
{% endblock part1 %}