Gallery Overview

From OpenCms Wiki
Revision as of 18:10, 29 August 2007 by NiK0laI (Talk | contribs)
Jump to: navigation, search

Galleries can make editing pages for your users a lot easier. These can include important images or commonly used HTML snippets, and are much easier to sort through than just looking through the file system. Plus, image galleries will show previews of the image.

Adding an HTML Gallery

  • Navigate to the folder where you want the gallery
  • Select New->Extended Folder
  • Select HTML Gallery
  • Once the folder is created, add a plain text file to the folder, and put some HTML into it
  • Create one file for each HTML snippet

Now, when you go to the editor, and choose HTML Galleries from the toolbar buttons, you can browse through your HTML snippets, and select one to get added to your page.

You can even put JSP files into the HTML Gallery, and include dynamically generated HTML.

NOTE: There's an issue sometimes with FCKEditor that causes your newly inserted HTML snippet to disappear. A work around is to insert a carriage return at the top of the file. You can alternatively edit the default body to have it in place too.

Image Galleries

There is an issue with FCKEditor and image galleries where if you place an image gallery somewhere on your OpenCms install other than /system/galleries/ none of the images are displayed in the editor. They will display in the site fine, but when editing content you will get a broken image. The first time you insert the image it will display fine, however when editing the page in the future the broken image appears. The solution is as follows:

Edit the file /system/workplace/editors/fckeditor/customconfig.js

  • Add the import: org.opencms.site.CmsSiteManager
  • Change the line: String site = OpenCms.getSiteManager().getWorkplaceServer(); to:

String site = CmsSiteManager.getCurrentSite(cms.getCmsObject()).getUrl();

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox