Welcome back.
In this video, let's try to avoid duplication of code by pasting the nav link all around.
So how can we achieve that?
Well, you guys make it pretty easy by using what is called partials in aegis.
So we are going to use partials to avoid this.
So how can we implement partials?
So now back to the view folder.
We are going to create a folder called Partials.
The name might be partials.
So inside here we can go ahead and create enough link inside that I'm going to be navigation or nav
dot aegis.
And here we go.
So the code that we are repeating, I'm going to cut it from all the templates.
So for this one, I will cut everything from here.
And let me paste it inside the nav edges.
That is this one.
Let me paste it here.
Good.
So now I'm going to require these templates in any template that I want.
So I have a centralized place of my NAV links.
So if I make changes to this file, it's going to reflect on all the templates.
You get it?
Yes.
So let's go to the about and now I have removed that and let's go to contact us and let's also remove
that and let's go to the home and let's also remove that because now we have a central place to keep
our NAV link.
So how can we make use of it?
So now let's refresh it.
And now we see that enough link is gone forever.
So how can we bring it back?
Here is a clue.
So the template that we want to use the nuff link here, that's how we're going to make use of it.
We are going to use a special syntax from eggs.
At first you're going to be scared a little bit, but don't worry, with practice we're familiar with
it.
So here we go.
The method you are going to use is called include.
So here comes the syntax, the angle bracket percentage sign percentage side, my angle bracket as that.
And then I'm going to add dash and then space include and include is a method of function.
Then include our paths in the path of the file.
It is inside partials and then nav dot eggs.
So this is a location we need to go into the pastures and then we have access to the nav.
So here we go.
Single code or double code and then the pastures folder.
And in there I have the nav dart Edge's or now for short, when I save it and I refresh it, Hey, we
have it back.
We have it back.
So when I go to abort us, I don't have the knife link, so I'll copy the same code here.
And next is I'll go to the about and I'll paste it here.
And that is it.
The next one is going to be the contact us.
Also, I will paste it here and now we have clean code.
When I refresh it, I have contact us and I have the links also.
So this is how we make these of partials and edges.
The last concept that I'm going to learn is how we can send data from this server, and then we have
accessed them inside a template.
And for that, we are going to build our first project by combining or how different from the beginning
to this point to create a complete application.
All right.
So let's get into that in the next video.