From djlewis at acm.org Tue May 15 17:40:32 2007 From: djlewis at acm.org (Deb Lewis) Date: Tue, 15 May 2007 14:40:32 -0700 Subject: [Masterview-users] RailsConf Message-ID: <000f01c79739$aa1e7000$6701a8c0@cx797990aDLI9> If you're already using or are simply interested in learning more about MasterView, both Jeff and I will be at RailsConf this week and would very much like to meet folks to get feedback, suggestions, ideas... We're both staying at the DoubleTree a few blocks from the OCC and will be around for the duration. ~ Deb ===================================== Deb Lewis MasterView core team http://masterview.org mailto:djlewis at acm.org ===================================== From james.britt at gmail.com Fri May 18 23:34:42 2007 From: james.britt at gmail.com (James Britt) Date: Fri, 18 May 2007 20:34:42 -0700 Subject: [Masterview-users] Saying hello, and some questions Message-ID: <464E7052.70404@gmail.com> Hi. I've just started using MasterView and I'm still groping around through what docs there are. I really dig it, but assorted little things are tripping me up as I get better acquainted with it. I have some questions. The first is, is there a good way to search the mailing list archives? That may help keep me from asking questions that have already been answered. (Also, is there a way to read the list archives without having to use the rubyforge page?) My second question has to do with populating layouts that use multiple yield sections: I have some rhtml templates that used a general layout file that has a section that looks like this: # in layouts/default.rhtml
<%= yield %>
Each page view then has its main layout content, plus a :sidebar section, somewhat like this: # default/somepage.rhtml

The layout header

Some main section stuff
<%content_for :sidebar do%>

Learn more ...

Learn more about Foo ...

Learn more about Bar ...

<%end%> I cannot figure out how to do this in MasterView. I keep getting almost, but not quite, results. What sort of works is this in MasterView

The layout header

Some main section stuff
{{{content_for :sidebar do}}}

Learn more ...

Learn more about Foo ...

Learn more about Bar ...

{{{end}}}
I can only get both the main view content and the sidebar content written out to the generated template if they are wrapped in a common mv:generate section. But in actual use, there is layout markup between them; the resulting MasterView html ends up with them in the wrong place, not within their corresponding mv:replace markup. Hopefuly I've manage to explain what I'm trying to so and what results I'm getting. Thanks, James Britt From jeff.barczewski at gmail.com Sat May 19 02:23:16 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Sat, 19 May 2007 01:23:16 -0500 Subject: [Masterview-users] Saying hello, and some questions In-Reply-To: <464E7052.70404@gmail.com> References: <464E7052.70404@gmail.com> Message-ID: <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> On 5/18/07, James Britt wrote: > > Hi. > > I've just started using MasterView and I'm still groping around through > what docs there are. I really dig it, but assorted little things are > tripping me up as I get better acquainted with it. That's wonderful! We're glad to hear it. I have some questions. The first is, is there a good way to search the > mailing list archives? That may help keep me from asking questions that > have already been answered. (Also, is there a way to read the list > archives without having to use the rubyforge page?) I think we do need to summarize some FAQ's in our documentation to make that easier. I think that Rubyforge used to have a search for the archives, however my connection right now here at the hotel from RailsConf is too slow for me to investigate tonight. I'll have to answer that question tomorrow after I take a look at what is currently up there now. My second question has to do with populating layouts that use multiple > yield sections: > > I have some rhtml templates that used a general layout file that has a > section that looks like this: > > # in layouts/default.rhtml >
> <%= yield %> >
> This should be simply handled by something like
This can now just be dummy data
mv:content will replace the contents of the element it occurs on with the <%= attrValue %> Each page view then has its main layout content, plus a :sidebar > section, somewhat like this: > > # default/somepage.rhtml > >

The layout header

>
Some main section stuff
> > <%content_for :sidebar do%> >

Learn more ...

>

Learn more about Foo ...

>

Learn more about Bar ...

>
> <%end%> This should get you what you want

The layout header

Some main section stuff

Learn more ...

Learn more about Foo ...

Learn more about Bar ...

Note that the mv:block will put the necessary 'end' or closing bracket for you. The code will surround the div that is in. Also something that can be helpful when learning or testing new templates, you can paste snippets into the interactive render page on the MasterView admin pages and see quickly what ERB will be generated. To do this just fire up your local rails project and hit http://localhost:3000/masterview/interact or choose the link off the main http://localhost:3000/masterview page. > > I can only get both the main view content and the sidebar content > written out to the generated template if they are wrapped in a common > mv:generate section. But in actual use, there is layout markup between > them; the resulting MasterView html ends up with them in the wrong > place, not within their corresponding mv:replace markup. Not sure if I got this fully, but just like with normal rails, you can use layouts, and partials to share content across multiple views (everything should work the same way if similar erb is generated. Maybe a code example to illustrate would help me understand what is happening. If you would like to zip something up and attach, I would be glad to take a look. Hopefuly I've manage to explain what I'm trying to so and what results > I'm getting. No problem, we know that one of our biggest needs is to improve our documentation, examples, and screencasts. So keep your questions coming and that will help us figure out where we need to focus the efforts. Thanks, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070519/e86ba3a2/attachment.html From james at neurogami.com Sat May 19 12:31:36 2007 From: james at neurogami.com (James Britt) Date: Sat, 19 May 2007 09:31:36 -0700 Subject: [Masterview-users] Saying hello, and some questions In-Reply-To: <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> References: <464E7052.70404@gmail.com> <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> Message-ID: <464F2668.6070207@neurogami.com> Jeff, thanks for the help. I followed your examples, but now get very peculiar HTML for my page preview after importing the layout and regenerating the pages. Here is an example. The layout (example1.html): Foo

Welcome to my layout

Here is the initial page1.html

The Page 1 Subheader!

Page 1 sidebar

If I now tell MasterView to update the templates, the rhtml generation is fine, but the new, auto-generated HTML for page1.html ends up with two sections (each one a copy of layouts/example.rhtml), with the original page1 html in the middle: [All of example1.html] [page1.html] [All of example1.html] The odd thing is, this resulting masterview template is not valid XML, as it has mulitple root nodes, but it does not raise any errors. (I've attached my HTML layout and page view as a tar file.) Thanks, James -------------- next part -------------- A non-text attachment was scrubbed... Name: mvexample.tar Type: application/x-tar Size: 10240 bytes Desc: not available Url : http://rubyforge.org/pipermail/masterview-users/attachments/20070519/034fbbc6/attachment-0001.tar From jeff.barczewski at gmail.com Mon May 21 00:53:42 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Sun, 20 May 2007 23:53:42 -0500 Subject: [Masterview-users] Saying hello, and some questions In-Reply-To: <464F2668.6070207@neurogami.com> References: <464E7052.70404@gmail.com> <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> <464F2668.6070207@neurogami.com> Message-ID: <19cda190705202153x7452faa7p51a8bc1b75362b22@mail.gmail.com> On 5/19/07, James Britt wrote: > > Jeff, thanks for the help. > > > I followed your examples, but now get very peculiar HTML for my page > preview after importing the layout and regenerating the pages. > > Here is an example. > > The layout (example1.html): > > "http://localhost/TR/xhtml1/DTD/xhtml1-strict.dtd"> > xml:lang="en" mv:generate='layouts/example1.rhtml'> > Foo > >
>
>
>
>

Welcome to my layout

>
>
> >
>
> > > > > > Here is the initial page1.html > > > >

The Page 1 Subheader!

>
>

Page 1 sidebar

>
>
> > > > If I now tell MasterView to update the templates, the rhtml generation > is fine, but the new, auto-generated HTML for page1.html ends up with > two sections (each one a copy of layouts/example.rhtml), with the > original page1 html in the middle: > > > [All of example1.html] > [page1.html] > [All of example1.html] > > The odd thing is, this resulting masterview template is not valid XML, > as it has mulitple root nodes, but it does not raise any errors. > > (I've attached my HTML layout and page view as a tar file.) > > Thanks, Hmm. I'll take your examples and test to see what is going on. I don't see anything obvious that is wrong. I should be able to get you a response tomorrow, getting ready to board a plane in a short while. Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070520/a3f442f4/attachment.html From james at neurogami.com Mon May 21 01:00:49 2007 From: james at neurogami.com (James Britt) Date: Sun, 20 May 2007 22:00:49 -0700 Subject: [Masterview-users] Saying hello, and some questions In-Reply-To: <19cda190705202153x7452faa7p51a8bc1b75362b22@mail.gmail.com> References: <464E7052.70404@gmail.com> <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> <464F2668.6070207@neurogami.com> <19cda190705202153x7452faa7p51a8bc1b75362b22@mail.gmail.com> Message-ID: <46512781.2000805@neurogami.com> Jeff Barczewski wrote: > ... > Hmm. I'll take your examples and test to see what is going on. I don't > see anything obvious that is wrong. I should be able to get you a > response tomorrow, getting ready to board a plane in a short while. > Thanks very much. I've been trying different things, and looking to see if perhaps I've screwed something up. Basically, though, it seems that the use of "yield :foo" isn't quite working. James From jeff.barczewski at gmail.com Tue May 22 10:49:41 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Tue, 22 May 2007 09:49:41 -0500 Subject: [Masterview-users] Saying hello, and some questions In-Reply-To: <46512781.2000805@neurogami.com> References: <464E7052.70404@gmail.com> <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> <464F2668.6070207@neurogami.com> <19cda190705202153x7452faa7p51a8bc1b75362b22@mail.gmail.com> <46512781.2000805@neurogami.com> Message-ID: <19cda190705220749i134ead6cia17aad0b2f8bd8a0@mail.gmail.com> On 5/21/07, James Britt wrote: > > Jeff Barczewski wrote: > > > ... > > Hmm. I'll take your examples and test to see what is going on. I don't > > see anything obvious that is wrong. I should be able to get you a > > response tomorrow, getting ready to board a plane in a short while. > > > > Thanks very much. I've been trying different things, and looking to > see if perhaps I've screwed something up. Basically, though, it seems > that the use of "yield :foo" isn't quite working. Just got back in the office, yesterday was a travel recovery day. That's what I get for taking the redeye out. Guess I must be getting old, I don't recover as quickly from being up all night as I used to :-( Anyway, I will look at this today, and determine what the issue is. This should certainly work. Blessings, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070522/b5960c4b/attachment.html From jeff.barczewski at gmail.com Wed May 23 08:35:29 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Wed, 23 May 2007 07:35:29 -0500 Subject: [Masterview-users] Saying hello, and some questions In-Reply-To: <19cda190705220749i134ead6cia17aad0b2f8bd8a0@mail.gmail.com> References: <464E7052.70404@gmail.com> <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> <464F2668.6070207@neurogami.com> <19cda190705202153x7452faa7p51a8bc1b75362b22@mail.gmail.com> <46512781.2000805@neurogami.com> <19cda190705220749i134ead6cia17aad0b2f8bd8a0@mail.gmail.com> Message-ID: <19cda190705230535y1e62a9f9g7560a55a6d3702da@mail.gmail.com> On 5/22/07, Jeff Barczewski wrote: > > > > On 5/21/07, James Britt wrote: > > > > Jeff Barczewski wrote: > > > > > ... > > > Hmm. I'll take your examples and test to see what is going on. I don't > > > see anything obvious that is wrong. I should be able to get you a > > > response tomorrow, getting ready to board a plane in a short while. > > > > > > > Thanks very much. I've been trying different things, and looking to > > see if perhaps I've screwed something up. Basically, though, it seems > > that the use of "yield :foo" isn't quite working. > > I just realized that I misunderstood the problem. Originally I thought you were referring to the rhtml generation not working properly but actually the issue is within the rebuild template functionality. Sorry about that, I should have read your email slower. I have confirmed the same results you got and now will proceed to find a fix. I'll also work up a test case so we can be sure it remains fixed. Thanks, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070523/80f6b805/attachment.html From jeff.barczewski at gmail.com Wed May 23 10:34:56 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Wed, 23 May 2007 09:34:56 -0500 Subject: [Masterview-users] Saying hello, and some questions In-Reply-To: <464F2668.6070207@neurogami.com> References: <464E7052.70404@gmail.com> <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> <464F2668.6070207@neurogami.com> Message-ID: <19cda190705230734r6a36ea20q5ca025da4bbc3942@mail.gmail.com> On 5/19/07, James Britt wrote: > > > The layout (example1.html): > > "http://localhost/TR/xhtml1/DTD/xhtml1-strict.dtd"> > xml:lang="en" mv:generate='layouts/example1.rhtml'> > Foo > >
>
>
>
>

Welcome to my layout

>
>
> >
>
> > > > > > Here is the initial page1.html > > > >

The Page 1 Subheader!

>
>

Page 1 sidebar

>
>
> James, I didn't catch it earlier, but the simple solution is to add a mv:generate="something" to your layout on or inside your yield. Also for this to work properly we need to use the mv:gen_replace="yield" if we are doing it on the same element as the yield (otherwise the yield would occur in the other file, where as mv:gen_replace makes it happen in the outer file). MasterView was assuming that every template in a rails environment has content to render in addition to potentially generating a layout. So instead of having a file that only generates the layout. If you have it generate the layout and one of the view pages, then everything will work fine. The assumption is based on us wanting to have the minimum number of files, so we expected to make use of every one (to generate a view file in addition to potentially a layout). Foo

This will be page0 content

In the above example I added a mv:generate="example/page0.rhtml" to the same line as the yield. Now when you rebuild it knows by the context/file switch that this is where the view starts. We definitely need to document this better, and if nothing else indicate an error condition when trying to rebuild. Maybe we can clean this up a bit and make it simpler, too. Anyway let me know if this gets you going again. Thanks, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070523/25758963/attachment.html From jeff.barczewski at gmail.com Sun May 27 13:30:31 2007 From: jeff.barczewski at gmail.com (Jeff Barczewski) Date: Sun, 27 May 2007 12:30:31 -0500 Subject: [Masterview-users] Saying hello, and some questions In-Reply-To: <4658C2E3.2050803@neurogami.com> References: <464E7052.70404@gmail.com> <19cda190705182323u11e19252n24f2c8fdf6f1b176@mail.gmail.com> <464F2668.6070207@neurogami.com> <19cda190705230734r6a36ea20q5ca025da4bbc3942@mail.gmail.com> <4658C2E3.2050803@neurogami.com> Message-ID: <19cda190705271030u4b6f9b49oc3df51c99838d450@mail.gmail.com> On 5/26/07, James Britt wrote: > > Using the previous page1.html example, your modified example.html > generates a new page1.html that does not follow the layout of > example1.html. The new page1.html has the fake sidebar div and its > content from example1.html, and places the page1.html sidebar content > alongside the the rest of the page1.html content. James, I believe I understand now. The examples below will create the proper rhtml with a layout and sidebar which will work at runtime, but we are not getting the proper content to work with at design time. PS. There was a bug in the mv:gen_replace="yield" not outputting <%= yield %> it was outputting <% yield %>. Also we were losing the doctype in rebuilds too. These are fixed in 0.3.3 (trunk) which I will attempt to release today. So while we can obtain a running system with layout and sidebar working properly, we are not getting what we expect to design with in the html templates. This is still an issue that I overlooked originally. One work around is to take the sidebar out of the layout and to simply make it part of the view page and then it will work as you would expect. However I will ponder this and see if I can come up with a better solution that allows you to use sidebar or other yields in the layout and also work with these at design time in the other html pages. Sorry it took me a while to understand what you were illustrating. I am going to do a little more testing of 0.3.3 and then release it out so everyone can get the pending fixes, then I'll see what I can come up with to solve the additional yield design time problem. Here is the example code that will work with 0.3.3 to generate layout with sidebar (but at design time the sidebar content follows the other content rather than putting it where it should be in the view) example.html --------- Foo

Welcome to my layout

page1.html ------------

The Page 1 Subheader!

Page 1 sidebar

page1.html (after rebuilding (synchronizing)) ---------------- Foo

The Page 1 Subheader!

Page 1 sidebar

Note that in the rebuilt source, you actually have the sidebar from the layout and you have the content that will be in page1's sidebar at runtime but it is still in the view. So ideally we would pull this out and put it where it should go for design time. -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070527/76a673b2/attachment-0001.html