How are the name of a PRPage and the title related?
The name is a unique identifier within its namespace. Think of the
Pier structure as a file-system where everything is a folder. A page
is a folder too, so it can have children. The name would be then the
folder-name.
In the Seaside view the name is used to build the path. Other views
might not need that. The title is something that is displayed in the
user interface. Normally the Seaside view displays the title before
the contents of a page.
Should a PRDocument
object which is hold by the PRPage object be without a title, because the
title is in the PRPage object?
Normally yes.
I assume that only the name of the PRPage
object is used as the reference for links and the title text might differ.
Exactly, if you don't specify a title the name is taken as title of the page.
It is also possible to refer to the title (instead of the name) in
links, but the name is given priority. The title is only used for
convenance. In fact, in the end these strings don't matter, because
Pier stores links as object references.
document: (
PRDocument new
add: (PRParagraph new
add: (PRText content: 'some text');
yourself);
add: ((PRHeader new)
level: 2;
add: (PRText content: 'The heading level 2');
yourself);
add: (PRUnorderedList new
add: (PRListItem new add: (PRText content: 'aaa'));
add: (PRListItem new add: (PRText content: 'bbb'));
add: (PRListItem new add: (PRText content: 'ccc'));
yourself);
add: (PRPreformatted new
add: (PRText content: ' A line with 3 spaces');
add: (PRText content: ' A line with a tab');
yourself);
add: (PRInternalLink reference: 'anotherPage')
yourself
).
Instead of manually building these documents you could directly pass a string:
contents: 'some text
!!The heading level 2
-aaa
-bbb
-ccc
= A line with 3 spaces
= A line with a tab
*anotherPage'
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch