uses preg_replace on siteTitle string to build technicalDocument URL

This commit is contained in:
buttle 2021-09-06 18:57:04 +02:00
parent 1e2a2e40a6
commit 3164787d19
1 changed files with 3 additions and 2 deletions

View File

@ -101,8 +101,9 @@ class ArchiveSiteMeta extends AbstractBlockLayout
$site = null;
} else {
$site = $view->site;
//$tech_document_link = '<a href="'.$site->siteUrl().'/asset/'.$site->title().'.pdf'.'">Technical documentation</a>';
$tech_document_link = '<a href="/files/docs/'.$site->title().'.pdf'.'">Technical documentation</a>';
$site_title = $view->site->title();
$file_name = preg_replace( '/[^a-z0-9]+/', '-', strtolower($site_title) ).'.pdf';
$tech_document_link = '<a href="/files/docs/'.$file_name.'">Technical documentation</a>';
}
$archiveSiteHelper = $view->getHelperPluginManager()->get('archiveSiteMeta');
$collections = $archiveSiteHelper->getCollections();