Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Admin theme favicon

  • ymca
  • ymca's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 3 weeks ago - 4 years 3 weeks ago #194954 by ymca
Admin theme favicon was created by ymca
Hi,

Which folder I need to put my "favicon.ico" so it will appear/change to my new favicon when entering admin area?

p.s.
I've made a theme with my name in "admintheme".

Thanks

LS Version 4.2+
Last edit: 4 years 3 weeks ago by ymca.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 weeks ago #194981 by tpartner
Replied by tpartner on topic Admin theme favicon
As far as I know, there are no views or twig files for admin themes yet so I think you will need to replace it in /themes/admin/. (of course, that may be exposed to overwriting when updating the system)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 weeks ago - 4 years 3 weeks ago #194983 by tpartner
Replied by tpartner on topic Admin theme favicon
...oh, wait, you can change the path via JavaScript but you may see a brief flash of the core favicon before the new one appears.

Place your favicon file in /upload/admintheme/YourThemeName/.

Create a custom JavaScript file as described here - manual.limesurvey.org/Custom_Admin_Theme...nto_a_custom_theme_2

Add something like this to that custom.js file:

Code:
$(document).on('ready pjax:scriptcomplete',function(){
 
  $('link[rel="shortcut icon"]').attr('href', '/upload/admintheme/YourThemeName/favicon.ico');
  $('link[rel="icon"]').attr('href', '/upload/admintheme/YourThemeName/favicon.ico');
});


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 3 weeks ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • ymca
  • ymca's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 3 weeks ago #194992 by ymca
Replied by ymca on topic Admin theme favicon
:(
So from what I understand, each time a user goes to the admin area, he will see a brief flash of the core favicon?

LS Version 4.2+
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 weeks ago #194995 by tpartner
Replied by tpartner on topic Admin theme favicon
Possibly. Did you try it?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ymca
  • ymca's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 3 weeks ago #194997 by ymca
Replied by ymca on topic Admin theme favicon
I have made a folder "scripts" and put the "custom.js" in it.
In the "config.xml" above the "<config>" I wote:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Bay of Many configuration for the admin styles.
    In future versions of LimeSurvey, it will be used to fill a admin_style table,
    and to give user control on template configuration (like variables to use to render the questions, banners, background, etc.)
-->
 
        <js>
            <filename>notify.js</filename>
            <filename>save.js</filename>
            <filename>panelclickable.js</filename>
            <filename>panelsanimation.js</filename>
            <filename>sidemenu.js</filename>
            <filename>bootstrap-switch.min.js</filename>
            <filename>jquery.jcarousel.min.js</filename>
            <filename>jcarousel.responsive.js</filename>
            <filename>custom.js</filename>
        </js>
 
<config>

Now I get "404" error.

LS Version 4.2+
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 weeks ago - 4 years 3 weeks ago #195002 by tpartner
Replied by tpartner on topic Admin theme favicon
That doesn't look anything like a complete config file for an admin theme.

Did you copy that from the core theme?

It should look something like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Black Pearl configuration for the admin styles.
    In future versions of LimeSurvey, it will be used to fill a admin_style table,
    and to give user control on template configuration (like variables to use to render the questions, banners, background, etc.)
-->
<config>
    <metadata>
        <name>Black Pearl Custom</name>
        <creationDate>20/02/2020</creationDate>
        <author>Author Name</author>
        <authorEmail>example@example.com</authorEmail>
        <authorUrl>http://example.com</authorUrl>
        <license>GNU General Public License version 2 or later</license>
        <version>3.0</version>
        <description>A customization of Black Pearl</description>
        <basecolor>#071630</basecolor>
        <last_update>2020-02-20 17:00:00</last_update>
    </metadata>
 
    <!--
        Here the list of the css/js files to load.
        Any file here will be loaded via the asset manager
    -->
    <files>
        <css>
            <filename>lime-admin-colors.css</filename>
            <filename>statistics.css</filename>
      <filename>custom.css</filename>
        </css>
 
        <js>
           <filename>custom.js</filename>
    </js>
 
        <!--
            Those files will be loaded for right to left languages only
            NOTE 1: If for any reason, you need to edit the RTL behaviors, feel free to contact the LimeSurvey team about it.
            We'll be always pleased to make better the right to left display
 
            NOTE 2: those files are generated with the script R2. See: https://github.com/ded/R2
        -->
        <rtl>
            <css>
                <!-- Still need these files -->
                <filename>lime-admin-colors.css</filename>
                <filename>statistics-rtl.css</filename>
            </css>
            <js></js>
        </rtl>
    </files>
 
    <engine>
        <!-- If you want to use asset manager, even in debug mode, set this field to true. -->
        <use_asset_manager_in_debug_mode>false</use_asset_manager_in_debug_mode>
    </engine>
</config>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 3 weeks ago by tpartner.
The topic has been locked.
  • ymca
  • ymca's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 3 weeks ago - 4 years 3 weeks ago #195011 by ymca
Replied by ymca on topic Admin theme favicon
Yes.
I meant to say that I've added the JS on the top of the code so it will run first and not have a glitch for the user to see...

<?xml version="1.0" encoding="UTF-8"?>
<!--
Bay of Many configuration for the admin styles.
In future versions of LimeSurvey, it will be used to fill a admin_style table,
and to give user control on template configuration (like variables to use to render the questions, banners, background, etc.)
-->

<js>
<filename>notify.js</filename>
<filename>save.js</filename>
<filename>panelclickable.js</filename>
<filename>panelsanimation.js</filename>
<filename>sidemenu.js</filename>
<filename>bootstrap-switch.min.js</filename>
<filename>jquery.jcarousel.min.js</filename>
<filename>jcarousel.responsive.js</filename>
<filename>custom.js</filename>
</js>

<config>
<metadata>
<name>Hotforthis</name>
<creationDate>08/12/2015</creationDate>
<author>Louis-Sébastien Gac Artigas</author>
<authorEmail>louis.gac@limesurvey.org
<authorUrl> www.limesurvey.org
<copyright>Copyright (C) 2005 - 2016 LimeSurvey Gmbh, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later</license>
<version>3.0</version>
<description>LimeSurvey admin interface template, blue variation.</description>
<basecolor>#214F7E</basecolor>
<lastUpdate>2017-27-11 17:00:00</lastUpdate>
</metadata>

<!--
Here the list of the css/js files to load.
Any file here will be loaded via the asset manager
-->
<files>
<css>
<filename>lime-admin-colors.css</filename>
<filename>statistics.css</filename>
</css>

<js></js>

<!--
Those files will be loaded for right to left languages only
NOTE 1: If for any reason, you need to edit the RTL behaviors, feel free to contact the LimeSurvey team about it.
We'll be always pleased to make better the right to left display

NOTE 2: those files are generated with the script R2. See: github.com/ded/R2
-->
<rtl>
<css>
<!-- Still need these files -->
<filename>lime-admin-colors.css</filename>
<filename>statistics-rtl.css</filename>
</css>
<js>
</js>
</rtl>
</files>

<engine>
<!-- If you want to use asset manager, even in debug mode, set this field to true. -->
<use_asset_manager_in_debug_mode>false</use_asset_manager_in_debug_mode>
</engine>
</config>


LS Version 4.2+
Last edit: 4 years 3 weeks ago by ymca.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 weeks ago #195015 by tpartner
Replied by tpartner on topic Admin theme favicon
That will never work, you can't simply move the tags around. The <js> tag needs to be inside the <files> tag as in my example.

All of those files will get loaded before the JavaScript fires anyway.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ymca
  • ymca's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 3 weeks ago - 4 years 3 weeks ago #195020 by ymca
Replied by ymca on topic Admin theme favicon
I have done it but now I cannot see any favicon (logged on browser with incognito).
Do I need to put this line also?

<filename>custom.css</filename>

Because I don't see a file with that name in my folder.

LS Version 4.2+
Last edit: 4 years 3 weeks ago by ymca.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 weeks ago #195033 by tpartner
Replied by tpartner on topic Admin theme favicon
You don't need that.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: ymca
The topic has been locked.
  • ymca
  • ymca's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 3 weeks ago #195036 by ymca
Replied by ymca on topic Admin theme favicon
So now I cannot see any favicon.
Better to leave it as is till they fix it in an update?

LS Version 4.2+
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose