Editing ContentΒΆ

*** Settings ***

Resource  plone/app/robotframework/server.robot
Resource  plone/app/robotframework/keywords.robot
Resource  Selenium2Screenshots/keywords.robot

Library  OperatingSystem

Suite Setup  Run keywords  Suite Setup  Test Setup
Suite Teardown  Run keywords  Test teardown  Suite Teardown

*** Variables ***

${FIXTURE}  plone.app.robotframework.PLONE_ROBOT_TESTING
@{DIMENSIONS}  1024  768
@{APPLY_PROFILES}  plone.app.contenttypes:plone-content


*** Keywords ***

Suite Setup
    Run keyword if  not sys.argv[0].startswith('bin/robot')
    ...             Setup Plone site  ${FIXTURE}
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Open test browser
    Run keyword and ignore error  Set window size  @{DIMENSIONS}

Test Setup
    Import library  Remote  ${PLONE_URL}/RobotRemote

    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Remote ZODB SetUp  ${FIXTURE}

    ${language} =  Get environment variable  LANGUAGE  'en'
    Set default language  ${language}

    Enable autologin as  Manager
    ${user_id} =  Translate  user_id
    ...  default=jane-doe
    ${user_fullname} =  Translate  user_fullname
    ...  default=Jane Doe
    Create user  ${user_id}  Member  fullname=${user_fullname}
    Set autologin username  ${user_id}

Test Teardown
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Remote ZODB TearDown  ${FIXTURE}

Suite Teardown
    Run keyword if  not sys.argv[0].startswith('bin/robot')
    ...             Teardown Plone Site
    Run keyword if  sys.argv[0].startswith('bin/robot')
    ...             Close all browsers

Editing Plone content works the same as adding content – usually the data entry and configuration panels for the content are the same for editing as for adding.

Of course, when we edit an item of content, the item already exists. Click “Edit” on the toolbar when you are viewing it, and you will see the data entry panel for the item, along with the existing values of the item’s data.

For an example of something really simple, where editing looks the same as adding, we can review how to edit the default frontpage on a new Plone site.

The Edit panel for a Page shows the title, description and text areas.

Note

If you do wish to give a description, which is a generally a good idea, the description can be text only – there is no opportunity for setting styling of text, such as bold, italics, or other formatting. This keeps the descriptions of Plone content items as simple as possible, and is also required by the Dublin Core standard.

Editing a page

That’s it. Change what you want, for instance changing the description or the content, and save. The content item will be updated in Plone’s storage system. You can repeatedly edit content items, just as you can repeatedly edit files on your local computer.

Note

Note that there is an extra field, called Change Note. Here you can write a short message on why you were editing this, like “updated with our new company motto”. That note will normally not be shown on a public website, but is available for your co-workers to see when they look at the history of a content item.