Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
25 stars 19 forks source link

Site Logo does not work #1102

Closed remyKobolski closed 2 years ago

remyKobolski commented 2 years ago

It is not clear at all to me what happens here. I have a logo that is somewhat bigger than the standard. Did such before, see www.mycobol.net. I am installing a new site, 2.2.1sr1. Following chaos is encountered: a configuration option, hinting (with a tooltip) a file name that is weird and is never loaded, a template index.thtml that uses structured data (branded.image), a COM_CreateHtmlDocument that does not use the configuration option (path_site_logo) and instead just sets the template_var to logo.$IMGTYPE. Somehow, suddenly, my new logo is shown, but cut-off.
I'm ending up with my logo image renamed to logo2.png (as the tooltip in the configuration suggested) and stored it in all themes. It works, but crippled, in denim_curve. All other themes just ignore the config. mycobol Made a screenshot of mycobol.net. Would like to produce a screenshot of the crippled version of the new site, but the logo is gone again. And, btw, the document used for tooltips in the configuration sections, still tries to load logo.gif.

remyKobolski commented 2 years ago

Today another experiment. Replaced all logo.png in all themes/images by my new logo. After a few hours, removing the browser cache, geeklog cache etc. my logo showed. php7 pbsolo But, sadly, it is not really what I wanted. Above is denim_three. Below is modern_curve. php7 curved The good thing: the new logo showed and it is just logo.png in theme/images. The bad thing: the result is awful, and without a clue howto adjust it.

eSilverStrike commented 2 years ago

Themes have changed over the years in Geeklog. path_site_logo config option is not really used by the themes included with Geeklog now I believe. If you want to use it you can but you would have to update the index.thtml.

{path_site_logo} is always passed to the template so if you added this code to index.thtml

<img scr="{path_site_logo"}">

it would display.

For the newer themes most of the theme controls are now found in functions.php in the root directory of the theme. Open up that file and you will find the "theme_path_site_logo" that you can change to your new logo file.

The file should have similar dimensions as the current logo. If it does not you will have to modify the themes CSS directly or by adding it to custom.css and/or also edit the html in the index.thtml file.

The best way to see how your current theme handles the logo and what css is involved is to inspect the elements (logo) by right clicking on the browser and click inspect to bring up developer mode of the browser. Here it will list the source html and any css classes and style it uses.

remyKobolski commented 2 years ago

{path_site_logo} is always passed to the template so if you added this code to index.thtml

<img scr="{path_site_logo"}"

No it isn’t. In defeated mode, I do use ‘logo.png’ as CreateHtmlDocument is setting. For the newer themes most of the theme controls are now found in functions.php in the root directory of the theme. Open up that file and you will find the "theme_path_site_logo" that you can change to your new logo file.

There is a configuration option to fill it. Why edit functions.php?

My conclusion: It is probably not a bug, but a neglected feature. And finally; my logo is bigger, which displayed marvellous in older gl versions. The uikit styles are very hindering to adjust the index.thtml. Also, the index.thtml features 2 search blocks, and left blocks.thtml has also one; isn’t that a bit overdone?

Anyway, thanks for your support. See the result at php7.pbsolo.nl

Wim

eSilverStrike commented 2 years ago

I checked the code and in lib-common.php. I see that path_site_logo does get overwritten if there is a setting for it in the themes function.php. So that is what is happening here. You would have to comment out the theme_path_site_logo variable to get the config option to work. The config option tooltip does mention that it can get overwritten but not very clear how.

"This option is not dependent on what theme is selected and will be used for all themes (unless a theme has an override for this option). "

The path_site_logo config option in Geeklog should really be removed at some point as it is a hold over from Geeklog's earlier days. Themes can be so different from each other and how they handle things that really need their own config (hence the functions.php). Plus with the way Geeklog allows multiple themes to be used on the same site have just one setting in Geeklog config doesn't really work.

UIKit is a good framework and saves us a lot of time as it standardizes the classes. The way the logo was coded is not the easiest way to do it though especially for the default theme of Geeklog. It should be easier for users to adjust.

remyKobolski commented 2 years ago

I do appreciate your comments and help.

But there are more issues.

F.i. what is the default theme? It seems that the last theme used hangs around for the next login. Probably session management?

F.i. the denim_three theme does not show correct on mobiles. And, bad-ish, the menu cannot be clicked

F.i. there are no new themes since 2016. And that last posted theme will not work on 2.2.

Well, lot of work to do?

Remy

On 10 nov. 2021 at 13:56, Tom @.***> wrote:

I checked the code and in lib-common.php. I see that path_site_logo does get overwritten if there is a setting for it in the themes function.php. So that is what is happening here. You would have to comment out the theme_path_site_logo variable to get the config option to work. The config option tooltip does mention that it can get overwritten but not very clear how.

"This option is not dependent on what theme is selected and will be used for all themes (unless a theme has an override for this option). "

The path_site_logo config option in Geeklog should really be removed at some point as it is a hold over from Geeklog's earlier days. Themes can be so different from each other and how they handle things that really need their own config (hence the functions.php). Plus with the way Geeklog allows multiple themes to be used on the same site have just one setting in Geeklog config doesn't really work.

UIKit is a good framework and saves us a lot of time as it standardizes the classes. The way the logo was coded is not the easiest way to do it though especially for the default theme of Geeklog. It should be easier for users to adjust.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.