Compare commits
6 Commits
0e733e5988
...
2f495878c3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f495878c3 | ||
|
|
86fd29864c | ||
|
|
435eb4f218 | ||
|
|
f37f9cca3a | ||
|
|
288fb8e733 | ||
|
|
3fbd4a4ac6 |
|
|
@ -4,6 +4,8 @@
|
|||
@apply container mx-auto grid grid-cols-12 gap-12 py-12 items-start;
|
||||
grid-template-columns: 1fr 2fr;
|
||||
&[data-active-tab='article'] {
|
||||
#article-authors,
|
||||
.article-informations,
|
||||
.sidebar .search-field,
|
||||
.table-matieres {
|
||||
@apply hidden;
|
||||
|
|
@ -18,6 +20,7 @@
|
|||
}
|
||||
}
|
||||
&[data-active-tab='references'] {
|
||||
#article-authors,
|
||||
.article-informations,
|
||||
.article-content,
|
||||
.sidebar .index-panel,
|
||||
|
|
@ -26,6 +29,7 @@
|
|||
}
|
||||
}
|
||||
&[data-active-tab='table-of-contents'] {
|
||||
#article-authors,
|
||||
.article-informations,
|
||||
.article-content,
|
||||
.sidebar .index-panel {
|
||||
|
|
@ -33,6 +37,7 @@
|
|||
}
|
||||
}
|
||||
&[data-active-tab='informations'] {
|
||||
#article-authors,
|
||||
.article-content,
|
||||
.table-matieres,
|
||||
.sidebar .index-panel {
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
get_header();
|
||||
$revueID = get_field('related_revue', get_the_ID());
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="page--single-articles" data-revue-id="<?php echo get_the_ID(); ?>">
|
||||
<?php if (have_posts()) : ?>
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<?php get_template_part('template-parts/post-header'); ?>
|
||||
|
||||
<?php get_template_part('template-parts/articles/article-toolbar'); ?>
|
||||
|
||||
<div class="content-wrapper" data-active-tab="article">
|
||||
<aside class="sidebar">
|
||||
<div class="search-field">
|
||||
|
|
@ -20,6 +20,10 @@ $revueID = get_field('related_revue', get_the_ID());
|
|||
</aside>
|
||||
|
||||
<div class="content-area">
|
||||
<?php get_template_part('template-parts/articles/article-authors', null, array(
|
||||
'postId' => get_the_ID()
|
||||
)); ?>
|
||||
|
||||
<?php get_template_part('template-parts/articles/article-informations', null, array(
|
||||
'revueID' => $revueID
|
||||
)); ?>
|
||||
|
|
@ -27,12 +31,14 @@ $revueID = get_field('related_revue', get_the_ID());
|
|||
<?php get_template_part('template-parts/revues/table-matiere-revue', null, array(
|
||||
'revueID' => $revueID
|
||||
)); ?>
|
||||
|
||||
<?php get_template_part('template-parts/articles/article-content', null, array(
|
||||
'ID' => get_the_ID()
|
||||
)); ?>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
16
template-parts/articles/article-authors.php
Normal file
16
template-parts/articles/article-authors.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div id="article-authors" class="article-authors">
|
||||
|
||||
<?php get_template_part('template-parts/authors/authors-list', null, array(
|
||||
'postId' => get_the_ID()
|
||||
)); ?>
|
||||
|
||||
<?php get_template_part('template-parts/authors/authors-last-publications', null, array(
|
||||
'postId' => get_the_ID()
|
||||
)); ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -4,17 +4,22 @@ $articleContent = get_the_content($articleID);
|
|||
$articleTitle = get_the_title($articleID);
|
||||
$citeReference = get_field('cite_reference', $articleID);
|
||||
$tags = get_the_terms($articleID, 'etiquettes');
|
||||
|
||||
?>
|
||||
|
||||
<article class="article-content">
|
||||
<ul class="article-tags-list">
|
||||
<?php foreach ($tags as $tag) : ?>
|
||||
<li class="article-tag">
|
||||
<?php echo $tag->name; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php if ($tags) : ?>
|
||||
<ul class="article-tags-list">
|
||||
<?php foreach ($tags as $tag) : ?>
|
||||
<li class="article-tag">
|
||||
<?php echo $tag->name; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php the_content(); ?>
|
||||
|
||||
<?php if ($citeReference) : ?>
|
||||
<p id="cite-reference">
|
||||
<?php echo $citeReference; ?>
|
||||
|
|
|
|||
33
template-parts/authors/authors-last-publications.php
Normal file
33
template-parts/authors/authors-last-publications.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
$postId = $args['postId'];
|
||||
$authors = [];
|
||||
$isArticle = is_singular('articles');
|
||||
|
||||
if ($isArticle) {
|
||||
$authors = get_field('authors', $postId);
|
||||
} else {
|
||||
$authors = getRevueAuthors($postId);
|
||||
}
|
||||
|
||||
|
||||
if (empty($authors)) return;
|
||||
|
||||
$authorsLastPosts = get_posts(array(
|
||||
'post_type' => $isArticle ? 'articles' : 'revues',
|
||||
'author' => $authors,
|
||||
'posts_per_page' => 6,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
));
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php foreach ($authorsLastPosts as $post) : ?>
|
||||
<?php get_template_part('template-parts/articles/card-article', null, array(
|
||||
'ID' => $post->ID,
|
||||
)); ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php wp_reset_postdata(); ?>
|
||||
32
template-parts/authors/authors-list.php
Normal file
32
template-parts/authors/authors-list.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
$postId = $args['postId'];
|
||||
$isArticle = is_singular('articles');
|
||||
$componentTitle = $isArticle ? 'Auteur·e·s de l\'article' : 'Auteur·e·s de la revue';
|
||||
$articleTitle = get_the_title($postId);
|
||||
$authors = [];
|
||||
|
||||
if ($isArticle) {
|
||||
$authors = get_field('authors', $postId);
|
||||
} else {
|
||||
$authors = getRevueAuthors($postId);
|
||||
}
|
||||
|
||||
if (empty($authors)) return;
|
||||
|
||||
|
||||
?>
|
||||
<section class="revue-authors-list">
|
||||
<h3 class="revue-authors-list__title"><?php echo $componentTitle; ?></h3>
|
||||
<?php if ($articleTitle) : ?>
|
||||
<p class="revue-authors-list__article-title"><?php echo $articleTitle; ?></p>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($authors as $authorID) : ?>
|
||||
<?php get_template_part(
|
||||
'template-parts/authors/card-author',
|
||||
null,
|
||||
array(
|
||||
'ID' => $authorID,
|
||||
)
|
||||
); ?>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?php
|
||||
$revueID = $args['revueID'];
|
||||
$authors = getRevueAuthors($revueID);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<section class="revue-authors-list">
|
||||
<h3 class="revue-authors-list__title">Auteur·e·s de la revue</h3>
|
||||
<?php foreach ($authors as $authorID) : ?>
|
||||
<?php get_template_part(
|
||||
'template-parts/authors/card-author',
|
||||
null,
|
||||
array(
|
||||
'ID' => $authorID,
|
||||
)
|
||||
); ?>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
Loading…
Reference in New Issue
Block a user