I upgraded my site to v8 and this is still working
I can confirm this. Tried it with different themes, got the same result. I have reported this as a bug:
https://www.concrete5.org/developers/bugs/8-0-0/site-name-does-not-r...
https://www.concrete5.org/developers/bugs/8-0-0/site-name-does-not-r...
that is really weird because even in the controller for the register single page, it is being used in the email sent
$mh->addParameter('site', tc('SiteName', $config->get('concrete.site')));
This isn't a bug, the code just changed. Take a look in the header_required file how they pull the site config:
https://github.com/concrete5/concrete5/blob/develop/concrete/element...
It's not Config::get anymore. Try this:
If that didn't work, I will paste the correct code tomorrow. I'm not on my desktop, so quite limited.
https://github.com/concrete5/concrete5/blob/develop/concrete/element...
It's not Config::get anymore. Try this:
$site = Core::make('site')->getSite(); $config = $site->getConfigRepository(); echo $config->get('site');
If that didn't work, I will paste the correct code tomorrow. I'm not on my desktop, so quite limited.
thanks but that doesnt work at least in my attempt.
try
I think ramonleenders' code would work like this
\Core::make('site')->getSite()->getSiteName();
I think ramonleenders' code would work like this
$site = Core::make('site')->getSite(); $config = $site->getConfigRepository(); echo $config->get('name');
This does work for me:
The old code is going to be a big problem, because many of the themes use this, which will break a lot of sites that are using it, if they upgrade to 8 and newer.
$site = Core::make('site')->getSite(); $config = $site->getConfigRepository(); echo $config->get('name');
The old code is going to be a big problem, because many of the themes use this, which will break a lot of sites that are using it, if they upgrade to 8 and newer.
This may or may not be the preferred method but should work...
<?php echo Config::get('site.sites.default.name'); ?>
Code above worked for me this afternoon, thanks.
Quick workaround to cover 5.7 and 5.8. Needs a bit of work to target versions (Shows two links in source code).
Quick workaround to cover 5.7 and 5.8. Needs a bit of work to target versions (Shows two links in source code).
Thanks to all. Looks like we have a winner. Until v8.0.1 at least.
It fails on the first call in 8.0 but the second picks it up. Time to update themes.
like I mentioned, it shows two home links in source code. Visitors/users don't see them but search engines will. Great for SEO?
8.0.1 fixes this