Attention

This document was written for an old version of Plone, Plone 3, and was last updated 1204 days ago.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

Adding, Editing & Publishing HTML pages

by Robert Nagle last modified Feb 04, 2009 02:35 AM
Using Enfold Desktop to edit and publish HTML pages.

Content Types Supported by Enfold Desktop

 Built in file types supported by Enfold Desktop include:

  • Plone document (HTML, txt). This is equivalent to the "Page" content type from the Add dropdown list.
  • Images (jpg, png)
  • Event (.ics files)
  • File (.pdf, .doc., .mp3, etc)
  • News Item (HTML, txt)

Also: File Templates (a special type supported by Enfold Server) is supported.

Note: Enfold Desktop supports only the built-in content types listed above. If your site has a third party product installed with another content type, this will not be supported. It will not work. Content types other than the built-in ones which come with Plone (i.e., from third party products) will not be editable or even visible in Enfold Desktop.

Editing HTML Files in Enfold Desktop: Caveats

When you edit a Plone document or html file within Enfold Desktop, it's important to understand what is going on.

Enfold Desktop is using Web Dav protocols to sync local content with remote content.

With Plone, there is one more "complicating factor." If you added a typical html file to a Plone folder using Desktop's drag-and-drop feature, the html page will not render exactly as is; on the Plone site, this html will be presented with a Plone skin (i.e. template). This Plone skin will include cascading style sheets (.css files) which will determine the final presentation of the html code.

Plone's default behavior is to strip out certain HTML elements from the Plone document and render it using Plone's template and style sheets. Here are some things you may notice:

  • Most of the tags lying above the <body> tag (i.e., <html>, <head>, <body>) will be stripped out. The Plone Administrator can tweak which HTML elements the user can insert into documents by going to Plone Site Setup --> HTML Filtering. Among the Kupu configuration options (Plone Site Setup --> Visual Editor), there is an option to Filter HTML in source view.
  • When Enfold Desktop opens up a Plone document/page for editing, the editor will show a fragment of the entire HTML page. Desktop will ignore the general site template and just expose you to the HTML fragment which is editable. Similarly, if you create a new HTML document with Desktop, Plone will strip HTML elements according to its HTML Filtering rules. (Read more about how Plone filters HTML tags).
  • If you are using Enfold Desktop to create an html file (i.e., Plone Document) from scratch, it's not necessary to have a valid HTML document which can stand alone on its own (although it won't hurt). Instead, the file can just be a HTML fragment containing content which would normally be contained within an html BODY tag.
  • Scripts. Even if they are included in the HEAD section, scripts will be deactivated.
  • CSS: inline styles will be rendered normally. However, references in the link section of the HEAD to a separate css page will be rendered inoperative.

 

Kupu or Enfold Desktop: Which to use?

Kupu is a powerful visual editor and contains lots of configurable options by the site administrator. Among Kupu's most powerful features is the ability to add div elements with specific css classes using the dropdown box.  You can also customize the toolbar buttons and have a variety of image options. (See Olha Pelishok's excellent tutorial on   Content Creation with Kupu and Other WYSIWYG Editors for more information).

Enfold Desktop is an ideal tool to use when you are handling a variety of content items (including binary files).  On the other hand, Kupu is ideal if you are just handling one page at a time and if you need versioning.

Use Enfold Desktop  Use Kupu
If you need to move multiple files into a Plone folder, use Enfold Desktop. If your Plone page will contain links to images and other pages on your Plone site, use Kupu. Kupu lets you browse/search for other resources on the Plone site. In Enfold Desktop, you would need to hard code the URL's manually.
If an item requires a lot of time to edit and you wish to keep it open and lock it, use Enfold Desktop. If you need to keep a change log for each edit, use Kupu. The latest version supports versioning but does not allow you to make change notes.

If you need the ability to quickly view the publication state of all items in a Plone folder and the ability to edit standard metadata, use Enfold Desktop. If you wish to add/edit a content type other than the built in Plone types, use Kupu.
 If you need to browse through several folders while looking for something, use Enfold Desktop.
 If you need to rearrange lots of files and pages inside  your site, use Enfold Desktop.
 If you have an Administrator account and need a quick way to  share documents with different users and groups, use Enfold Desktop. (An Administrator account is one with access to Plone Site Setup).
 If you are administrator and want a quick way to view settings in the ZMI, use Enfold Desktop. (Note: other than viewing files, using Enfold Desktop to edit objects normally found in the  ZMI  is not recommended).

 

 Editing HTML Files with Enfold Desktop

The  Quick Tour with Screenshots covers the typical way you would edit a simple text or HTML file with Enfold Desktop.  Here are other things to know:

  • HTML files don't need to end in the .html extension (This is a Plone thing and not really an Enfold Desktop thing).  Here is how Enfold Desktop handles file names, titles and description.
  • By default, a Plone File type (such as a .jpg or .mp3 file)  does not have a workflow state (This may depend on your server's particular configuration).  So Enfold Desktop will not normally give you an option  to  Submit for Publication or Publish.  That will be covered in the next section  Uploading & moving multiple files.

 

Starting an Edit session from your browser

 

After your System Administrator installs the Server Component on your Plone site, you may notice a link on the bottom of almost every page. (Note: you will not see it unless you are logged on to the website).

The link will say "Edit Using Enfold Desktop."

editing using Enfold Desktop

  • Click on this link on the web page.
  • You will briefly see a free-floating bubble indicating that Enfold Desktop is starting.
  • You will be prompted for user name and password. (If you have not previously set up a session for this website, one will be created for you using this login information).
  • An application will open for editing this document.
  • Edit the document as you wish and Save.
  • Open  Enfold Desktop and browse to the directory containing the file you just finished editing. (You may need to go back to the browser and look at the URL if you don't remember the exact URL path).
  • When you open up the correct directory, your file will have a green + icon. Right-click and choose check in.
    1. Changing a Document's State with Enfold Desktop

      Tip: To see workflow states, make sure that Windows Explorer/Enfold Desktop is using Detailed view. (View --> Details, or select View --> Details in the right-click menu options for a folder). 

      Enfold Desktop uses right-click options to let you change an item's state.

      By default, when you add a new document or file in a Plone folder, it will be marked as Private. Depending on the permissions for your user account, you may have the ability to publish the item or submit for publication. (If you submit for publication, you will need to wait for it to be approved by someone with greater permissions).

      After an item has already been published, you can change it again by editing it (right-click on the file, choose Edit). You can also just copy over the HTML  from any folder on your local machine  to the Plone folder (Control-C to copy the file from the other location, Control-V to move it into the Plone folder).

      When you are editing/updating an item which has been previously published, you will notice that a green plus sign icon (+) appears by the file. This icon is supposed to remind you to check in this file again. This check in procedure is mandatory and confirms that the current state of the item is how you wish it to be published.  Tip: To find out if you have any files or pages locked, click on the Local directory in Enfold Desktop. That will list any items you currently are working on and show whether they have been modified or need to be checked in.

      Note: By default, the File type does not have a workflow state. (Read more about Files and publishing).

      Resolving Locks

      Plone 3.x has built-in support for file locking. That means that more than one user cannot attempt to edit or save the file at the same time.

      In fact, Enfold Desktop faces another kind of locking challenge. If you are trying to edit a Plone document locally, how can Plone be informed so another user won't try to edit it at the same time?

      First, when you open something in Enfold Desktop for editing, this state will be communicated to the Plone site itself. Another user trying to edit this same file will see this message:

      locked message

      The Plone system administration can configure the default time locks to expire (default is 12 minutes), so if someone forgets to save or check in, a Plone document will still be available.  Some kinds of users have the ability to break Plone locks. This means that locks do not protect you totally from accidents.

      Consider this "dangerous" scenario.

      Suppose you use Enfold Desktop to edit a file. By the time you get around to checking in the changes, perhaps the lock expired or another user has overridden it. Enfold Desktop is intelligent enough to detect this conflict, but not intelligent enough to figure out a solution. The best it can do is to give you the option to Save (thus overwriting the recent changes) or Cancel without Checking in.

      There are two ways to minimize the possibility of losing your edits.

      First, after you have saved, you can cancel the check in action (described below). This lets you safeguard your local copy. Perhaps you can use a free third party application like Winmerge to compare the two different versions to see what you could be overwriting. You would need to update (i.e., merge) your local version with the recent remote changes manually.

      Second, if the other user was using Kupu to edit the document, the history tab (i.e.,  Plone  versioning)  would let  you do rollbacks of any edits you have made. This still doesn't solve the problem of merging changes between two versions. But at least it gives you a safety net.

      Resolving Locks

      Some kinds of user accounts have the ability to "break" locks with the Plone Lock Manager. You can access this by clicking on the web page corresponding to the Plone document and clicking the Lock Manager option at the bottom of the page.

      editing using Enfold Desktop

      Note for Administrators: In Plone go to the folder containing the problem file and click on the lock icon, this will take you to the control panel and show you locks for that folder so you can clean them out. When you do this, the user with the lock has now lost the lock. When they check in a file it will try to lock and determine if the file has changed, if it has the user will be prompted for which action to take.

      lock manager

      More about Locking

      Locking is the process of locking or unlocking a file. When a file is locked, only you can edit it. When it is unlocked anyone can edit it. Files are automatically locked for you when you check them out. They are also automatically unlocked when you check the file back in to the server.

      You need to have permissions on a file to be able to check it out and edit it. If you can't edit a file, you won't be to lock it either. So what can be edited depends upon workflow; for example a file in a visible workflow state can be edited and locked.

      If you have locked a file this means that no one else can edit the file. This also means if someone else has locked a file you want to edit, you will have to contact them before you can check it out. For this when you have finished with the file, check it in so the lock can be cleared and others can use it.  The troubleshooting guide contains a list of lock errors and how to resolve them

      Troubleshooting Problems

      For the  most up-to-date troubleshooting information, see the Enfold Desktop troubleshooting guide , the list of known issues  and Enfold Desktop FAQ

      Sometimes people attribute problems to Enfold Desktop when in fact the problem  may reside with Plone server itself.  


      Contribute

      Something wrong or out of date? Anybody can edit or create a new article in the knowledge base. Simply create an account on this site, log in, and click the Edit button to contribute.