0

How can I change main logo in OpenCms to my company logo ?

The path:

/opencms/export/system/modules/com.alkacon.bootstrap.formatters/resources/img/logo/logo_opencms_png24.png_1704647694.png

Malachi
  • 3,205
  • 4
  • 29
  • 46

2 Answers2

0

I'm new in OpenCms too. I think you want to change the main menu from demo, so you can see the formatter by clickin on the containterpage>edit.

In my case v9 there is a formatter "navigation-main.jsp" this formatter is for elements "bs-navigation".

So in the "navigation-main.jsp" line 31, you have something like this:

<cms:img scaleType="2" scaleColor="transparent" height="40" id="logo-header" src="%(link.weak:/system/modules/com.alkacon.bootstrap.formatters/resources/img/logo/logo_opencms_png24.png:aa1519ad-1abc-11e3-9246-000c29f9a2ec)" alt="Logo"/>

If you don't want the user change the logo, just change the src for your logo company.

If you want the users could changed the logo, just change the src value for ${value.LogoLink} this is the same field from your schema "navigation.xsd" Example:

<cms:img scaleType="2" scaleColor="transparent" height="40" id="logo-header" src="${value.LogoLink}" alt="Logo"/>

depend of the server config (tomcat, jetty, jboss or something else) you will need to delete cache. In the case of jboss de config you need to set the developer mode to see the changes right the way or you need to restart to se the changes.

To delete image cache: go to site:/ in view: Administration>select Cache Administration>click on Image Cache>select a day before today>ok

Sorry for the bad English

FAC
  • 51
  • 5
0

In OpenCms workplace, select site /, then navigate to the folder

/opencms/export/system/modules/com.alkacon.bootstrap.formatters/resources/img/logo/

and replace the file

logo_opencms_png24.png

with your own png (but same file name). (You could backup the original file beforehand).

This way you don't need to touch the jsp file.

Then also make sure you publish the file, by clicking on the file icon, then select "Publish directly". This should then export the file from the OpenCms VFS (Virtual File System) to the RFS (Real File System) and into it's export folder.

This approach above, replacing the image instead of modifying the jsp, is that your logo will then appear anywhere where the logo_opencms_png24.png is being used, and you don't need to modify multiple jsp's.

Piccolo
  • 1,612
  • 4
  • 22
  • 38
Mathias Conradt
  • 28,420
  • 21
  • 138
  • 192
  • I'm going to modify jsp files not only in this case, so I do this combination: 1) I open navigation-main.jsp line 31 and change logo_opencms_png24.png to logo_my.png 2) click "save and exit" 3) open the jsp file again in editor /opencms/opencms/system/workplace/editors/editor.jsp and see no changes! Even if I click "save" without closing the editor, I see again logo_opencms_png24.png instead – Natali Kuprienko May 22 '14 at 07:33
  • "Save without closing the editor" ... yes, you will always keep seeing the OpenCms logo, if you didn't publish yet. You need to save & *publish" the jsp file. Did you do that? – Mathias Conradt May 22 '14 at 11:15
  • Also, try to clear the flex and jsp cache from OpenCms Administration / Cache management. – Mathias Conradt May 22 '14 at 11:15
  • I have done everything that you described, but changes don't save in jsp file (after I open it again). What file permissions should be set to this jsp file? Probably I have not write permissions for this file? – Natali Kuprienko May 23 '14 at 07:12
  • Is it right? Admin Role: Workplace user /system/modules/ +r+v+i – Natali Kuprienko May 23 '14 at 08:19
  • If you are logged in as Admin, you don't need to change any file permissions. They should be correct as is. If you wouldn't have permissions to save, you wouldn't be able to open the editor for that file in the first place. – Mathias Conradt May 23 '14 at 10:30
  • If you have access to the server's file system, you can also do the changes on there, look in the /export folder under /webapps/opencms/. Follow the path to the logo/jsp, change the code there. This is just a hack, but maybe quick solution, as it's hard to see right now what actually goes wrong in editing the jsp. – Mathias Conradt May 23 '14 at 10:32
  • It's interesting, but I can't change only line 31 in navigation-main.jsp. Other lines and other files I change! – Natali Kuprienko May 26 '14 at 08:21
  • I have edited! I have cleared the string "logo_opencms_png24.png:aa1519ad-1abc-11e3-9246-000c29f9a2ec", not only logo_opencms_png24.png. – Natali Kuprienko May 26 '14 at 09:18