documentation Plone5
stable
  • Introduction
  • Quickstart
  • Working with Content
    • Introduction
    • Logging In
    • Adding Content
      • Adding New Content
      • Adding Folders
      • What’s in a Web Name?
      • Adding Images
      • Adding Pages
      • Adding Files
      • Adding Links
        • The Link Object in Use
      • Adding Events
      • Adding News Items
      • Setting Basic Properties
      • Restricting Types in a Folder
      • Preparing Images for the Web
      • Adding collections
    • Managing Content
    • Using TinyMCE as visual editor
    • Collaboration and Workflow
    • Using Listings & Queries (Collections)
    • Portlet Management
    • Create and maintain good quality content
  • Adapting & Extending Plone
  • Installing, Managing and Updating Plone
  • Developing for Plone
  • Appendices
  • About this documentation
  • License for Plone Documentation
  • Asking for help
documentation Plone5
  • Docs »
  • Working with Content »
  • Adding Content »
  • Adding Links
  • Edit on GitHub

Adding Links¶

*** 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

In addition to links embedding within pages, Links can be created as discrete content items. Having links as discrete items lets you do things like organizing them in folders, setting keywords on them to facilitate grouping in lists and search results, or include them in navigation.

Add a link by clicking the menu choice in the Add new... menu:

*** Test Cases ***

Show add new link menu
    Go to  ${PLONE_URL}

    Wait until element is visible
    ...  css=span.icon-plone-contentmenu-factories
    Click element  css=span.icon-plone-contentmenu-factories

    Wait until element is visible
    ...  css=#plone-contentmenu-factories li.plone-toolbar-submenu-header

    Mouse over  link
    Update element style  portal-footer  display  none

    Capture and crop page screenshot
    ...  ${CURDIR}/../../_robot/adding-links_add-menu.png
    ...  css=div.plone-toolbar-container
    ...  css=#plone-contentmenu-factories ul
add-new-menu.png

You will see the Add*Link* panel:

*** Test Cases ***

Show new link add form
    Page should contain element  link
    Click link  link

    Wait until element is visible
    ...  css=#form-widgets-IDublinCore-title

    Capture and crop page screenshot
    ...  ${CURDIR}/../../_robot/adding-links_add-form.png
    ...  css=#content
Adding links form

Good titles for links are important, because the titles will show up in lists of links, and because there tend to be large numbers links held in a folder or collection.

Paste the web address in the URL field or type it in. There is no preview feature here, so it is best to paste the web address from a browser window where you are viewing the target for the link to be sure you have the address correct.

The Link Object in Use¶

A link object will behave in the following ways, depending on your login status, or permissions.

  • If you have the ability to edit the link object, when you click on the link object you’ll be taken to the object itself so that you can edit it (otherwise you’d be taken to the link’s target and could never get to the edit tab!)
  • If you don’t have the ability to edit the link object, when you click on the link object you’ll be taken to the target of the link object. Likewise, if you enter the web address of the link object directly in your browser, you’ll be taken directly to the link’s target. The link object in this case acts as a redirect.
Next Previous

© Copyright 2016. Revision 689fc1f1.

Built with Sphinx using a theme provided by Read the Docs.