user.css with 1.0.8.19

Open to all! Ask other shopowners for help.
Post Reply
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

user.css with 1.0.8.19

Post by Xpajun »

Working on 1.0.8.19:
I've put my user.css in default>static but for some reason it is not working - certainly not in template.php or header.php- does the user.css now only work on template>pages?
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


Join The Code Co-op to get access to your library in the Code Co-op Forum
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: user.css with 1.0.8.19

Post by heatherbell »

Xpajun wrote: Mon Oct 31, 2022 11:37 am Working on 1.0.8.19:
I've put my user.css in default>static but for some reason it is not working - certainly not in template.php or header.php- does the user.css now only work on template>pages?
Should be in /templates/override/static/ - copy it to there
See - https://github.com/CE-PhoenixCart/Phoen ... c/user.css
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: user.css with 1.0.8.19

Post by Xpajun »

heatherbell wrote: Mon Oct 31, 2022 1:30 pm
Xpajun wrote: Mon Oct 31, 2022 11:37 am Working on 1.0.8.19:
I've put my user.css in default>static but for some reason it is not working - certainly not in template.php or header.php- does the user.css now only work on template>pages?
Should be in /templates/override/static/ - copy it to there
See - https://github.com/CE-PhoenixCart/Phoen ... c/user.css
I was working with the default so expected to have to put the user.css in to that static - thank you that partly worked - I now decided that I should be working on my Template - now I'm having problems with that :cry:
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
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: user.css with 1.0.8.19

Post by Xpajun »

I'm still having problems with this:

I have user.css in static but it still does not work on templates_top or heading.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
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: user.css with 1.0.8.19

Post by ecartz »

Xpajun wrote: Tue Nov 01, 2022 11:35 am I have user.css in static but it still does not work on templates_top or heading.php
I don't know what this means. The template_top.php file is not something that you load separately. It's a component of the page. The user.css file is loaded by a hook: https://github.com/CE-PhoenixCart/Phoen ... Sheets.php

The hook point is in template_top.php -- it's the same hook point as used by BootStrap, so it should be pretty obvious whether or not it is working. It has nothing to do with header.php

Some questions to consider:

1. What template is selected in admin?
2. Is the user.css file under the same template in its static directory?
3. What kind of page are you checking? Is it a core page? A page from a supported add-on? A page that you created yourself?
4. Do other parts of the page work? E.g. the part that loads BootStrap.
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: user.css with 1.0.8.19

Post by Xpajun »

ecartz wrote: Tue Nov 01, 2022 1:15 pm
Xpajun wrote: Tue Nov 01, 2022 11:35 am I have user.css in static but it still does not work on templates_top or heading.php
I don't know what this means. The template_top.php file is not something that you load separately. It's a component of the page. The user.css file is loaded by a hook: https://github.com/CE-PhoenixCart/Phoen ... Sheets.php

The hook point is in template_top.php -- it's the same hook point as used by BootStrap, so it should be pretty obvious whether or not it is working. It has nothing to do with header.php

Some questions to consider:

1. What template is selected in admin?
2. Is the user.css file under the same template in its static directory?
3. What kind of page are you checking? Is it a core page? A page from a supported add-on? A page that you created yourself?
4. Do other parts of the page work? E.g. the part that loads BootStrap.
1. I'm using my own template which is a copy of the default one (which I had been altering before I realised how the template system worked)
2. the user.css file is in static in the correct template directory
3. I've just found that, in the course of answering your questions, the the images should be in static/images to be loaded - I take it that that will apply to all images in user.css?
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
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: user.css with 1.0.8.19

Post by ecartz »

So the way that most templates (e.g override, Gustavo, the sample, Bootstrap5) work is that they inherit from default. That makes them get the default behavior but allow them to override it. If you're not inheriting from default, then you might need to copy the hooks from default.

If you want images inside the template, then they would have to be under static. Whether you put them in static/images or somewhere else is up to you. You could also access images from the regular images directory.

Note: for most people, it would be enough to customize in override. You usually wouldn't have to set up your own template. Not that you can't, but the purpose of override is to be a place that you can customize without losing the default behavior. In override, you can customize by copying a file from default to the same location under override. Then you can edit your version of the file.
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: user.css with 1.0.8.19

Post by Xpajun »

ecartz wrote: Tue Nov 01, 2022 5:58 pm
If you want images inside the template, then they would have to be under static. Whether you put them in static/images or somewhere else is up to you. You could also access images from the regular images directory.
Would it not be easier/simpler to put all images called by user.css in a images directory in static so that the url route would only be ./images/picture.gif ?

Because I've always hacked the default is the reason I uploaded my own template copied from default - that way I only have to work in one template as all the pages are there
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


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