Change favicon in Liferay 7 with Tomcat
I have a Liferay 7 project and I would like to change the favicon of the browser to a custom one. I created a portal-ext.properties file and I set the property theme.shortcut.icon=myfavicon.ico
. Although, I cannot see the custom icon on my website.
Could you please tell me where to put my .ico file in the tomcat dir? What is the path for the theme.shortcut.icon
to my image?
Also, where do you suggest to put the portal-ext.properties file?
tomcat liferay liferay-7
add a comment |
I have a Liferay 7 project and I would like to change the favicon of the browser to a custom one. I created a portal-ext.properties file and I set the property theme.shortcut.icon=myfavicon.ico
. Although, I cannot see the custom icon on my website.
Could you please tell me where to put my .ico file in the tomcat dir? What is the path for the theme.shortcut.icon
to my image?
Also, where do you suggest to put the portal-ext.properties file?
tomcat liferay liferay-7
add a comment |
I have a Liferay 7 project and I would like to change the favicon of the browser to a custom one. I created a portal-ext.properties file and I set the property theme.shortcut.icon=myfavicon.ico
. Although, I cannot see the custom icon on my website.
Could you please tell me where to put my .ico file in the tomcat dir? What is the path for the theme.shortcut.icon
to my image?
Also, where do you suggest to put the portal-ext.properties file?
tomcat liferay liferay-7
I have a Liferay 7 project and I would like to change the favicon of the browser to a custom one. I created a portal-ext.properties file and I set the property theme.shortcut.icon=myfavicon.ico
. Although, I cannot see the custom icon on my website.
Could you please tell me where to put my .ico file in the tomcat dir? What is the path for the theme.shortcut.icon
to my image?
Also, where do you suggest to put the portal-ext.properties file?
tomcat liferay liferay-7
tomcat liferay liferay-7
edited Nov 18 '18 at 11:40
Olaf Kock
37.2k74576
37.2k74576
asked Nov 15 '18 at 22:18
bunjeebunjee
62
62
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The icon should be part of your theme. Here's how to figure out what to do: Check Liferay's source code (I have the 7.1 sourcecode here), the results are quite easy to browse through, but I'm shortening the grep output here for clarity:
olaf@tp:~/src$ grep -r "theme.shortcut.icon" .
./portal-kernel/.../PropsKeys.java: public static final String THEME_SHORTCUT_ICON = "theme.shortcut.icon";
./portal-impl/src/portal.properties: theme.shortcut.icon=favicon.ico
...
olaf@tp:~/src$ grep -r "THEME_SHORTCUT_ICON" .
./portal-web/.../themes/top_head.jsp:<link data-senna-track="temporary" href="<%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>" rel="Shortcut Icon" />
As it's hard to read, despite shortening the lines, the shortcut icon path is constructed as <%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>
. In the interest of easy maintainability, I'd suggest to build your own theme (almost everybody does this anyway) and just use the standard filename and replace that image in your theme, and you'll be set.
As you ask about "where to put the image in tomcat": In Liferay, you shouldn't expect to serve regular web applications, in fact, themes are typically served from their OSGi contents. You can easily check this by going to the served page and search for favicon
: If the path contains a /o/
, this points to the OSGi engine to serve it, e.g. there's not an equivalent in the Tomcat filesystem (it's bad practice to mock around with those files anyways: Most likely you'll forget them during the next upgrade and loose your changes.
Looking at my stock installation, http://localhost:8080/o/classic-theme/images/favicon.ico
is the place that the favicon is served from, and indeed, there's that /o/
. So the answer is: Add the icon to your own theme, then you don't even need to change its name through the property you found.
But how to create a well maintainable system, with properly separated content (between yours and stock Liferay) is probably out of scope for this answer.
As an extreme, non-recommended, quickfix you might want to set the value in portal-ext.properties to
theme.shortcut.icon=../../../myfavicon.ico
and replace the icon in tomcat's webapps/ROOT/myfavicon.ico
. But don't come crying later, when you accidentally overwrite it in an upgrade.
Thanks, the non-recommended solution worked fine.
– bunjee
Nov 21 '18 at 9:39
@bunjee can you tell me how you changed the favicon. I am trying to figure it out. Your help willbe greatly helpful. Thanks.
– Abhiram
Feb 13 at 9:32
@Abhiram I've been giving a couple of options, and OP has clearly stated, which one (s)he chose.
– Olaf Kock
Feb 16 at 15:57
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328682%2fchange-favicon-in-liferay-7-with-tomcat%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The icon should be part of your theme. Here's how to figure out what to do: Check Liferay's source code (I have the 7.1 sourcecode here), the results are quite easy to browse through, but I'm shortening the grep output here for clarity:
olaf@tp:~/src$ grep -r "theme.shortcut.icon" .
./portal-kernel/.../PropsKeys.java: public static final String THEME_SHORTCUT_ICON = "theme.shortcut.icon";
./portal-impl/src/portal.properties: theme.shortcut.icon=favicon.ico
...
olaf@tp:~/src$ grep -r "THEME_SHORTCUT_ICON" .
./portal-web/.../themes/top_head.jsp:<link data-senna-track="temporary" href="<%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>" rel="Shortcut Icon" />
As it's hard to read, despite shortening the lines, the shortcut icon path is constructed as <%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>
. In the interest of easy maintainability, I'd suggest to build your own theme (almost everybody does this anyway) and just use the standard filename and replace that image in your theme, and you'll be set.
As you ask about "where to put the image in tomcat": In Liferay, you shouldn't expect to serve regular web applications, in fact, themes are typically served from their OSGi contents. You can easily check this by going to the served page and search for favicon
: If the path contains a /o/
, this points to the OSGi engine to serve it, e.g. there's not an equivalent in the Tomcat filesystem (it's bad practice to mock around with those files anyways: Most likely you'll forget them during the next upgrade and loose your changes.
Looking at my stock installation, http://localhost:8080/o/classic-theme/images/favicon.ico
is the place that the favicon is served from, and indeed, there's that /o/
. So the answer is: Add the icon to your own theme, then you don't even need to change its name through the property you found.
But how to create a well maintainable system, with properly separated content (between yours and stock Liferay) is probably out of scope for this answer.
As an extreme, non-recommended, quickfix you might want to set the value in portal-ext.properties to
theme.shortcut.icon=../../../myfavicon.ico
and replace the icon in tomcat's webapps/ROOT/myfavicon.ico
. But don't come crying later, when you accidentally overwrite it in an upgrade.
Thanks, the non-recommended solution worked fine.
– bunjee
Nov 21 '18 at 9:39
@bunjee can you tell me how you changed the favicon. I am trying to figure it out. Your help willbe greatly helpful. Thanks.
– Abhiram
Feb 13 at 9:32
@Abhiram I've been giving a couple of options, and OP has clearly stated, which one (s)he chose.
– Olaf Kock
Feb 16 at 15:57
add a comment |
The icon should be part of your theme. Here's how to figure out what to do: Check Liferay's source code (I have the 7.1 sourcecode here), the results are quite easy to browse through, but I'm shortening the grep output here for clarity:
olaf@tp:~/src$ grep -r "theme.shortcut.icon" .
./portal-kernel/.../PropsKeys.java: public static final String THEME_SHORTCUT_ICON = "theme.shortcut.icon";
./portal-impl/src/portal.properties: theme.shortcut.icon=favicon.ico
...
olaf@tp:~/src$ grep -r "THEME_SHORTCUT_ICON" .
./portal-web/.../themes/top_head.jsp:<link data-senna-track="temporary" href="<%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>" rel="Shortcut Icon" />
As it's hard to read, despite shortening the lines, the shortcut icon path is constructed as <%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>
. In the interest of easy maintainability, I'd suggest to build your own theme (almost everybody does this anyway) and just use the standard filename and replace that image in your theme, and you'll be set.
As you ask about "where to put the image in tomcat": In Liferay, you shouldn't expect to serve regular web applications, in fact, themes are typically served from their OSGi contents. You can easily check this by going to the served page and search for favicon
: If the path contains a /o/
, this points to the OSGi engine to serve it, e.g. there's not an equivalent in the Tomcat filesystem (it's bad practice to mock around with those files anyways: Most likely you'll forget them during the next upgrade and loose your changes.
Looking at my stock installation, http://localhost:8080/o/classic-theme/images/favicon.ico
is the place that the favicon is served from, and indeed, there's that /o/
. So the answer is: Add the icon to your own theme, then you don't even need to change its name through the property you found.
But how to create a well maintainable system, with properly separated content (between yours and stock Liferay) is probably out of scope for this answer.
As an extreme, non-recommended, quickfix you might want to set the value in portal-ext.properties to
theme.shortcut.icon=../../../myfavicon.ico
and replace the icon in tomcat's webapps/ROOT/myfavicon.ico
. But don't come crying later, when you accidentally overwrite it in an upgrade.
Thanks, the non-recommended solution worked fine.
– bunjee
Nov 21 '18 at 9:39
@bunjee can you tell me how you changed the favicon. I am trying to figure it out. Your help willbe greatly helpful. Thanks.
– Abhiram
Feb 13 at 9:32
@Abhiram I've been giving a couple of options, and OP has clearly stated, which one (s)he chose.
– Olaf Kock
Feb 16 at 15:57
add a comment |
The icon should be part of your theme. Here's how to figure out what to do: Check Liferay's source code (I have the 7.1 sourcecode here), the results are quite easy to browse through, but I'm shortening the grep output here for clarity:
olaf@tp:~/src$ grep -r "theme.shortcut.icon" .
./portal-kernel/.../PropsKeys.java: public static final String THEME_SHORTCUT_ICON = "theme.shortcut.icon";
./portal-impl/src/portal.properties: theme.shortcut.icon=favicon.ico
...
olaf@tp:~/src$ grep -r "THEME_SHORTCUT_ICON" .
./portal-web/.../themes/top_head.jsp:<link data-senna-track="temporary" href="<%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>" rel="Shortcut Icon" />
As it's hard to read, despite shortening the lines, the shortcut icon path is constructed as <%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>
. In the interest of easy maintainability, I'd suggest to build your own theme (almost everybody does this anyway) and just use the standard filename and replace that image in your theme, and you'll be set.
As you ask about "where to put the image in tomcat": In Liferay, you shouldn't expect to serve regular web applications, in fact, themes are typically served from their OSGi contents. You can easily check this by going to the served page and search for favicon
: If the path contains a /o/
, this points to the OSGi engine to serve it, e.g. there's not an equivalent in the Tomcat filesystem (it's bad practice to mock around with those files anyways: Most likely you'll forget them during the next upgrade and loose your changes.
Looking at my stock installation, http://localhost:8080/o/classic-theme/images/favicon.ico
is the place that the favicon is served from, and indeed, there's that /o/
. So the answer is: Add the icon to your own theme, then you don't even need to change its name through the property you found.
But how to create a well maintainable system, with properly separated content (between yours and stock Liferay) is probably out of scope for this answer.
As an extreme, non-recommended, quickfix you might want to set the value in portal-ext.properties to
theme.shortcut.icon=../../../myfavicon.ico
and replace the icon in tomcat's webapps/ROOT/myfavicon.ico
. But don't come crying later, when you accidentally overwrite it in an upgrade.
The icon should be part of your theme. Here's how to figure out what to do: Check Liferay's source code (I have the 7.1 sourcecode here), the results are quite easy to browse through, but I'm shortening the grep output here for clarity:
olaf@tp:~/src$ grep -r "theme.shortcut.icon" .
./portal-kernel/.../PropsKeys.java: public static final String THEME_SHORTCUT_ICON = "theme.shortcut.icon";
./portal-impl/src/portal.properties: theme.shortcut.icon=favicon.ico
...
olaf@tp:~/src$ grep -r "THEME_SHORTCUT_ICON" .
./portal-web/.../themes/top_head.jsp:<link data-senna-track="temporary" href="<%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>" rel="Shortcut Icon" />
As it's hard to read, despite shortening the lines, the shortcut icon path is constructed as <%= themeDisplay.getPathThemeImages() %>/<%= PropsValues.THEME_SHORTCUT_ICON %>
. In the interest of easy maintainability, I'd suggest to build your own theme (almost everybody does this anyway) and just use the standard filename and replace that image in your theme, and you'll be set.
As you ask about "where to put the image in tomcat": In Liferay, you shouldn't expect to serve regular web applications, in fact, themes are typically served from their OSGi contents. You can easily check this by going to the served page and search for favicon
: If the path contains a /o/
, this points to the OSGi engine to serve it, e.g. there's not an equivalent in the Tomcat filesystem (it's bad practice to mock around with those files anyways: Most likely you'll forget them during the next upgrade and loose your changes.
Looking at my stock installation, http://localhost:8080/o/classic-theme/images/favicon.ico
is the place that the favicon is served from, and indeed, there's that /o/
. So the answer is: Add the icon to your own theme, then you don't even need to change its name through the property you found.
But how to create a well maintainable system, with properly separated content (between yours and stock Liferay) is probably out of scope for this answer.
As an extreme, non-recommended, quickfix you might want to set the value in portal-ext.properties to
theme.shortcut.icon=../../../myfavicon.ico
and replace the icon in tomcat's webapps/ROOT/myfavicon.ico
. But don't come crying later, when you accidentally overwrite it in an upgrade.
answered Nov 18 '18 at 11:39
Olaf KockOlaf Kock
37.2k74576
37.2k74576
Thanks, the non-recommended solution worked fine.
– bunjee
Nov 21 '18 at 9:39
@bunjee can you tell me how you changed the favicon. I am trying to figure it out. Your help willbe greatly helpful. Thanks.
– Abhiram
Feb 13 at 9:32
@Abhiram I've been giving a couple of options, and OP has clearly stated, which one (s)he chose.
– Olaf Kock
Feb 16 at 15:57
add a comment |
Thanks, the non-recommended solution worked fine.
– bunjee
Nov 21 '18 at 9:39
@bunjee can you tell me how you changed the favicon. I am trying to figure it out. Your help willbe greatly helpful. Thanks.
– Abhiram
Feb 13 at 9:32
@Abhiram I've been giving a couple of options, and OP has clearly stated, which one (s)he chose.
– Olaf Kock
Feb 16 at 15:57
Thanks, the non-recommended solution worked fine.
– bunjee
Nov 21 '18 at 9:39
Thanks, the non-recommended solution worked fine.
– bunjee
Nov 21 '18 at 9:39
@bunjee can you tell me how you changed the favicon. I am trying to figure it out. Your help willbe greatly helpful. Thanks.
– Abhiram
Feb 13 at 9:32
@bunjee can you tell me how you changed the favicon. I am trying to figure it out. Your help willbe greatly helpful. Thanks.
– Abhiram
Feb 13 at 9:32
@Abhiram I've been giving a couple of options, and OP has clearly stated, which one (s)he chose.
– Olaf Kock
Feb 16 at 15:57
@Abhiram I've been giving a couple of options, and OP has clearly stated, which one (s)he chose.
– Olaf Kock
Feb 16 at 15:57
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328682%2fchange-favicon-in-liferay-7-with-tomcat%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown