1
00:00:06,330 --> 00:00:07,500
Welcome back.

2
00:00:07,530 --> 00:00:15,260
In this video, let's try to avoid duplication of code by pasting the nav link all around.

3
00:00:15,270 --> 00:00:18,030
So how can we achieve that?

4
00:00:18,060 --> 00:00:24,950
Well, you guys make it pretty easy by using what is called partials in aegis.

5
00:00:24,960 --> 00:00:28,050
So we are going to use partials to avoid this.

6
00:00:28,050 --> 00:00:30,700
So how can we implement partials?

7
00:00:30,720 --> 00:00:33,480
So now back to the view folder.

8
00:00:33,510 --> 00:00:37,190
We are going to create a folder called Partials.

9
00:00:37,200 --> 00:00:39,640
The name might be partials.

10
00:00:39,660 --> 00:00:48,810
So inside here we can go ahead and create enough link inside that I'm going to be navigation or nav

11
00:00:48,810 --> 00:00:50,430
dot aegis.

12
00:00:50,430 --> 00:00:52,040
And here we go.

13
00:00:52,050 --> 00:00:57,270
So the code that we are repeating, I'm going to cut it from all the templates.

14
00:00:57,270 --> 00:01:00,780
So for this one, I will cut everything from here.

15
00:01:00,810 --> 00:01:05,129
And let me paste it inside the nav edges.

16
00:01:05,129 --> 00:01:06,270
That is this one.

17
00:01:06,360 --> 00:01:07,860
Let me paste it here.

18
00:01:07,920 --> 00:01:08,370
Good.

19
00:01:08,370 --> 00:01:14,430
So now I'm going to require these templates in any template that I want.

20
00:01:14,430 --> 00:01:18,510
So I have a centralized place of my NAV links.

21
00:01:18,510 --> 00:01:22,950
So if I make changes to this file, it's going to reflect on all the templates.

22
00:01:22,980 --> 00:01:23,700
You get it?

23
00:01:23,700 --> 00:01:24,390
Yes.

24
00:01:24,390 --> 00:01:32,070
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

25
00:01:32,070 --> 00:01:41,790
that and let's go to the home and let's also remove that because now we have a central place to keep

26
00:01:41,790 --> 00:01:43,280
our NAV link.

27
00:01:43,290 --> 00:01:46,360
So how can we make use of it?

28
00:01:46,380 --> 00:01:48,750
So now let's refresh it.

29
00:01:48,750 --> 00:01:52,280
And now we see that enough link is gone forever.

30
00:01:52,290 --> 00:01:54,330
So how can we bring it back?

31
00:01:54,600 --> 00:01:55,790
Here is a clue.

32
00:01:55,830 --> 00:02:01,890
So the template that we want to use the nuff link here, that's how we're going to make use of it.

33
00:02:02,010 --> 00:02:05,090
We are going to use a special syntax from eggs.

34
00:02:05,100 --> 00:02:09,780
At first you're going to be scared a little bit, but don't worry, with practice we're familiar with

35
00:02:09,780 --> 00:02:10,070
it.

36
00:02:10,080 --> 00:02:11,400
So here we go.

37
00:02:11,430 --> 00:02:14,930
The method you are going to use is called include.

38
00:02:14,940 --> 00:02:23,120
So here comes the syntax, the angle bracket percentage sign percentage side, my angle bracket as that.

39
00:02:23,130 --> 00:02:32,340
And then I'm going to add dash and then space include and include is a method of function.

40
00:02:32,340 --> 00:02:36,570
Then include our paths in the path of the file.

41
00:02:36,570 --> 00:02:41,540
It is inside partials and then nav dot eggs.

42
00:02:41,550 --> 00:02:47,910
So this is a location we need to go into the pastures and then we have access to the nav.

43
00:02:47,910 --> 00:02:49,140
So here we go.

44
00:02:49,560 --> 00:02:53,640
Single code or double code and then the pastures folder.

45
00:02:53,640 --> 00:03:03,450
And in there I have the nav dart Edge's or now for short, when I save it and I refresh it, Hey, we

46
00:03:03,450 --> 00:03:04,680
have it back.

47
00:03:04,680 --> 00:03:06,150
We have it back.

48
00:03:06,180 --> 00:03:12,620
So when I go to abort us, I don't have the knife link, so I'll copy the same code here.

49
00:03:12,630 --> 00:03:18,060
And next is I'll go to the about and I'll paste it here.

50
00:03:19,030 --> 00:03:20,320
And that is it.

51
00:03:20,350 --> 00:03:23,770
The next one is going to be the contact us.

52
00:03:23,800 --> 00:03:28,570
Also, I will paste it here and now we have clean code.

53
00:03:28,600 --> 00:03:33,520
When I refresh it, I have contact us and I have the links also.

54
00:03:33,730 --> 00:03:37,960
So this is how we make these of partials and edges.

55
00:03:38,050 --> 00:03:46,000
The last concept that I'm going to learn is how we can send data from this server, and then we have

56
00:03:46,000 --> 00:03:48,520
accessed them inside a template.

57
00:03:48,580 --> 00:03:55,720
And for that, we are going to build our first project by combining or how different from the beginning

58
00:03:55,720 --> 00:03:59,080
to this point to create a complete application.

59
00:03:59,200 --> 00:03:59,620
All right.

60
00:03:59,620 --> 00:04:01,810
So let's get into that in the next video.

