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

bbyrdhouse
Ssr. Bludit
Posts: 16
Joined: Sun Mar 08, 2020 1:36 am

Sun Mar 08, 2020 1:44 am

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
User avatar
Edi
Site Admin
Posts: 1930
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Mon Mar 09, 2020 1:34 pm

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.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
bbyrdhouse
Ssr. Bludit
Posts: 16
Joined: Sun Mar 08, 2020 1:36 am

Mon Mar 09, 2020 8:37 pm

Cool ... new feature! :)

But, is there a hook so that a theme developer like me can implement it into my theme?
User avatar
Edi
Site Admin
Posts: 1930
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Mon Mar 09, 2020 11:34 pm

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
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
bbyrdhouse
Ssr. Bludit
Posts: 16
Joined: Sun Mar 08, 2020 1:36 am

Tue Mar 10, 2020 1:03 am

So, that looks like this then?

Code: Select all

<img class="d-inline-block align-top"  src="'.$site->url()./.$file.'" alt="'.$site->title().'">
			</a>'
			
bbyrdhouse
Ssr. Bludit
Posts: 16
Joined: Sun Mar 08, 2020 1:36 am

Tue Mar 10, 2020 1:18 am

When I upload an image using the Logo feature, nothing gets uploaded to that directory.

Image
bbyrdhouse
Ssr. Bludit
Posts: 16
Joined: Sun Mar 08, 2020 1:36 am

Tue Mar 10, 2020 1:23 am

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
User avatar
stokesman
Jr. Bludit
Posts: 3
Joined: Thu Mar 19, 2020 10:02 pm

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.
bbyrdhouse
Ssr. Bludit
Posts: 16
Joined: Sun Mar 08, 2020 1:36 am

Fri Mar 20, 2020 1:07 pm

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.
User avatar
stokesman
Jr. Bludit
Posts: 3
Joined: Thu Mar 19, 2020 10:02 pm

Sat Mar 21, 2020 12:12 am

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.
Post Reply