i have read the sections on viewlets and alot of other threads in this
forum and wonder what is the best practice for implementing a sidebar
in my site that has either links or any other layout attributes that
are different from page to page. I see the real use of a viewlet as a
self-sufficient widget.. but i need interaction and communication
between the main event and the viewlet (which content it is to
paint)
Would a sidebar like this be a good candidate for a viewlet? if so,
then how do you run the event in the viewlet that tells the event
handler what current page i am currently on in order to pull the
correct content? i believe someone mentioned using the flash RAM?
does this sound right.
1) main event sets a currentPageID in the flash ram
2) prepareviewlet handler reads the var and runs a query etc to get
variable data that is passed back to veiwlet
3) viewlet loops voer rc.query and paints the links accordingly
could be that some pages do not have a sidebar at all in which case
there the veiwlet or the containing div would need to be suppressed
not currently, (but i am interested to hear what you would say if it were…) because i am experimenting with something else in that direction
i am more looking for a systemic approach to letting a viewlet , in this case a sidebar with lots of links and other stuff – search box etc,-- paint itself by knowing what the current page is.