SiteController sessions and flash access


  1. I read in this post from back in '08
    (Accessing Flash/Session in Radiant Tags? - Radiant CMS - Ruby-Forum) that the SiteController had
    sessions disabled by default.

Sessions are enabled in my SiteController (which is good, since I am
doing lots of user-centric stuff). When did that change in the base
Radiant install (or did I turn them on and not remember doing it).

  1. I would like to take advantage of the flash for standard
    informational messages in my UI. But there is no built-in access to the
    flash. Has anyone built a tag to access the flash and would you be
    willing to share it?


My new <r:flash/> tag - perhaps it is of some use:

desc %{
   Returns the requested element of the flash for use in layout/page



 tag "flash" do |tag|
   if key = tag.attr['key']
     flash =[‘flash’]
flash ? (flash[key] || flash[key.to_sym] || ‘’) : ‘’
raise“flash' tag must containkey’ attribute”)

flash[] with :notice, :error, :success keys are already in use by the
radiant admin.
So if you have a user logged into admin and into you custom auth, you
will get msg’s meant for admin interface appear on user side and vice
This, of course, may be something you that you do want or you dont.

For now, I am counting on admin. types (which are us) to be mindful
enough to not be logged into user side.

If I have to, I can add admin. logout logic as a before_filter on the
SiteController, and user logout logic as a before filter on the admin
side of things.