Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Web and WebWorks Development

Reply
Trusted Contributor
shea08
Posts: 115
Registered: 03-25-2009

Common header/footer for application -> template for all pages.

[ Edited ]

Hello,

 

I have a application that will be a bout 3 or for html pages. I would like to have a common header and footer on all the pages of the application.  Using MS's MVC3 framework, you get a _Layout.cshtml page, and all your other pages are placed inside of it.

 

The Layout page would look something like this:

<html>
	<head>
		<title>
			My App
		</title>
		<script type="text/javascript" src="myscripts.js"></script>
	</head>
	<body>
		<b><a href="#" onclick="myapp.menuClicked()">Menu</a></b>
		<H1>My App</H1>
		<!-- my sub page content gets put here server side -->
		<i>This is my footer.</i>
	</body>
</html>

 

 That way if I want to change my header or footer, I don't have to change it on every page of my application.  In the MVC3 framework, this is done serverside.  What's the best way to accomplish this with webworks/HTML 5/JS?

 

Or is it just best to set up some sed/awk scripts?

 

Thanks,
~S 

Please use plain text.
Trusted Contributor
SumiGhosh
Posts: 181
Registered: 09-20-2011
My Carrier: Developer

Re: Common header/footer for application -> template for all pages.

I had done an application with fixed header and footer. What i have done is created 3 divs. one for header,another for data section and one for footer. I created a single html page for this and changed the content of second div (data section) according to user clicks a menu item through DOM.

Please use plain text.
Trusted Contributor
shea08
Posts: 115
Registered: 03-25-2009

Re: Common header/footer for application -> template for all pages.

Well currently I have ruby script statically doing it pre-deploy which is working.

 

How did you replace the content of the div tags? Using Javascript? (sorry new to JS).


~S

Please use plain text.
Trusted Contributor
SumiGhosh
Posts: 181
Registered: 09-20-2011
My Carrier: Developer

Re: Common header/footer for application -> template for all pages.

Exactly............  On clicking a  menu item, what i'm calling is a javascript function and replace the content of the div with new one. 

Please use plain text.