Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid showing SEO/metadata description on vocab home page #1676

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions model/Vocabulary.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,23 @@ public function getInfo($lang = null)
foreach ($conceptscheme->properties() as $prop) {
foreach ($conceptscheme->allLiterals($prop, $lang) as $val) {
$prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop;
$ret[$prop][$val->getValue()] = $val;
if ($prop === 'dc:description') {
$ret[$prop] = [$val->getValue() => $val]; // override description from vocabulary config
} else {
$ret[$prop][$val->getValue()] = $val;
}
}
if (!isset($ret[$prop]) || sizeof($ret[$prop]) == 0) { // not found with language tag
foreach ($conceptscheme->allLiterals($prop, null) as $val) {
$prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop;
if ($val->getValue() instanceof DateTime) {
$val = Punic\Calendar::formatDate($val->getValue(), 'full', $lang) . ' ' . Punic\Calendar::format($val->getValue(), 'HH:mm:ss', $lang);
}
$ret[$prop][] = $val;
if ($prop === 'dc:description') {
$ret[$prop] = [$val->getValue() => $val]; // override description from vocabulary config
} else {
$ret[$prop][] = $val;
}
}
}
foreach ($conceptscheme->allResources($prop) as $val) {
Expand Down
Loading