hadnling block no-answers & help-homegrade
This commit is contained in:
parent
050f7373b8
commit
c60f9674b2
|
|
@ -193,6 +193,20 @@ function build_page_chapter_index($blocks)
|
||||||
'title' => __("Vocabulaire", "homegrade-theme__texte-fonctionnel") . " " . get_the_terms(get_the_ID(), "thematiques")[0]->name,
|
'title' => __("Vocabulaire", "homegrade-theme__texte-fonctionnel") . " " . get_the_terms(get_the_ID(), "thematiques")[0]->name,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
if ($block['blockName'] == 'homegrade-content-blocks/help-homegrade') {
|
||||||
|
array_push($chapterBlockIndex, [
|
||||||
|
'block-type' => $block['blockName'],
|
||||||
|
'anchor' => "#homegrade-vous-aide",
|
||||||
|
'title' => __("Homegrade vous aide", "homegrade-blocks__texte-fonctionnel"),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
if ($block['blockName'] == 'homegrade-content-blocks/no-answers') {
|
||||||
|
array_push($chapterBlockIndex, [
|
||||||
|
'block-type' => $block['blockName'],
|
||||||
|
'anchor' => "#pas-de-reponses",
|
||||||
|
'title' => __("Pas de réponse ?", "homegrade-blocks__texte-fonctionnel"),
|
||||||
|
]);
|
||||||
|
}
|
||||||
if ($block['blockName'] == 'homegrade-content-blocks/plus-loin') {
|
if ($block['blockName'] == 'homegrade-content-blocks/plus-loin') {
|
||||||
array_push($chapterBlockIndex, [
|
array_push($chapterBlockIndex, [
|
||||||
'block-type' => $block['blockName'],
|
'block-type' => $block['blockName'],
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,15 @@ export default function singleConseil() {
|
||||||
const chapitresThematiques = document.querySelectorAll('.homegrade-blocks-chapitre-thematique');
|
const chapitresThematiques = document.querySelectorAll('.homegrade-blocks-chapitre-thematique');
|
||||||
const vocabulaireSummaryBlock = document.querySelector('.homegrade-blocks-vocabulaire-summary');
|
const vocabulaireSummaryBlock = document.querySelector('.homegrade-blocks-vocabulaire-summary');
|
||||||
const plusLoinBlock = document.querySelector('#aller-plus-loin');
|
const plusLoinBlock = document.querySelector('#aller-plus-loin');
|
||||||
|
const helpHomegradeBlock = document.querySelector('#homegrade-vous-aide');
|
||||||
|
const noAnswers = document.querySelector('#pas-de-reponses');
|
||||||
|
|
||||||
let allBlocks = [];
|
let allBlocks = [];
|
||||||
|
|
||||||
if (vocabulaireSummaryBlock) allBlocks.push(vocabulaireSummaryBlock);
|
if (vocabulaireSummaryBlock) allBlocks.push(vocabulaireSummaryBlock);
|
||||||
if (plusLoinBlock) allBlocks.push(plusLoinBlock);
|
if (plusLoinBlock) allBlocks.push(plusLoinBlock);
|
||||||
|
if (helpHomegradeBlock) allBlocks.push(helpHomegradeBlock);
|
||||||
|
if (noAnswers) allBlocks.push(noAnswers);
|
||||||
if (questionsContainerBlocks.length > 0)
|
if (questionsContainerBlocks.length > 0)
|
||||||
allBlocks = [...allBlocks, ...questionsContainerBlocks];
|
allBlocks = [...allBlocks, ...questionsContainerBlocks];
|
||||||
if (chapitresThematiques.length > 0) allBlocks = [...allBlocks, ...chapitresThematiques];
|
if (chapitresThematiques.length > 0) allBlocks = [...allBlocks, ...chapitresThematiques];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user