Creating The Management Index

Our finalProject/management/ page is the main location for our management tools. However, at the moment you might be getting an error that says missingInclude Error since it is looking a page called //finalProject/management/carousel.bxm which doesn't exist. We need to make some coding changes to make this page work like we need it to.

1

Open finalProject/management/index.bxm in your IDE ( i.e. VS Code )

2

We are going to adapt our finalProject/management/index.bxm file to only have one section in our main area so make the following changes:

Note

Red lines are ones which have been deleted or edited and the green lines are what our final result needs to look like.

<bx:param name="tool" default="dashboard" />
<bx:param name="currClass" default="" />
<div id="wrapper" class="container">
    <bx:include template="header.bxm" />
    
    <div id="horizontalnav" class="row">
        <bx:include template="horizontalNav.bxm" />
        <bx:include template="managementNav.bxm" />
    </div>
    <div id="maincontent" class="row">
        <section id="center" class="col-sm-9 order-last">
        <section id="center" class="col-sm-12">
            <bx:include template="carousel.bxm" />
            <bx:include template="#tool#.bxm" />
        </section>
        <section id="left" class="col-sm-3 order-first">
            <bx:include template="genrenav.bxm" />
        </section>
    </div>
    <footer id="footer" class="row" style="text-align: center">
        <bx:include template="footer.bxm" />
    </footer>
</div>

Notice how on at the top of the section we have a new line which reads <bx:param name="tool" default="manageArticles" />. We know that is a BoxLang component because it starts with <bx: but what does it do? A parameter is an input value that controls how a function or command runs. We'll look more at this the in another context but, in this case, we created a variable at the top of our page with the default value of manageArticles. What does that variable do?

Look later down on the page where it reads <bx:include template="#tool#.bxm" />. We know that <bx:include /> gets another page and inserts the contents of that file into this one. We are using the tool variable to dictate which file, or what piece of code, we are going to insert into our index.bxm page. This will dictate what is displayed when we open the browser. By default, a file called mangeArticles.bxm will appear in our index.bxm page. We'll use the other <bx:param in another part of the page we have yet to build.

Lesson 4 of 6 - Preparing The Final Project Folder