How to add Logo and resize Topic is solved

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
snowgoose
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Wed Mar 13, 2019 11:42 am

How to add Logo and resize

Post by snowgoose » Tue Sep 07, 2021 6:39 pm

I'm trying to get to grips with J4, and people are saying it's worth sticking with, but I can't see any improvement over J3 for me right now.
Upgrading my sites will not work, mainly becasue they are based on Protostar which doesn't exisit any more. So the only way forward for me is to create all my sites from scratch. I created a blank J4 site and the first thing I tried to do was what I do on all my sites. Upload a logo (which in my case is best described as a banner) which I want to go across the full width of the site. I never could understand why Protostar didn't have an option to specify the width when uploading a logo, but at least is was fairly easily achieved by modifying some CSS (within user.css).

However, trying to do this with Cassiopeia seems impossible. I have googled the problem but no answers. Using Firefox's developer tools I still can't find any CSS associated with the logo. My header/banner remains a tiny little box in the top left corner and nothing I do will make it fit across the page.

Any ideas? Surely Cassiopeia can't be this fixed and unflexible?? Why is there not an option to specify the size of the logo on the same page as the option to upload a logo? Why do the developers assume everyone wants the exact same size logo? Or am I missing something? Or should I just stick with Joomla 3?

Thanks
Dave

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1637
Joined: Tue Jun 30, 2020 12:17 pm

Re: How to add Logo and resize

Post by Pavel-ww » Tue Sep 07, 2021 8:43 pm

Hi. Cassiopeia is built on CSS Grid technology. There is another logic than what you knew in Protostar. You just do not understand how it works, so in a dead end. But if you learn CSS Grid (this will take two weeks to the maximum), you will understand how much Protostar is poor and ancient :D .

CSS Grid technology - very powerful, flexible, requires significantly less code and works much faster. With this technology, you can rebuild the layout as you want, only with CSS.

In this topic you can see an example viewtopic.php?f=815&t=988134&p=3638773#p3638773

User avatar
Jaydot
Joomla! Guru
Joomla! Guru
Posts: 651
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: How to add Logo and resize

Post by Jaydot » Tue Sep 07, 2021 8:47 pm

Assuming you entered the logo in the Style section of the template, I used this selector...

Code: Select all

.container-header .navbar-brand img
and set the width I wanted.
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

snowgoose
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Wed Mar 13, 2019 11:42 am

Re: How to add Logo and resize

Post by snowgoose » Tue Sep 07, 2021 9:08 pm

Thank you. I'll try that tomorrow 🙂

snowgoose
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Wed Mar 13, 2019 11:42 am

Re: How to add Logo and resize

Post by snowgoose » Wed Sep 08, 2021 7:43 am

Jaydot wrote:
Tue Sep 07, 2021 8:47 pm
Assuming you entered the logo in the Style section of the template, I used this selector...

Code: Select all

.container-header .navbar-brand img
and set the width I wanted.
Thank you Jaydot, that works perfectly :)

vesodimov
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Thu Oct 27, 2016 9:22 am

Re: How to add Logo and resize

Post by vesodimov » Wed Sep 15, 2021 11:15 am

Hello.
Please be more detailed in the explanations. What to do with this code?
I select logo like that: System - Site Template Styles - select Cassiopeia - Advanced - Logo
Result - very small logo.

tompasworld
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 121
Joined: Wed Jun 14, 2006 10:20 am

Re: How to add Logo and resize

Post by tompasworld » Thu Oct 07, 2021 9:00 am

Hi,

I am trying the above solution but I don´t get it to work. Below is what I have done. Can anyone tell me if I miss a step or do something wrong, please?

1. In Joomlas System > Site teplate styles > Cassiopia (Default > advanced > logo, it says:

Code: Select all

images/logo211003.png#joomlaImage://local-images/logo211003.png?width=940&height=115
2. In Cassiopias template.css I added:

Code: Select all

.container-header .navbar-brand img {
  width: 940px;
}

User avatar
Jaydot
Joomla! Guru
Joomla! Guru
Posts: 651
Joined: Sun Jun 04, 2017 12:11 pm
Location: The Netherlands
Contact:

Re: How to add Logo and resize

Post by Jaydot » Thu Oct 07, 2021 2:19 pm

tompasworld wrote:
Thu Oct 07, 2021 9:00 am
I am trying the above solution but I don´t get it to work...
It should work, perhaps you need to clean cache...
However:
Never make changes to the template.css file - any changes will be overwritten on the next update. Instead, create a file user.css in the template's CSS folder, and add your own CSS to that.
And: as a rule, do not use dimensions in pixels. It will make the image unresponsive, in other words, it will look horrible on a small screen like a phone. Use a percentage instead. Using a percentage will limit the width to the width of .navbar-brand, so you might want to set the width of .navbar-brand first.
The fact that an opinion is widely held is no evidence whatsoever that it is not utterly absurd.
Personal website: https://jaydot.nl

tompasworld
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 121
Joined: Wed Jun 14, 2006 10:20 am

Re: How to add Logo and resize

Post by tompasworld » Thu Oct 07, 2021 4:51 pm

- Cache is cleaned (I just forgot to write that).

- I know it will eventully get overwritten, but this is just a test installation to get to know version 4 until I can update my real site, so overwriting at the moment is no problem.

- And: as a rule, do not use dimensions in pixels.
I know, just didn´t think of it when trying this last night, I just wanted to see if this solution would work at all, but not for me.

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1637
Joined: Tue Jun 30, 2020 12:17 pm

Re: How to add Logo and resize

Post by Pavel-ww » Sat Oct 09, 2021 10:13 am

tompasworld wrote:
Thu Oct 07, 2021 4:51 pm
I know, just didn´t think of it when trying this last night, I just wanted to see if this solution would work at all, but not for me.
Just provide the link to the site and explain exactly what you want to achieve.
940px width is not logo, but a banner ;)

Cassiopea is built on CSS Grid. Therefore, it will not be enough to control the width for similar size. And even say so, the width control in this case will not be the right solution in general

tompasworld
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 121
Joined: Wed Jun 14, 2006 10:20 am

Re: How to add Logo and resize

Post by tompasworld » Sat Oct 09, 2021 9:08 pm

Banner, logo, header...some call it this, some call it that. :)

The way I want it to look: My current site/look, which is based on Protostar, that is no more as I understand. Therefor I need to redesign, but this banner/header/logo I do not want to change.
http://jikrantz.se/

The way it currently look, Cassiopeia style.
http://jikrantz.se/next/

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1637
Joined: Tue Jun 30, 2020 12:17 pm

Re: How to add Logo and resize

Post by Pavel-ww » Mon Oct 11, 2021 7:34 am

tompasworld wrote:
Sat Oct 09, 2021 9:08 pm
Banner, logo, header...some call it this, some call it that. :)

The way I want it to look: My current site/look, which is based on Protostar, that is no more as I understand. Therefor I need to redesign, but this banner/header/logo I do not want to change.
http://jikrantz.se/

The way it currently look, Cassiopeia style.
http://jikrantz.se/next/
Hi. Create user.css file in cassiopea/css/ folder and place the following code

Code: Select all

.container-header .navbar-brand img {
	width: 100%;
}
1.jpg
And this worked too. Perhaps you have placed the code in the wrong place. This code is simply not responsive.

Code: Select all

.container-header .navbar-brand img {
	width: 940px;
}
You do not have the required permissions to view the files attached to this post.

tompasworld
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 121
Joined: Wed Jun 14, 2006 10:20 am

Re: How to add Logo and resize

Post by tompasworld » Mon Oct 11, 2021 8:27 pm

Hi,

Thank you for your help. It works fine now.
I know it would be overwritten at upgrades if editing template.css and user.css is a better solution but why wouldn´t this work by just editing appropriate code in template.css as I first tried?

User avatar
Pavel-ww
Joomla! Ace
Joomla! Ace
Posts: 1637
Joined: Tue Jun 30, 2020 12:17 pm

Re: How to add Logo and resize

Post by Pavel-ww » Tue Oct 12, 2021 6:18 am

tompasworld wrote:
Mon Oct 11, 2021 8:27 pm
Hi,

Thank you for your help. It works fine now.
I know it would be overwritten at upgrades if editing template.css and user.css is a better solution but why wouldn´t this work by just editing appropriate code in template.css as I first tried?
Hi. Because if you take a look at the source code of the page, you will not find there template.css. This file is not involved in building an appearance. But you will find template.min.css there. If you add code to this file, everything will work. For what is needed template.css, I still do not know. Cassiopea has no documentation and we have to explore it as Terra Incognita :D


Locked

Return to “General Questions/New to Joomla! 4.x”