add article + a venir
This commit is contained in:
@ -21,7 +21,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="body-wrapper" class="section blog-listing">
|
||||
<section class="body-wrapper">
|
||||
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
|
||||
{% include 'partials/breadcrumbs.html.twig' %}
|
||||
{% endif %}
|
||||
|
50
user/themes/lecampus/templates/articles.html.twig
Normal file
50
user/themes/lecampus/templates/articles.html.twig
Normal file
@ -0,0 +1,50 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
{% set blog_image = page.media.images[page.header.hero_image] ?: page.media.images|first %}
|
||||
{% set collection = page.collection() %}
|
||||
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
|
||||
{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
|
||||
{% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true) %}
|
||||
{% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}
|
||||
|
||||
{% block hero %}
|
||||
{% include 'partials/hero.html.twig' with {id: 'blog-hero', content: page.content, hero_image: blog_image} %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
<section class="header-wrapper">
|
||||
<div class="title">
|
||||
<h1>{{page.title}}</h1>
|
||||
</div>
|
||||
<div class="cat">
|
||||
{% include 'partials/taxonomylist.html.twig' with {base_url: my_url, taxonomy: 'category'} %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="body-wrapper articles-listing">
|
||||
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
|
||||
{% include 'partials/breadcrumbs.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
{% embed 'partials/layout.html.twig' with {blog: page} %}
|
||||
|
||||
{% block item %}
|
||||
|
||||
{% for child in page.collection().order('publish_date','desc') %}
|
||||
{% include 'partials/articles-list.html.twig' with {blog: page, page: child} %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
</section>
|
||||
|
||||
<div class="paginations">
|
||||
{% if config.plugins.pagination.enabled and collection.params.pagination %}
|
||||
{% include 'partials/pagination.html.twig' with {'base_url':page.url, 'pagination':collection.params.pagination} %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block newsletter %}
|
||||
{% include 'partials/newsletters.html.twig' %}
|
||||
{% endblock %}
|
55
user/themes/lecampus/templates/item-article.html.twig
Normal file
55
user/themes/lecampus/templates/item-article.html.twig
Normal file
@ -0,0 +1,55 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
|
||||
{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
|
||||
{% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true) %}
|
||||
{% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}
|
||||
{% set hero_image_name = page.header.hero_image %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@type": "Article",
|
||||
"headline": "{{page.title}}",
|
||||
"alternativeHeadline": "{{page.summary}}",
|
||||
"image": "http://example.com/image.jpg",
|
||||
"author": "",
|
||||
"award": "{{page.title}}",
|
||||
"editor": "Le Campus",
|
||||
"genre": "{{page.title}}",
|
||||
"keywords": " le_campus_valdedrome ",
|
||||
"wordcount": "1120",
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": "Le Campus",
|
||||
"logo": {
|
||||
"@type": "ImageObject",
|
||||
"url": "/user/themes/lecampus/images/logo_lecampus.svg"
|
||||
}
|
||||
},
|
||||
"url": "{{uri.base}}",
|
||||
"datePublished": "2015-09-20",
|
||||
"dateCreated": "2015-09-20",
|
||||
"dateModified": "2015-09-20",
|
||||
"description": "We love to do stuff to help people and stuff",
|
||||
"articleBody": "You can paste your entire post in here, and yes it can get really really long."
|
||||
}
|
||||
</script>
|
||||
|
||||
{% block item %}
|
||||
{% if page.parent.template == "articles" %}
|
||||
{% include 'partials/article-item.html.twig' %}
|
||||
{% else %}
|
||||
{% include 'partials/blog-item.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block newsletter %}
|
||||
{% include 'partials/newsletters.html.twig' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block devis %}
|
||||
{% include 'partials/devis.html.twig' %}
|
||||
{% endblock %}
|
@ -37,8 +37,13 @@
|
||||
</script>
|
||||
|
||||
{% block item %}
|
||||
{% if page.parent.template == "articles" %}
|
||||
{% include 'partials/article-item.html.twig' %}
|
||||
{% else %}
|
||||
{% include 'partials/blog-item.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block newsletter %}
|
||||
|
@ -0,0 +1,78 @@
|
||||
<script type='application/ld+json'>
|
||||
{
|
||||
"@type": "Articles",
|
||||
"name": "article",
|
||||
"url": "{{uri.base}}",
|
||||
"description": "{{page.header.metadata.description}}",
|
||||
"startDate": "{{page.header.date_begin}}",
|
||||
"endDate": "{{page.header.date_end}}",
|
||||
"location": {
|
||||
"@type": "Place",
|
||||
"name": "{{page.title}}",
|
||||
"address": {
|
||||
"@type": "PostalAddress",
|
||||
"streetAddress": "Place Michel Paulus,Ecosite du Val de Drôme",
|
||||
"addressLocality": "Eurre",
|
||||
"addressRegion": "Val de Drôme",
|
||||
"postalCode": "26400",
|
||||
"addressCountry": "France"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{% set image = page.media.images|first %}
|
||||
<section class="item-wrapper">
|
||||
<section class="header-wrapper">
|
||||
<div class="title-wrapper">
|
||||
<div class="back">
|
||||
<a href="{{page.parent.url}}">Retour</a>
|
||||
</div>
|
||||
<div class="title">
|
||||
<h1>{{page.title}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-wrapper">
|
||||
<div class="date">
|
||||
Publié {% include 'partials/blog/date.html.twig' %} |
|
||||
{% if page.taxonomy.category %}
|
||||
{% for category in page.taxonomy.category %}
|
||||
<span class="cat">
|
||||
{{ category }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="reso">
|
||||
<!-- Your share button code -->
|
||||
<div>
|
||||
<a href="//www.facebook.com/sharer/sharer.php?u={{uri.route(true, true)}}" class="sharebox" target="_blank" rel =" noopener " onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=700');return false;">
|
||||
Partager
|
||||
<img src="/user/themes/lecampus/images/fb_black.svg" alt="facebook">
|
||||
</a>
|
||||
</div>
|
||||
<a target="_blank" rel =" noopener " title="Twitter" href="https://twitter.com/share?url={{uri.route(true, true)}}" rel="nofollow" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=700');return false;">
|
||||
Partager
|
||||
<img src="/user/themes/lecampus/images/twitter.svg" alt="Twitter">
|
||||
</a>
|
||||
<a target="_blank" rel =" noopener " href=" http://www.linkedin.com/shareArticle?mini=true&url={{uri.route(true, true)}}" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=700');return false;">
|
||||
Partager
|
||||
<img src="/user/themes/lecampus/images/in_black.svg" alt="linkedin" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="body-wrapper">
|
||||
<div class="card-image">
|
||||
{% for images in page.media.images|slice(0, 1) %}
|
||||
{{images.html('', page.title )}}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="txt">
|
||||
{{ page.content|raw }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
@ -0,0 +1,41 @@
|
||||
{% set image = page.media.images|first %}
|
||||
<div class="card">
|
||||
<a href="{{ page.url }}">
|
||||
|
||||
{% if image %}
|
||||
<div class="card-image">
|
||||
{{ image.derivatives(300,700,200).sizes('(max-width:26em) 100vw, 50vw').html('','articles') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="wrapper-content">
|
||||
<div class="card-title">
|
||||
{% include 'partials/blog/title.html.twig' with {title_level: 'h5'} %}
|
||||
</div>
|
||||
<div class="wrapper-info">
|
||||
<div class="date">
|
||||
Publié {% include 'partials/blog/date.html.twig' %} |
|
||||
</div>
|
||||
{% if page.taxonomy.category %}
|
||||
{% for category in page.taxonomy.category %}
|
||||
<span class="cat">
|
||||
{{ category }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card-content">
|
||||
{% if page.summary != page.content %}
|
||||
{{ page.summary(500) }}
|
||||
{% else %}
|
||||
{{ page.content|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="readmore">
|
||||
Lire l'article
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
@ -71,9 +71,10 @@
|
||||
<header>
|
||||
<nav>
|
||||
<div class="navTrigger">
|
||||
<i></i><i></i><i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="logo">
|
||||
<a href="/"><img alt="le_campus_biovallee" src="/user/themes/lecampus/images/logo_lecampus.svg" alt="logo_lecampus"></a>
|
||||
</div>
|
||||
|
@ -13,7 +13,9 @@
|
||||
{% include 'partials/blog/title.html.twig' with {title_level: 'h5'} %}
|
||||
</div>
|
||||
<div class="card-subtitle text-gray">
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
<div class="date">
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
@ -1,31 +1,44 @@
|
||||
<div class="date">
|
||||
<span class="dt">
|
||||
{% set mois_begin = 'MONTHS_OF_THE_YEAR'|ta(page.header.date|date('n') - 1) %}
|
||||
{% set mois_end = 'MONTHS_OF_THE_YEAR'|ta(page.header.date_end|date('n') - 1) %}
|
||||
{% set mois_begin = 'MONTHS_OF_THE_YEAR'|ta(page.header.publish_date|date('n') - 1) %}
|
||||
{% set mois_end = 'MONTHS_OF_THE_YEAR'|ta(page.header.date_end|date('n') - 1) %}
|
||||
|
||||
{% if not page.header.date_end %}
|
||||
Le
|
||||
<time class="dt-begin" datetime="{{ page.header.date|date("c") }}">
|
||||
{{ page.header.date|date('d') }}
|
||||
{{mois_begin}}
|
||||
{{ page.header.date|date('Y') }}
|
||||
à
|
||||
{{ page.header.date|date('G', "Europe/Paris") }}h{{ page.header.date|date('i', "Europe/Paris") }}
|
||||
</time>
|
||||
|
||||
{% if page.parent.template == "articles" %}
|
||||
Le
|
||||
<time class="dt-begin" datetime="{{ page.header.date|date("c") }}">
|
||||
{{ page.header.publish_date|date('d') }}
|
||||
{{mois_begin}}
|
||||
{{ page.header.publish_date|date('Y') }}
|
||||
à
|
||||
{{ page.header.publish_date|date('G', "Europe/Paris") }}h{{ page.header.publish_date|date('i', "Europe/Paris") }}
|
||||
</time>
|
||||
|
||||
{% else %}
|
||||
|
||||
Le
|
||||
<time class="dt-begin" datetime="{{ page.header.date|date("c") }}">
|
||||
{{ page.header.date|date('d') }}
|
||||
{{mois_begin}}
|
||||
{{ page.header.date|date('Y') }}
|
||||
à
|
||||
{{ page.header.date|date('G', "Europe/Paris") }}h{{ page.header.date|date('i', "Europe/Paris") }}
|
||||
</time>
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if page.header.date_end %}
|
||||
Du
|
||||
<time class="dt-begin" datetime="{{ page.header.date|date("c") }}">
|
||||
{{ page.header.date|date('d') }}
|
||||
{{mois_begin}}
|
||||
{{mois_begin}}
|
||||
{{ page.header.date|date('Y') }}
|
||||
</time>
|
||||
au
|
||||
<time class="dt-end" datetime="{{ page.header.date_end|date("c") }}">
|
||||
{{ page.header.date_end|date('d') }}
|
||||
{{mois_end}}
|
||||
{{mois_end}}
|
||||
{{ page.header.date_end|date('Y') }}
|
||||
</time>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -1,11 +1,11 @@
|
||||
{% if page.taxonomy.tag %}
|
||||
{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
|
||||
{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
|
||||
|
||||
{% import _self as macro %}
|
||||
{% import _self as macro %}
|
||||
|
||||
{% for tag in page.taxonomy.tag %}
|
||||
<span class="tags {{ macro.pageLinkName(tag) }}">
|
||||
<a class="label">{{ tag }}</a>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% for tag in page.taxonomy.tag %}
|
||||
<span class="tags {{ macro.pageLinkName(tag) }}">
|
||||
<a class="label">{{ tag }}</a>
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
@ -44,7 +44,9 @@
|
||||
|
||||
<div class="card-body">
|
||||
<div class="card-title">
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
<div class="date">
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
</div>
|
||||
{% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -15,7 +15,9 @@
|
||||
{% endif %}
|
||||
<div class="card-body">
|
||||
<div class="card-title">
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
<div class="date">
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
</div>
|
||||
{% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
|
||||
</div>
|
||||
<div class="card-summary">
|
||||
|
34
user/themes/lecampus/templates/partials/pagination.html.twig
Normal file
34
user/themes/lecampus/templates/partials/pagination.html.twig
Normal file
@ -0,0 +1,34 @@
|
||||
{% set pagination = pagination|default(page.collection.params.pagination) %}
|
||||
{% set base_url = base_url|default(page.url) %}
|
||||
|
||||
{% if pagination|length > 1 %}
|
||||
|
||||
<ul class="pagination">
|
||||
{% if pagination.hasPrev %}
|
||||
{% set url = (base_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %}
|
||||
<li><a rel="prev" href="{{ url }}">Page précédente</a></li>
|
||||
{% else %}
|
||||
<li><span>Page précédente</span></li>
|
||||
{% endif %}
|
||||
|
||||
{% for paginate in pagination %}
|
||||
|
||||
{% if paginate.isCurrent %}
|
||||
<li><span class="active">{{ paginate.number }}</span></li>
|
||||
{% elseif paginate.isInDelta %}
|
||||
{% set url = (base_url ~ pagination.params ~ paginate.url)|replace({'//':'/'}) %}
|
||||
<li><a href="{{ url }}">{{ paginate.number }}</a></li>
|
||||
{% elseif paginate.isDeltaBorder %}
|
||||
<li class="gap"><span>…</span></li>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
{% if pagination.hasNext %}
|
||||
{% set url = (base_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %}
|
||||
<li><a rel="next" href="{{ url }}">Page suivante</a></li>
|
||||
{% else %}
|
||||
<li><span>Page suivante</span></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
{% endif %}
|
@ -1,4 +1,3 @@
|
||||
|
||||
{% set options = { items: {'@page.children': '/agenda'} } %}
|
||||
{% set h2 = h2 ?: 'h2' %}
|
||||
{% set h3 = h3 ?: 'h3' %}
|
||||
@ -10,10 +9,14 @@
|
||||
{% set this_month = "now"|date('M') %}
|
||||
{% set this_day = "now"|date('d') %}
|
||||
|
||||
{% for p in page.collection(options).dateRange( this_day ~ this_month ~ this_year, '12/31/' ~ this_year).slice(0, 3).order('date', 'asc') %}
|
||||
{% set next_year = "+1 year"|date('Y')%}
|
||||
|
||||
{% for p in page.collection(options).dateRange( this_day ~ this_month ~ this_year, '12/31/' ~ next_year).slice(0, 3).order('date', 'asc') %}
|
||||
<div class="side-agenda">
|
||||
<a href="{{p.url}}">
|
||||
{% include 'partials/blog/date.html.twig' with {page: p} %}
|
||||
<div class="date">
|
||||
{% include 'partials/blog/date.html.twig' with {page: p} %}
|
||||
</div>
|
||||
<{{h3}}>{{p.title}}</{{h3}}>
|
||||
{{p.summary(70)}}
|
||||
</a>
|
||||
@ -22,5 +25,4 @@
|
||||
<div class="side-all-agenda">
|
||||
<a href="/agenda">voir tout l'agenda</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -1,33 +1,48 @@
|
||||
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
|
||||
{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
|
||||
|
||||
{% import _self as macro %}
|
||||
|
||||
{% import _self as macro %}
|
||||
{% if taxlist %}
|
||||
<div class="btn-toolbar filters">
|
||||
<div data-toggle="buttons" class="btn-group">
|
||||
<label class="btn btn-default tous" data-filter="">
|
||||
<input type="radio" name="options">
|
||||
Tous
|
||||
{% set active = uri.param(taxonomy) == tax? 'active' : '' %}
|
||||
<label class="{{active}} btn btn-default tous" data-filter="">
|
||||
|
||||
{% if page.template == "articles" %}
|
||||
<a class="{{ active }}" href="{{ page.url }}">Tous</a>
|
||||
{% else %}
|
||||
<input type="radio" name="options">
|
||||
Tous
|
||||
{% endif %}
|
||||
</label>
|
||||
|
||||
{% for tax,value in taxlist[taxonomy] %}
|
||||
{% set active = uri.param(taxonomy) == tax? 'active' : '' %}
|
||||
{% set label_class = uri.param(taxonomy) == tax ? 'label-primary' : 'label-secondary' %}
|
||||
<label class="btn btn-default {{ macro.pageLinkName(tax) }}" data-filter="{{tax}}">
|
||||
<input type="radio" name="options" >
|
||||
{{tax}}
|
||||
<label class="{{ active }} btn btn-default {{ macro.pageLinkName(tax) }}" data-filter="{{tax}}">
|
||||
{% if page.template == "articles" %}
|
||||
<a class="{{ active }}" href="{{ page.url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }}</a>
|
||||
{% else %}
|
||||
<input type="radio" name="options" >
|
||||
{{tax}}
|
||||
{% endif %}
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="btn-group ">
|
||||
<label class="btn-default archive">
|
||||
{% if page.title == 'Archive' %}
|
||||
<a href="/{{page.parent.title|lower}}">{{page.parent.title}}</a>
|
||||
{% else %}
|
||||
{% if page.template == 'archive' %}
|
||||
<div class="btn-group ">
|
||||
<label class="btn-default archive">
|
||||
<a href="/{{page.parent.title|lower}}">{{page.parent.title}}</a>
|
||||
</label>
|
||||
</div>
|
||||
{% elseif page.template == 'calendrier' %}
|
||||
<div class="btn-group ">
|
||||
<label class="btn-default archive">
|
||||
<a href="{{page.url}}/archive">Archive</a>
|
||||
{% endif %}
|
||||
</label>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user