I changed the name of this topic , because the question is different now :
Thank you for your quick reply , however I had to give up on this , I was making changes into the core and discovered how time consuming and risking creating new bugs without knowing .
I reset everything back to original and made the changes using php code reading the $context['linktree'] then create JSON script dynamically to append BreadcrumbList tag for every page.
The code is in a single php file which required_once before the end of the file index.template.php , and its done.
Answering your question ,This can be used for any ElkArte forum , not only my site , but wasn't able to make it addon although its very simple and short - this is what happens for newbies when not finding your invisible documentation&examples
<?php
$NNN = <<<EOT
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement":
[
EOT;
echo $NNN;
$icount = count($context['linktree'] );
foreach ($context['linktree'] as $pos => $tree)
{
$name = $tree['name'];
$url= $tree['url'];
$item = " {
\"@type\": \"ListItem\",
\"position\": $pos,
\"item\":
{
\"@id\": \"$url\",
\"name\": \"$name \"
}
}";
echo $item;
if($pos < ($icount-1)) echo ",";
echo "\n";
}
$NNN = <<<EOT
]
}
</script>
EOT;
echo $NNN;
$NNN = <<<EOT
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "http://elkarte.net/community/index.php",
"potentialAction": {
"@type": "SearchAction",
"target": "http://elkarte.net/community/index.php?action=search;sa=results&search={search_keywords}",
"query-input": "required name=search_keywords"
}
}
</script>
EOT;
//json for homepage only , need fix
if($icount==1)
echo $NNN;
?>
I still have 3 more tags to append to the "topic display page" , so, which template file should I work on for that ?
also what is the easiest way to check for homepage presence to execute something only for it ?
Thanks