I don't see why you can't use sections as Hammett suggested? Define a
#top section and a #bottom section then render them using
Context.RenderSection() and either Context.RenderBody() or another
#body section.

On Thu, Apr 16, 2009 at 3:55 PM, Jan Limpens <[email protected]> wrote:
> look at me, I am soo nasty!
>
>         public override void Render()
>         {
>             CancelView();
>             RenderText(string.Format(@"
> <div class='tile'>
>     <div class='left' style='background-image: url({0})'>
>         <a href='{1}'><span>{2}</span></a>
>     </div>
>     <div class='right'>
>         <p class='article-link'>
>             <a class='info bold no-underline' href='{1}'>{2}</a>
>             <a href='{3}' style='display: none'
> class='popupUrl'>Description</a>
>         </p>", ComponentParams["ImgSrc"], ComponentParams["Url"],
> ComponentParams["Title"], ComponentParams["PopUpUrl"])
>              .Replace('\'', '"'));
>             Context.RenderBody();
>             RenderText(@"
>     </div>
> </div>");
>         }
>
> I hope I find the time to be able to extend mr so code like this can be
> avoided...
>
> 2009/4/16 Jan Limpens <[email protected]>
>>
>> darn, seems this does not work (or nobody does know how...)...
>>
>> 2009/4/15 Jan Limpens <[email protected]>
>>>
>>> so, just to make this extra clear, what I posted earlier _was_ the
>>> viewcomponent's view code.
>>>
>>> this is how I call it in the view
>>>
>>>>
>>>> <%        component Tile, {...@entity: item}: %>
>>>>         bla
>>>> <%        end %>
>>>>
>>> this is the component view
>>>
>>>>>
>>>>> > <div class="tile">
>>>>> >     <div class="left" style="background-image: url(!{ImgSrc})">
>>>>> >         <a href="!{Url}">!{Title}</a>
>>>>> >     </div>
>>>>> >     <div class="right">
>>>>> >         <p class="article-link">
>>>>> >             <a class="info bold no-underline"
>>>>> > href="!{Url}">!{Title}</a>
>>>>> >         </p>
>>>>> >         <div style="display: none">
>>>>> >             <a href="!{PopUpUrl}">Description</a>
>>>>> >         </div>
>>>>> >         <div>
>>>>> >             here should go my body! ${ChildOutput} // edit, but does
>>>>> > not change a thing
>>>>> >         </div>
>>>>> >     </div>
>>>>> > </div>
>>>
>>> I would know how to do this if the viewcomponent's html code was a string
>>> in my Render method, but I don't know how to place the pint in the viewcode
>>> where the body should be rendered. ${ChildOutput} does not print anything.
>>>
>>>
>>> --
>>> Jan
>>
>>
>>
>> --
>> Jan
>
>
>
> --
> Jan
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to