On 5/18/07, <b class="gmail_sendername">James Britt</b> <<a href="mailto:james.britt@gmail.com">james.britt@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi.<br><br>I've just started using MasterView and I'm still groping around through<br>what docs there are. I really dig it, but assorted little things are<br>tripping me up as I get better acquainted with it.</blockquote>
<div><br><br>That's wonderful! We're glad to hear it.<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I have some questions. The first is, is there a good way to search the
<br>mailing list archives? That may help keep me from asking questions that<br>have already been answered. (Also, is there a way to read the list<br>archives without having to use the rubyforge page?)</blockquote><div><br>
<br>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.
<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">My second question has to do with populating layouts that use multiple<br>yield sections:
<br><br>I have some rhtml templates that used a general layout file that has a<br>section that looks like this:<br><br># in layouts/default.rhtml<br> <div class="yui-u first" id="main"><br> <%= yield %>
<br> </div><br> <div class="yui-u" id="sidebar"><br> <%= yield :sidebar %><br> </div></blockquote><div><br><br>This should be simply handled by something like <br><br>
<div class="yui-u first" id="main" mv:content="yield"><br> This can now just be dummy data<br> </div><br> <div class="yui-u" id="sidebar" mv:content="yield :sidebar">
<br> More dummy content that will be replaced<br> </div><br>
<br> <br><br>mv:content will replace the contents of the element it occurs on with the <%= attrValue %><br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Each page view then has its main layout content, plus a :sidebar<br>section, somewhat like this:<br><br># default/somepage.rhtml<br><br><h2>The layout header</h2><br><div>Some main section stuff</div>
<br><br> <%content_for :sidebar do%><br> <div><h3>Learn more ...</h3><br> <p>Learn more about Foo ...</p><br> <p>Learn more about Bar ...</p><br> </div>
<br> <%end%></blockquote><div><br><br>This should get you what you want<br><br><h2>The layout header</h2><br><div>Some main section stuff</div><br><br> <div mv:block="conent_for :sidebar do">
<br> <h3>Learn more ...</h3><br> <p>Learn more about Foo ...</p><br> <p>Learn more about Bar ...</p><br> </div><br> <br>
<br>Note that the mv:block will put the necessary 'end' or closing bracket for you. The code will surround the div that is in.<br><br>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
<a href="http://localhost:3000/masterview/interact">http://localhost:3000/masterview/interact</a> or choose the link off the main <a href="http://localhost:3000/masterview">http://localhost:3000/masterview</a> page.<br><br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>I can only get both the main view content and the sidebar content<br>written out to the generated template if they are wrapped in a common
<br>mv:generate section. But in actual use, there is layout markup between<br>them; the resulting MasterView html ends up with them in the wrong<br>place, not within their corresponding mv:replace markup.</blockquote><div>
<br><br>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.
<br><br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hopefuly I've manage to explain what I'm trying to so and what results
<br>I'm getting.</blockquote><div><br><br>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.
<br><br>Thanks,<br><br>Jeff</div></div><br>