I'm new to smalltalk, seaside and pier. I want to use pier to
site, and if possible, I'd like to change the way internal links to
pages are rendered, so that the wiki text:
produces the link:
this is simple to do, have a look #goto: in WAAnchorTag. However I
strongly discourage you doing this, since ...
- it will start a new session every time you click a link.
- you will loose all the state of your application when clicking a
link, e.g. most widgets won't work anymore.
- waste a lot of memory and cpu-time on the server, because the url
has to be parsed and all Seaside components have to be rebuild and
reinitialized on every click.
Both links return the same URL when typed into the browser, so
view is the default command. I've tried searching around for
about this but I couldn't find anything obvious to me. While
source code, I came across WAUrl adaptToContext: and WAAnchorTag
which look potentially relevant, but I'm honestly not sure if I'm
right track. I'd appreciate it if someone could point me in the right
direction. Also, if this is a really bad idea for some reason, that
also be good to know.
Yes, these two methods [1,2] are definitely the ones your are
interested in. Let me try to explain the background of these methods:
Seaside only parses the URL on the first request, else it will only
perform the callback (as defined in  by #registerActionCallback:)
and ignore all the rest.
So why the heck I am doing so many thing with the generated URL, if
Seaside is not using it at all? It basically makes it possible to
preserve some state when bookmarking the URL, when opening the URL
within a new window, or when sending it to friends. If the argument
'_s' (Session) is invalid (mostly because of a timeout, or maybe
because of a session-protector), Pier will try to restore the state
from the URL and bring back the user at the right place.
To conclude, you cannot shorten the URL in the anchors without
 WAAnchorTag>>goto: aContext
"Initialize the receiver to properly activate aContext when being
clicked. This includes a callback and a human-readable and
| actionUrl |
ifFalse: [ ^ self class: 'protected'; url: '#' ].
actionUrl := canvas context actionUrl withParameter: (canvas callbacks
registerActionCallback: [ PRCurrentContext value: aContext ]).
self url: (actionUrl adaptToContext: aContext) displayString
 WAUrl>>adaptToContext: aContext
path := aContext session application baseUrl path copy.
aContext structure parents allButFirst
do: [ :each | self path add: each name ].
aContext command isView
ifTrue: [ self addParameter: 'view' value: aContext command
viewComponentClass name asString ].
self addParameter: 'command' value: aContext command class name