• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: user-defined header/footer html
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: user-defined header/footer html


  • Subject: Re: user-defined header/footer html
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Tue, 13 Sep 2005 12:51:49 -0400

Hi, John,

The standard approach is to provide a page wrapper component something like this:

PageWrapper.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
    <HEAD>
        <META NAME="generator" CONTENT="WebObjects 5.2">
        <TITLE>Untitled</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF">
        <TABLE>
            <TR>
                <TD ALIGN=CENTER COLSPAN=2>Header</TD>
            </TR>
            <TR>
                <TD>Nav</TD>
                <TD><WEBOBJECT NAME=Page></WEBOBJECT></TD>
            </TR>
            <TR>
                <TD ALIGN=CENTER COLSPAN=2>Footer</TD>
            </TR>
        </TABLE>
    </BODY>
</HTML>

PageWrapper.wod:

Page: WOComponentContent {
}

This is just a sample template. Replace the word "Header" either with your client's custom header HTML or replace it with a header WOComponent that contains your client's custom header HTML. Replace the word "Footer" either with your client's custom footer HTML or replace it with a footer WOComponent that contains your client's custom footer HTML.




Then, for each page that you want wrapped in your client's html, you create a new WOComponent and do the following:


  1. Select <BODY>

2. Bring up the inspector panel which should say "Page Inspector" in its title bar

3. Confirm that the upper left Pop-up menu says "Static Inspector" (or make it so).

4. Select the pop-up that says "Full Document" and reset it to "Partial Document"

This should cause a panel to appear which says:

=====================
Convert document
Converting this document into a fragment will remove all tags external to, and including, the BODY tag. If you only want to remove some of those tags, using the source view mode is recommended. Do you want to continue? This is an undoable action.
=====================


  5. Click Continue in the panel

  6. Save the WOComponent in your project

7. Click the Asterisk icon in the lower right of the tool bar (the Add Custom WebObject icon) oops... Sorry, forgot that wasn't in the new WOBuilder, select WebObjects -> Custom WebObject from the menu bar

  8. Enter PageWrapper in the panel that appears and click OK

9. Put all the content of the new page within the PageWrapper component.


If you provide WOComponents for the header and footer HTML, you should do steps 1 - 6 above on each of them as well.



If you do the above for each of your subsequent WOComponents, they will each be consistently wrapped pages. If you want to go to a page, simply use pageWithName() and provide the name of the wrapped page that contains the page's content. It will automatically invoke the page wrapper which will invoke the head and footer.


This is the standard approach and the only real issue is that when first creating it, it feels like your components are somehow inside out, but you'll get over that. :-)

Regards,
Jerry

On Sep 10, 2005, at 5:33 PM, John Gilmore-Baldwin wrote:




















I'm building an app where I'd like users to be able to specify header and footer html code that would get inserted using appendToResponse.

My only hangup is that I can't figure out how to get said html within the body tag.

I can generate the beginning html part easy enough, but thought I'd see if there's a better solution I'm overlooking or ignorant of.

For example, if a user wanted to add a custom image at the top of their page, they could specify that in the app I'm building. Then it would go before the database content. Similar for a footer.

Thanks
John Gilmore-Baldwin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40codefab.com


This email sent to email@hidden




















--
__ Jerry W. Walker, Partner
C o d e F a b, LLC - "High Performance Industrial Strength Internet Enabled Systems"
email@hidden
212 465 8484 X-102 office
212 465 9178 fax





--
__ Jerry W. Walker, Partner
C o d e F a b, LLC - "High Performance Industrial Strength Internet Enabled Systems"
email@hidden
212 465 8484 X-102 office
212 465 9178 fax









--
__ Jerry W. Walker, Partner
C o d e F a b, LLC - "High Performance Industrial Strength Internet Enabled Systems"
email@hidden
212 465 8484 X-102 office
212 465 9178 fax






--
__ Jerry W. Walker, Partner
C o d e F a b, LLC - "High Performance Industrial Strength Internet Enabled Systems"
email@hidden
212 465 8484 X-102 office
212 465 9178 fax













--
__ Jerry W. Walker, Partner
C o d e F a b, LLC - "High Performance Industrial Strength Internet Enabled Systems"
email@hidden
212 465 8484 X-102 office
212 465 9178 fax






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: WO on mactel
  • Next by Date: Optimistick locking problem
  • Previous by thread: Re: user-defined header/footer html
  • Next by thread: EOEditingContext conceptual question
  • Index(es):
    • Date
    • Thread