Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
...you get the idea.<Frameset rows="80%,20%"> <Frameset> <Frame src="<% $m->call_next(%args) %>"> </Frameset> <Frameset> <Frame src="footer.html"> </Frameset> </Frameset>
with deepest respect,
Mark
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::Mason and Frames
by jreades (Friar) on Dec 04, 2002 at 14:56 UTC | |
Is this some kind of global template that you're working with here? What you're currently doing is forcing the next component in the chain to return a URL, which seems like it probably isn't what you want since the next one in the chain is likely either another autohandler, a dhandler, or a page. First off, why use frames at all when you're using Mason? You can simply turn the footer into a component that outputs HTML, and call it from the autohandler like so:
Come to think of it, I think it's highly likely you'll get caught in some type of endless recursion unless you configure Mason so that it handles only files of type .mhtml, and then have your next component return links to files of type html which wouldn't be handled by Mason. | [reply] [d/l] |
by Anonymous Monk on Dec 04, 2002 at 18:22 UTC | |
| [reply] |
|
Re: HTML::Mason and Frames
by sharkey (Scribe) on Dec 04, 2002 at 18:53 UTC | |
So don't try to do framesets (client-side) as a mason autohandler (server-side). If you must use framesets, then forget the autohandler for a moment, because the client needs to fetch the frameset separately from any embedded frames. So your referring link will need to point to the frameset, and the "frame src" tags will link the the content pages, which should NOT inherit from the frameset page. | [reply] |
by Anonymous Monk on Dec 04, 2002 at 19:32 UTC | |
| [reply] |
|
Re: HTML::Mason and Frames
by TGI (Parson) on Dec 05, 2002 at 02:44 UTC | |
You are making the same mistake I see so many new web programmers make, you are getting confused about which pieces in the client-server system do what, and when. Relax, and take a deep breath and forget what you think you know. Let's look at this situation logically: Given the above facts, lets think about what happens when you enter a URL into your browser that points to a frameset containing some text and pictures. In your case you are going to be using Mason to the magic URL to HTML transformation on the server side. So let's see what your components will generate: my_file.html footer.html autohandler
If you request my_file.html you will get: Which will cause your browser to ask for footer.html. footer.html will come back as: Which will in turn request footer.html again and you get an infinite number of broken frames. Not quite what you were looking for, I think. Mason is a great way to avoid the need to use frames. Consider this autohandler and example components. Here's how the pieces should be laid out: / <-- This is the mason component root. |- html/ <-- This is Apache's document root. | |- autohandler | |- frame.html | \- index.html \- cmp/ \- footer.mas footer.mas can be the exact same as the footer above. I won't repeat that here. Let's look at index.html: Now for the autohandler:
A request for main.html will get html that looks like:
If you must use a frameset, think about it some more, you probably don't. If you still must, then you need to make sure that your autohandler does not perform content wrapping on your frames file. Here's what that looks like:
Remember that the documents called up by the frames will use mason's content wrapping and will be processed through any autohandlers that might apply. Check out the Mason book that just came out. It is quite good. The online docs are also excellent. As a bonus, the folks on the mailing list are quite helpful, too. You can find out about all this stuff at MasonHQ. PS, I haven't tested any of this code, I just wrote it off the top of my head, so you'll want to make sure I haven't mixed anything up. For example, I tend to use methods instead of attributes to handle things like the page title in the autohandler, but in this case (read the manual to see why) attribs are more than sufficient, so I may have goofed up the semantics for calling them and the way they behave in respect to inheritance. Read the developers manual, read it six or seven times. I had to before I really got some of the concepts right.
| [reply] [d/l] [select] |