REFACTOR Handling a dedicated template part for index panel
This commit is contained in:
parent
15619b08a2
commit
5c8409c10b
|
|
@ -29,37 +29,7 @@
|
|||
<input type="text" placeholder="Rechercher">
|
||||
</div>
|
||||
|
||||
<div class="index-panel">
|
||||
<div class="index-panel__header">
|
||||
<button class="focus" data-index="sommaire" aria-selected="true" aria-controls="sommaire-index">
|
||||
Résumé
|
||||
</button>
|
||||
<button class="focus" data-index="footnotes" aria-selected="false" aria-controls="footnotes-index">
|
||||
Notes de bas de page
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="index-panel__content">
|
||||
<ul data-index="sommaire" class="sommaire-index" aria-hidden="false">
|
||||
<?php
|
||||
$sommaire = build_sommaire_from_content(get_the_ID());
|
||||
|
||||
foreach ($sommaire as $chapter) {
|
||||
echo '<li><a href="#' . $chapter['anchor'] . '">' . $chapter['title'] . '</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<ul id="footnotes-index" data-index="footnotes" class="footnotes-index" aria-hidden="true">
|
||||
<?php
|
||||
$footnotes = build_footnotes_index_from_content(get_the_content());
|
||||
?>
|
||||
|
||||
<?php foreach ($footnotes as $footnote) : ?>
|
||||
<li><a href="#footnote-<?php echo $footnote['anchorID']; ?>" class="footnote-reference-item"><?php echo $footnote['content']; ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php get_template_part('template-parts/articles/index-panel'); ?>
|
||||
</aside>
|
||||
|
||||
<div class="content-area">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user