T
T
Tim32015-10-08 22:49:07
css
Tim3, 2015-10-08 22:49:07

Make a new page?

Hello.
We have a menu here:

<div id="wrapper">
        <div id="sidebar-wrapper">
            <ul class="sidebar-nav">
                <li class="sidebar-brand">
                    <a href="#">
                        Menu
                    </a>
                </li>
                <li>
                    <a href="#">blabla</a>
                </li>
                <li>
                    <a href="#">blabla</a>
                </li>
                <li>
                    <a href="#">blabla</a>
                </li>
                <li>
                    <a href="#">blabla</a>
                </li>
            </ul>
        </div>

Here is the content code as it will be, more precisely as it is:
<div id="page-content-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h1>Simple Sidebar</h1>
                        <p>blablablabla</p>         
                    </div>
                </div>
            </div>
        </div>

And so I have 4 headings, can I make it so that when choosing another heading, the content is loaded separately? Those. so that you don’t have to make exactly the same page for each heading and shove everything there (menu + content). In general, I have a stream of thoughts, if it dawned on someone that I want to do it, thanks for the advice :D

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Martirosov, 2015-10-08
@Tim3

Well, what's the problem? What are you implementing? If Via PHP, then create 4 files, index.php, header.php, footer.php and content.php and include all other files in the index

include_once('header.php'); 
include_once('content.php'); 
include_once('footer.php');

Then, in the content.php file, write the condition for which request what exactly needs to be given to the client. Something like:
$category = empty( $_GET['category'] ) ? '' : trim( $_GET['category'] );
if($category == 1 ) {
echo 'Первая категория';
} elseif($category == 2 ) {
echo 'Вторая категория';
}if($category == 3 ) {
echo 'Третья категория';
}if($category == 4 ) {
echo 'Четвёртая категория';
} else {
echo 'Без категории';
}

I think the train of thought is clear...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question