Wow -- your template is looking good :-)
You may want to try this method -- far easier.
See instructions here: Wikieducator_tutorial/Navigation_templates/Templates_for_project_and_community_nodes
There is also another template layout which may be more suited for your purposes, see:
Code for alternate layout below the horizontal bar ...
Introduction| What is Flexible Learning?| Examples of Flexible Learning| Strategies for Flexible Learning| Considerations for Flexible Learning| Access and Equity| Diversity| Indigenous Learners| Planning| Mini-conference| References| Glossary