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:
You will see the Add*Link* panel:
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.