No Code Attached Yet
avatar ceford
ceford
21 Aug 2021

Steps to reproduce the issue

A lot of Joomla based sites want to use their own favicons but there is no easy way to change the existing triplet apart from editing the index.php file. I believe that is a problem because the change is overwritten if Cassiopeia gets updated. Can the favicon file names be made configurable in the same way that the logo is configurable?

Expected result

Actual result

System information (as much as possible)

Additional comments

avatar ceford ceford - open - 21 Aug 2021
avatar ceford ceford - change - 21 Aug 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 21 Aug 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Aug 2021
avatar richard67
richard67 - comment - 21 Aug 2021

You can create a copy of the Cassiopeia template and modify the index.php of that and use that copied template as default for the frontend. The override check should be able to show you if there are things to be changed in the copy after a core update which has changes in Cassiopeia.

avatar dgrammatiko
dgrammatiko - comment - 21 Aug 2021

You can create a copy of the Cassiopeia template and modify the index.php of that and use that copied template as default for the frontend. The override check should be able to show you if there are things to be changed in the copy after a core update which has changes in Cassiopeia.

That's a suggestion but probably we should not promote this, once the UI for child templates is ready the whole process will be way more approachable.
For this actually, you don't need to fork the template, just create the svg/ico images in the templates/cassiopeia/images and presto you have custom favicons. This can be done using the editing part of the template only requirement is that the favicons should be named:

  • joomla-favicon.svg
  • joomla-favicon-pinned.svg
  • favicon.ico

The first 2 needs to be svg but there are plenty of online tools to convert a bitmap to svg (eg https://vectormagic.com). The favicon.ico can also be created using online tools (eg https://cloudconvert.com/svg-to-ico).

avatar sozzled
sozzled - comment - 21 Aug 2021

Thanks everyone. I don't think that it's a good approach to add some configuration option to the template to change the favicon for a website but that's just my opinion. It should be easy to create a plugin that unsets the existing "<link ...>" statements and then use the addFavIcon() method to replace whatever is normally generated with something else that the site owner may choose to use instead.

Yes, I am aware that you can replace the existing three files in templates/cassiopeia/images and I am aware of various tools one can use to create SVGs. The issue is not about creating files and placing them in that folder. The issue is about what happens when the site owner uses the J! Update Component. Aren't these files replaced as part of the update procedure? That would mean that, every time the site owner updates the template (e.g. when updating J!) these three files need to be replaced again, yes?

At this time—the early days of J! 4—it's probably not advisable to clone existing templates because the clones may get out of step with the original (and changing) version.

From my viewpoint, I would prefer to de-couple the current method (i.e. relying on files that are located in a specific folder) from the template and use a system plugin instead. The discussion on the J! forum is an example of what I would like to do: see https://forum.joomla.org/viewtopic.php?f=808&t=987328

avatar brianteeman
brianteeman - comment - 21 Aug 2021

The issue is about what happens when the site owner uses the J! Update Component. Aren't these files replaced as part of the update procedure?

A 2 second check would have shown you that they wont be.

avatar sozzled
sozzled - comment - 21 Aug 2021

Thanks, Brian: my 2-second check was based on https://forum.joomla.org/viewtopic.php?f=808&t=987328#p3636581 where another person says that these files were replaced. I suppose I could perform a 2-minute check: run the Joomla Update component with "restore core CMS files" as the option and see what happens. Give me a few minutes to run that and I'll let you know. :)

avatar brianteeman
brianteeman - comment - 21 Aug 2021

There is no need to do that.

If you put the icons in the templates/cassiopeia/images folder as Dimitris said then no update can override them because the core favicons are located in located in media/system/images/

image

avatar sozzled
sozzled - comment - 21 Aug 2021

I'm working as fast as I can, Brian ? I've wasted a couple of days because I took https://forum.joomla.org/viewtopic.php?f=808&t=987328#p3636581 at face value and it takes more than two seconds to check everything out.

avatar brianteeman
brianteeman - comment - 21 Aug 2021

you just have to look at the files

avatar sozzled
sozzled - comment - 21 Aug 2021

OK. The first test was to add one new image to the folder templates/cassiopeia/images with the name favicon.ico, detonate the aggressive browser cache and, sure enough, the raw HTML shows the following:

<link href="/media/system/images/joomla-favicon.svg" rel="icon" type="image/svg+xml">
<link href="/templates/cassiopeia/images/favicon.ico" rel="alternate icon" type="image/vnd.microsoft.icon">
<link href="/media/system/images/joomla-favicon-pinned.svg" rel="mask-icon" color="#000">

Which is lovely! Except that my browser prefers to display the SVG image instead of the ICO image. How do you "unset" (for a better way of describing things) the SVG links? Do you need to convert the bitmap to SVG for every favicon you want to use and place the SVG versions in the template/images folder as well?

avatar sozzled
sozzled - comment - 21 Aug 2021

Getting back the the original "2-second test", you're absolutely right, Brian. Running the J! Update component does not delete or replace any user-uploaded files placed in templates/cassiopeia/images. I would not have expected the update process to affect user-uploaded files placed in that directory. However, folklore is a dangerous thing (especially when one is navigating through new territory) and if one person says something is false (contrary to one's experience) then it makes one doubt one's beliefs. So, it turns out that https://forum.joomla.org/viewtopic.php?f=808&t=987328#p3636581 was "fake news".

It still doesn't address my "wish" to be able to use a plugin to define favicons on-the-fly as I have been able to do for a few years (and I need to experiment more) and it doesn't answer how to unset existing links (that refer to SVGs) but, with some help we may get there. :)

avatar brianteeman
brianteeman - comment - 21 Aug 2021

not "fake news" just "wrong"

just as the original post here is wrong

avatar sozzled
sozzled - comment - 21 Aug 2021

I was being kind, Brian, when I wrote "fake news". Yes, the advice posted on the forum was incorrect and it should have been corrected but I've been locked-out from the forum for the past month and I only became engaged with this matter in the past two-to-four days. I also agree (and I stated it before) that I don't think it's a good idea to add configuration options to Cassiopeia (or Atum, for that matter) but we do need some gentle education about the options that are available. I also reaffirm my opinion that cloning these templates at this time is not really a desirable workaround.

avatar brianteeman
brianteeman - comment - 21 Aug 2021

So just take the paragraph that Dimitris wrote and add it to the documentation site.

avatar sozzled
sozzled - comment - 21 Aug 2021

I really do have my hands full at the moment, Brian. I have a to-do list for today that will keep me occupied for several hours. I'm taking a break from webcraft-related activities for a while. Good idea, though, to fix the documentation. :)

avatar dgrammatiko
dgrammatiko - comment - 9 Nov 2021

please close

avatar richard67 richard67 - change - 9 Nov 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-11-09 18:27:40
Closed_By richard67
avatar richard67 richard67 - close - 9 Nov 2021
avatar richard67
richard67 - comment - 9 Nov 2021

Closing as stated in the discussion above. Feel free to re-open if you think this is wrong.

avatar brianteeman
brianteeman - comment - 28 Jan 2022

You can create a copy of the Cassiopeia template and modify the index.php of that and use that copied template as default for the frontend. The override check should be able to show you if there are things to be changed in the copy after a core update which has changes in Cassiopeia.

The override check wont do anything in this scenario

just create the svg/ico images in the templates/cassiopeia/images and presto you have custom favicons. This can be done using the editing part of the template only requirement is that the favicons should be named:

If only it was that easy. By default neither svg nor ico files can be uploaded using the editor

avatar dgrammatiko
dgrammatiko - comment - 28 Jan 2022

If only it was that easy. By default neither svg nor ico files can be uploaded using the editor

Also you can't create .min.css or .min.js and countless more limitations I've discovered as I was patching com_templates. The editor part of com_templates is really bad (no A11y, awful UX, etc) but I was asked to not introduce more B/C breaks than the absolute minimum to get the new functionality (reasonable decision as 4.1 is not a major version).
I might have another solution...

avatar richard67
richard67 - comment - 28 Jan 2022

Well, if I shall re-open this issue in the mean time, let me know and I do so.

avatar menezesgg
menezesgg - comment - 24 May 2022

Kd

Add a Comment

Login with GitHub to post a comment