store logo width

Open to all! Ask other shopowners for help.
Post Reply
Nigel
Contributor
Posts: 114
Joined: Mon Jan 11, 2021 1:39 am
Phoenix Version:
Has thanked: 29 times
Been thanked: 8 times

store logo width

Post by Nigel »

store logo width
How can I make the store logo run across all 12 columns ?
I set the width to 12 but it won't stretch beyond the natural width of the image.

Setting the search bar to 12 works fine, just as a test.
It's my own image and not the Phoenix one.

Thanks


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: store logo width

Post by ecartz »

Existing code in includes/modules/content/header/templates/tpl_cm_header_logo.php:

Code: Select all

<div class="col-sm-<?php echo $content_width; ?> cm-header-logo">
  <?php echo '<a href="' . tep_href_link('index.php') . '">' . tep_image('images/' . STORE_LOGO, htmlspecialchars(STORE_NAME)) . '</a>'; ?>
</div>
So override with something like

Code: Select all

<div class="col-sm-<?= $content_width ?> cm-header-logo">
  <a href="<?= $GLOBALS['Linker']->build('index.php') ?>"><?= new Image('images/' . STORE_LOGO, ['class' => 'w-100'], htmlspecialchars(STORE_NAME)) ?></a>
</div>
It might need some tinkering to get the right effect.

You also might be able to do it in CSS with something like

Code: Select all

DIV.cm-header-logo>IMG {width: 100%}
But there are others who more au fait with the store CSS than me.
Nigel
Contributor
Posts: 114
Joined: Mon Jan 11, 2021 1:39 am
Phoenix Version:
Has thanked: 29 times
Been thanked: 8 times

Re: store logo width

Post by Nigel »

Ok, ta, I'll have a look.
I assume all this would go in a user template rather than the main files.
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

Re: store logo width

Post by Xpajun »

I think you'll find that the logo image has to be full width plus - the plus is for when someone like me has a 27" monitor and has their browser full screen.
One of the things you will have to do is check what it's like on a mobile
I put my logo over a background - and then I swop the background for a smaller one for mobiles
You can see what I did here: https://xpajun.com/store/index.php
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18
Nigel
Contributor
Posts: 114
Joined: Mon Jan 11, 2021 1:39 am
Phoenix Version:
Has thanked: 29 times
Been thanked: 8 times

Re: store logo width

Post by Nigel »

Xpajun wrote: Wed Sep 08, 2021 7:42 pm I think you'll find that the logo image has to be full width plus - the plus is for when someone like me has a 27" monitor and has their browser full screen.
One of the things you will have to do is check what it's like on a mobile
I put my logo over a background - and then I swop the background for a smaller one for mobiles
You can see what I did here: https://xpajun.com/store/index.php
Thanks for your example, it's one solution but not exactly what I'm looking for.
My actual website index page has the same image and Css grid stretches it and minimizes it perfectly for responsive views.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: store logo width

Post by heatherbell »

Nigel wrote: Wed Sep 08, 2021 7:12 pm Ok, ta, I'll have a look.
I assume all this would go in a user template rather than the main files.
Tested this in user.css and works:

Code: Select all

.cm-header-logo .img-fluid{
    width: 100%;
}


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply