mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 02:46:46 -04:00
Don't print collection type if the type is in the name (i.e. 'Martian Series series')
This commit is contained in:
parent
abd506d5bb
commit
9e5654555f
1 changed files with 10 additions and 1 deletions
|
@ -53,7 +53,16 @@ try{
|
||||||
if($collectionObject !== null){
|
if($collectionObject !== null){
|
||||||
$collectionName = preg_replace('/^The /ius', '', $collectionObject->Name) ?? '';
|
$collectionName = preg_replace('/^The /ius', '', $collectionObject->Name) ?? '';
|
||||||
$collectionType = $collectionObject->Type ?? 'collection';
|
$collectionType = $collectionObject->Type ?? 'collection';
|
||||||
$pageTitle = 'Browse ebooks in the ' . Formatter::ToPlainText($collectionName) . ' ' . $collectionType;
|
|
||||||
|
# This is a kind of .endswith() test
|
||||||
|
if(substr_compare(mb_strtolower($collectionObject->Name), mb_strtolower($collectionObject->Type), -strlen(mb_strtolower($collectionObject->Type))) !== 0){
|
||||||
|
$collectionType = ' ' . $collectionType;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$collectionType = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$pageTitle = 'Browse ebooks in the ' . Formatter::ToPlainText($collectionName) . $collectionType;
|
||||||
$pageDescription = 'A list of ebooks in the ' . Formatter::ToPlainText($collectionName) . ' ' . $collectionType;
|
$pageDescription = 'A list of ebooks in the ' . Formatter::ToPlainText($collectionName) . ' ' . $collectionType;
|
||||||
$pageHeader = 'Ebooks in the ' . Formatter::ToPlainText($collectionName) . ' ' . $collectionType;
|
$pageHeader = 'Ebooks in the ' . Formatter::ToPlainText($collectionName) . ' ' . $collectionType;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue