- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 06:01 AM
Hi,
I am trying to change the logo of a header. For some reason, the logo won't change no matter what I do. I even made a new header and uploaded a completely different logo to no effect. Where are header logos getting overwritten?
Also, I am talking about the CMS header block as so, not the actual banner image:
For example, the olympic logo below won't change on my CMS page no matter what I do.
Thanks.
Message was edited by: Tyler Li
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 07:01 PM
Looks like the script rendering the image is using a static image instead of the one provided in the record. Search your UI Macros table with filter: XML contains fplogo.png
If you find something you might need to update it to use ${current.logo.getDisplayValue()} instead.
Also, a less clean way to do it as the Header record becomes misleading (and this is why you actually struggle updating a simple image) look for Name contains fplogo.png inside your Image library, if you find it then update it with the new logo. If you don't find it you can create an image record with the name fplogo.png and this should overwrite the existing image.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 10:23 AM
When you say removing the logo, you are talking about the code in the UI Macros or the image in the Header record (using Delete)?
If when deleting the logo then it gets updated, it might be a cache issue. Try to clear your cache to see if the logo is updated.
If clearing the cache solves your issue, here is a fix that you can do to avoid clearing the cache of your users.
Change the code (cms_header_logo UI Macro) that displays the logo to make sure the latest version is used instead of the cache:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<j:if test="${current.logo.getDisplayValue() != ''}">
<!-- Retrieve the logo last updated date -->
<g:evaluate var="jvar_logo_updated_on">
var attachment = new GlideRecord('sys_attachment');
attachment.addQuery('file_name', 'logo');
attachment.addQuery('table_name', 'ZZ_YYcontent_block_header');
attachment.addQuery('table_sys_id', current.sys_id);
attachment.query();
if(attachment.next()){
jvar_logo_updated_on = attachment.sys_updated_on;
}
</g:evaluate>
<div class="cms_header_logo" >
<a href="home.do"><img src="${current.logo.getDisplayValue()}?v=${jvar_logo_updated_on}" alt="{gs.getMessage('Home')}" /></a>
</div>
</j:if>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 10:31 AM
I mean the image in the header record.
I have tried clearing my cache.
I'm really puzzled right now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 02:58 PM
Try this:
- Go in your CMS site
- Right click the logo and click on "Inspect Element"
- Copy the src of the image, it should be a sys_id ending with .iix
- In your browser open <instance-name>.service-now.com/the_src_you_just_copied
- You should see your old image (not updated), try to add ?v=1 at the end of the URL
- If you see the updated image then, it is a cache issue and the code I proposed previously should fix it
If this does not give you the updated image, plese copy paste the XML code of both "render_content_block_header" and "cms_header_logo"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 06:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 07:01 PM
Looks like the script rendering the image is using a static image instead of the one provided in the record. Search your UI Macros table with filter: XML contains fplogo.png
If you find something you might need to update it to use ${current.logo.getDisplayValue()} instead.
Also, a less clean way to do it as the Header record becomes misleading (and this is why you actually struggle updating a simple image) look for Name contains fplogo.png inside your Image library, if you find it then update it with the new logo. If you don't find it you can create an image record with the name fplogo.png and this should overwrite the existing image.