NetTalk Central

Author Topic: Confused about Styles  (Read 4599 times)

Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Confused about Styles
« on: September 07, 2007, 12:18:04 PM »
I've added my own style sheet per the instructions -- namely, I added it with the Web Server procedure, etc.

On the IndexPage (NetWebPage)  -- I'm using Example 2 -- I changed the <body> CSS Class: from PageBody to PBody (my settings).  Below this is the custom.css style sheet that I'm using.

All works fine on the Index Page.  On subsequent pages, the changes are gone.  A look at the source for the subsequent pages shows that the pages are once again looking for PageBody  -->

<body class="PageBody" onload="javascript:bodyOnLoad();" >

I'm confused as to why the class change from PageBody to PBody is not inherited by subsequent pages and if there is a place where this can be modified.

Thank you.

 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Confused about Styles
« Reply #1 on: September 10, 2007, 03:13:23 AM »
Hi Jim,

>> I'm confused as to why the class change from PageBody  to PBody is not inherited by subsequent pages

I'm not sure that "inheritance" is a good way to think of web pages. The web browser model (which is a stateless, disconnected, client server model) doesn't really lend itself to "inheritance". Each page is an entity unto itself.

>> and if there is a place where this can be modified.

For all "NetWebPage" procedures you'd need to set it on each procedure. However for browses and forms (which are called as pages) you can set it in one place in the code.

When a "control" (such as a browse or form) is called as a "page" then a property in the WebHandler, called .BodyClass, is used.

Right-Click on the WebHandler procedure and click on "Source".
Search for the .MakePage method.
_Before_ the parent.MakePage call add code to set self.site.bodyclass. For example

self.site.bodyclass = 'PBody'

Cheers
Bruce



Jim A

  • Full Member
  • ***
  • Posts: 203
    • View Profile
    • Email
Re: Confused about Styles
« Reply #2 on: September 11, 2007, 08:07:10 AM »
Hi Bruce:  That makes sense. 

Thanks, as always,

Jim