Instead, you want to put the navigation bar into a single file, and include that file at the appropriate point in your other pages.
Here's how to do that in Freemarker. Create a template, for example navigation.ftl. Copy the contents of Front.ftl over to it, and then remove everything above the first Freemarker #if statement. Go down and remove everything below the last </script> statement. What you're left with is just the navigation bar and the RPXNow script to make the sign in work.
Save navigation.ftl and edit Front.ftl.
Remove the navigation bar and script block from Front.ftl, and replace them with this line:
<#include "navigation.ftl">
Do the same thing with profileLoggedIn.ftl and profileNotLoggedIn.ftl. Now, any future pages you create that need the top navigation link, just use the include statement.
Use the same technique with any HTML or FreeMarker code that is identical between more than one page.
Now that our digression on reducing duplication is over, back to form processing.
No comments:
Post a Comment