Page 1 of 2

Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Sun Mar 08, 2020 1:44 am
by bbyrdhouse
Hi,

So, I am in the process of building a custom theme and would like to take advantage of the Logo feature of Bludit.
However, I can not get it to work on any theme (free ones)

Steps to reproduce
1. Go to the Admin area and select General under Settings and then the last tab is "Logo"
2. Select a logo to upload and upload it
3. Save and refresh your website page and either no logo or the default logo (the Bludit logo)

What I expect to happen is that when you upload a logo that is appears in the designated area for the logo.

Here is the code I am using

Code: Select all

<?php
		$file = DOMAIN_UPLOADS_PROFILES.'admin.png';
		if( !file_exists(PATH_UPLOADS_PROFILES.'admin.png') ) {
		$file = DOMAIN_THEME.'img/logo.svg';
		}
		echo '<a href="'.$site->url().'" rel="home" class="navbar-brand"><img class="d-inline-block align-top"  src="'.$file.'" alt="'.$site->title().'"></a>';
?>
Can someone please point me to a theme that properly uses this feature?

Thanks
Gary

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Mon Mar 09, 2020 1:34 pm
by Edi
Adding a logo is a rather new feature. Therefore it's not possible with most of the themes.

The logo is renamed to BLUDIT.jpg or BLUDIT.png.

The path is https://mydomain.com/bl-content/uploads/BLUDIT.jpg or https://mydomain.com/bl-content/uploads/BLUDIT.png.

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Mon Mar 09, 2020 8:37 pm
by bbyrdhouse
Cool ... new feature! :)

But, is there a hook so that a theme developer like me can implement it into my theme?

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Mon Mar 09, 2020 11:34 pm
by Edi
bbyrdhouse wrote: Mon Mar 09, 2020 8:37 pm But, is there a hook so that a theme developer like me can implement it into my theme?
There is no need for a hook. You can use the given path

https://mydomain.com/bl-content/uploads/BLUDIT.jpg

or

https://mydomain.com/bl-content/uploads/BLUDIT.png

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Tue Mar 10, 2020 1:03 am
by bbyrdhouse
So, that looks like this then?

Code: Select all

<img class="d-inline-block align-top"  src="'.$site->url()./.$file.'" alt="'.$site->title().'">
			</a>'
			

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Tue Mar 10, 2020 1:18 am
by bbyrdhouse
When I upload an image using the Logo feature, nothing gets uploaded to that directory.

Image

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Tue Mar 10, 2020 1:23 am
by bbyrdhouse
I see ... it is uploading the logo.png, but it is changing the name of the logo.png to the Site title (including the spaces)
Image

Image

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Fri Mar 20, 2020 6:28 am
by stokesman
Not sure when it was introduced but I used the logo method in my theme:

Code: Select all

<img src="<?= $site->logo() ?>" alt="<?= $site->title() ?>" width="360">
I guess I found that browsing the source because I just rechecked and didn't find it in the docs. So then made a pull request to add mention of it in the docs.

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Fri Mar 20, 2020 1:07 pm
by bbyrdhouse
stokesman wrote: Fri Mar 20, 2020 6:28 am Not sure when it was introduced but I used the logo method in my theme:

Code: Select all

<img src="<?= $site->logo() ?>" alt="<?= $site->title() ?>" width="360">
I guess I found that browsing the source because I just rechecked and didn't find it in the docs. So then made a pull request to add mention of it in the docs.
Thank you for that information ... it is helpful :)


Have you noticed that when a user uploads a logo that it gets renamed to whatever the Site Name is ... therefore is your site title is "Gary's Big Blog" ... then your logo, when uploaded, gets changed to "Garys Big Blog.jpg" ... seems like it would make much more sense to simply rename the logo to "logo" or, don't rename it at all.

Re: Adding A Logo from Setting/General/Logo Does not work, for any theme

Posted: Sat Mar 21, 2020 12:12 am
by stokesman
I hadn't noted the renaming previously but, yes it does happen. Not sure why that is but I don't see any issue with it.