Basically you’re talking about templating, right? You can do this by building your page with your header/footer/sidebar then programmatically embed WebContainers depending upon what needs to be displayed. Couple this with Session.URL* and you can determine what users want to view. Something like this in WebPage.Opening:
Sub Opening() Handles Opening
if Session.URLParameterCount > 0 then
select case Session.URLParameter( "action" )
case "viewCustomer"
'// Embed your readonly "View" container
case "newCustomer"
'// Embed a container for adding a new record
case "editCustomer"
'// Embed a container for editing records
case "viewEquipment"
'// Embed your readonly "View" container
case "newEquipment"
'// Embed a container for adding a new record
...
end select
end if
End Sub
Then structure your URLs using appropriate query strings:
https://mysite.com/myapp/?action=editCustomer&id=12345
SEO is a bit of different beast in Xojo Web. This might be a worthwhile read for you. Or you can add specific metadata such as keywords to the App.HTMLHeader property.
As for property access, this is easily achieved by ensuring that the ImplicitInstance property of your Master Page is set to true. Then you can acces its public properties, methods, controls, constants, etc. by referencing it by name:
myMasterPage.Title = "Cool Master Page"
' -- OR --
myMasterPage.Label1.Text = "Some Text"
Here’s a more complete example of the container embedding in the WebPage.Opening event handler:
Sub Opening() Handles Opening
var embedContainer as WebContainer
if Session.URLParameterCount > 0 then
select case Session.URLParameter( "page" )
case "one"
embedContainer = new Container1
case "two"
embedContainer = new Container2
end select
end if
if embedContainer is nil then embedContainer = new ContainerHomeDashboard
embedContainer.LockLeft = True
embedContainer.LockRight = True
embedContainer.LockTop = True
embedContainer.LockBottom = True
embedContainer.EmbedWithin( self, 0, 100, self.Width, self.Height - 200 )
End Sub
Of course you can move this code to a method and track the current container using a property, and switch them out as needed by closing the old container and add the new one then storing its reference in the property. Then your in-app navigation and URL-based navigation are unified.