'redirect' switch


Say, after creating a new story you want to redirect the user to the frontpage instead of presenting the rendered story. Because of editor actions are redirects built-in to the app source we need a snip of javascript to make it work the way we want.

We can use the <% response.message %> macro - it usualy displays status messages above the main content area, depending on the action and the success state of the action. That messages are strings, defined in the 'messages.properties' file of the blog-default language. [1]

E.g. successfully creating a new story sets the response.message to the value of 'confirm.storyCreate'.

This is just what we need to create our own redirect-hook. Whenever a new page is loaded, we check for the value of response.message and let our own action roll.

Example code works like so:

...


    

 
Online for 8003 days
Last update: 09.05.08, 08:12
»Preparing for sodium amytal«
status
Youre not logged in ... Login
recent
mks @ 25k posts
    hohoo - looks like [mks] will see its 25.000th...
by KenoshaKid (11.12.07, 15:53)
'redirect' switch Say, after creating
a new story you want to redirect the user to...
by KenoshaKid (02.12.07, 12:54)

Mai 2024
So.Mo.Di.Mi.Do.Fr.Sa.
1234
567891011
12131415161718
19202122232425
262728293031
Dezember
menu
... home
... topics
... Home
... Tags


... antville home

RSS Feed

Made with Antville
powered by
Helma Object Publisher