Hi folks,

I am trying to build a flexible 'widgetised' layout where the data for which
blocks go in which segments is held in the database.

My current logic is to:

   - read layout from the database and then load action stack with a
   controller/action for each block
   - in my front controller plugin, on routeStartup, 'open bookend' each
   segment with required markup
   - loop through the blocks found in the database and write each block
   output to the correct segment with action stack
   - in my front controller plugin, on routeShutdown, 'close bookend' each
   segment with necessary markup.
   - layout is finally renderred from the segments (top, left, default,
   right, bottom) - where default is the output from the original
   controller/action combo in the url

The block data in the database tells me not just which controller/action
combo, but also the segment to write to. This is passed to action stack as a
param.

I have created my own action controller which gets the segment param which
was passed to action stack and sets the segment to write the block to in
pre-dispatch.

It's working reasonably well - except the end result is, for example with
the top segment:

opening bookend, closing bookend, block 1, block 2, block 3

What I want is:

opening bookend, block 1, block 2, block 3, closing bookend

I realise I haven't posted code yet ( can do that next, but didn't want to
post a huge message). At this stage i'm wondering if anyone can see a flaw
in my logic, am I misunderstanding the dispatch sequence?

Any help / clues VERY gratefully received - i'm stuck!

cheers,

dan

Reply via email to