Class Checkpoint

Making Parkwood Vale · Part 5 of 13

Part 5

Add Bootstrap, split the page into a shared header and footer, and build the home and facilities pages.

We turn the wireframes into real pages. Bootstrap does most of the styling, and a shared header and footer keep every page the same. In this part: 0:50 Downloading Bootstrap and adding it to the project 1:50 Comparing the Adobe XD design with the site so far 2:56 Splitting the page into header.php and footer.php 5:27 Page title, character set, viewport and meta tags 10:03 Linking Bootstrap, then our own style.css after it 12:04 The page container and the home page banner 19:55 The logo, and WebP images with a PNG fallback 24:29 A collapsible Bootstrap navigation bar with a search box 47:00 The footer and the custom CSS, including the background image 52:50 Home page content: opening times, address and contact details 1:09:47 Creating facilities.php from the same template Software: Adobe Dreamweaver, UwAmp, Bootstrap, PHP, HTML, CSS, Lighthouse.
Transcript
  1. Okay, welcome back then. And in this video, I'm going to show you how we're going to
  2. structure our website following the designs of the wireframes we made last session.
  3. We're going to start off by downloading the latest version of Bootstrap, making sure
  4. that's in the correct locations and linking that to each of our pages.
  5. We're then going to look at old versions of web design versus the new versions of
  6. web design and see how we can stylize the templates of our pages so that each of our
  7. pages follow the same layout and look professional.
  8. Let's get into it.
  9. Okay, so as you can see I'm back on my student computer then and what I've got set
  10. up already is Dreamweaver running and I've got UwAmp running on my server.
  11. Now I'm going to go into the Bootstrap website and I'm going to download the latest
  12. version of Bootstrap. From Bootstrap's website we have the ability to look at
  13. different examples. They have a documentation page which is brilliant.
  14. I'll take you through that in a little bit.
  15. And an option to choose which version we want to work with.
  16. Now we're going to be working with the latest version of Bootstrap.
  17. on the download option here and download the pre-compiled files see that little
  18. number one there i've already downloaded this beforehand this is a third time doing
  19. this video take not been happy with my previous work so i want to make sure that it
  20. is as clear as possible for you what i've all i've done in this is i've gone in and
  21. i've taken the basic bootstrap element out so if i go into Parkwood Vale what i have
  22. included was the bootstrap and bootstrap min with the map files and that's it
  23. nothing from css just yet when i've downloaded and extracted those i can get rid of
  24. that i can minimize UwAmp and let's open up adobe xd
  25. so there it is
  26. i've got the two versions of the Parkwood Vale site available to me the one i did
  27. last session with you guys and this session here is the original design I created.
  28. Looking at this original design then if I zoom in ever so slightly you'll see that
  29. all of the pages have the same template and the way we're going to do that rather
  30. than just simply using .tmp files and trying to put editable regions and things like
  31. that in place what we're actually going to do is have a header and footer
  32. document that contains most of our styling elements and the middle part here that
  33. that's going to be our different pages.
  34. So let's jump into Adobe Dreamweaver and I'll show you what we're going to do.
  35. So as it stands at the moment, we have our connection file that's just being
  36. required to connect to our database and that's it.
  37. It's saying open our config file and include or require the use of our connection
  38. file there, otherwise the server shouldn't run anything.
  39. and if I go to localhost all I get is a blank screen.
  40. What I'm going to do next is I'm going to insert a new file or add a new file which
  41. is a type of PHP file and I'm going to create that and I'm going to call it header.
  42. So here's my header document here I'm going to put it straight back into code mode
  43. and zoom in so you can see what I've got in place quite clearly.
  44. And all it is is a standard boilerplate HTML page.
  45. Nothing different there. This is going to be included.
  46. This is going to be the top of every single one of the pages, whether it be the
  47. admin side or the user side of our website.
  48. So rather than requiring the use of our database on our original
  49. document,
  50. I'm going to get rid of it from my index page.
  51. it in place on my header page
  52. and that's linked those two together there now I'm connected to my test server I'm
  53. in local view and that's why I keep getting a warning saying are you sure you want
  54. to do this because it will automatically update it for me now the very first thing
  55. I've got in place is this require the connection and then I have the rest of my HTML
  56. page with our header page then it's not just going to contain what's in our head
  57. document it will
  58. and it will start to contain some elements for our navigation and the setup of our
  59. pages. What it won't contain are the last two body tags there.
  60. So I'm going to get rid of those.
  61. Instead, I'm going to add a new file.
  62. Again, create it, and it's going to be called footer.php.
  63. Now, at this time, it won't actually contain any PHP, but we will undoubtedly be
  64. adding some when we get to it.
  65. All it's going to do is contain the final two HTML tags.
  66. So as you can imagine, I'm putting this together as the header tag will be in place
  67. or the header page Then the index page then the footer page and all three will be
  68. loaded every single time At the moment my index has nothing in it
  69. So if I went to localhost, it will show me nothing and if I go to page source It
  70. will show me my required there because it hasn't been updated to show that I've made
  71. those changes So let's just go over here upload that so that I put that over
  72. there and when I refresh this now I should get a blank
  73. document
  74. what I'm going to do rather than say require which will break the software if it's
  75. not there I'm just going to say I want to include it so I'm going to go up here I'm
  76. going to say PHP I want to include and what I want to include is my
  77. header or dot PHP file
  78. Now, I'm also going to go in, add some spaces in, and I'm going to include a PHP pad
  79. that includes my footer page,
  80. just so that I have that full working PHP document and everything in place.
  81. And let's do that properly there.
  82. Now, you can see here it's linked these two documents into it, and they have
  83. asterisks next to show that they haven't been saved correctly.
  84. There's that element there. I want to save that one.
  85. There's that element there. I want to save that one.
  86. They're all linked together. On my header here, I probably should have a PHP tag in
  87. just to be sure of it. Make sure that's all saved.
  88. And I should be able to put that up.
  89. And if I refresh my page, it's giving me an error.
  90. It didn't expect that on header line one.
  91. But if I refresh this, it does give me that error output.
  92. That's why. I accidentally deleted my bracket.
  93. And I don't know what button I pressed then, which duplicated pretty much everything
  94. that was in place.
  95. Let's see. How's that looking there?
  96. And there.
  97. Yeah. Not quite sure what happened there.
  98. PHP.
  99. Require.
  100. Dreamweaver can do some strange things on times.
  101. So now that's in place.
  102. And close that, close that, close that a second.
  103. Just open this up. There you go.
  104. That's all as expected.
  105. And so is that. And Kevin, the two files open at the same time caused some sort of
  106. internal error with Dreamweaver.
  107. If I refresh this page then, that error disappears.
  108. If I refresh the view source, I get my HTML section set up.
  109. And as you can see, on line 14 and 15, if I come back to here, I have
  110. what's on line 1 and 2 there, but they are being pulled through into the right
  111. places, as I'd expect it to look.
  112. Now, I'm not really going to be working on my index page to start with, so I'm going
  113. to close that down, because as we saw two seconds ago, it can cause some internal
  114. errors.
  115. open the file you need open at the time.
  116. That's one of my biggest tips.
  117. Now up here you can see it says untitled document.
  118. We don't want to say untitled document, we want to tell it that it's Parkwood Vale's
  119. library system. So we're just going to simply update our title to say Parkwood Vale
  120. library.
  121. If I save that and go back to my local host,
  122. let's put that up,
  123. refresh that,
  124. with Parkwood Vale Library, it's put that in place for me.
  125. I'm going to continue working inside my head section.
  126. It's already put in place for me, thankfully, the character set of UTF-8.
  127. That just allows our browsers to know what version or what character set we are
  128. using. What I'm going to do very quickly is just zoom in a little bit on there so
  129. you should be able to see it clearly.
  130. Please do let me know if it's unclear and I'll try and do some editing magic to make
  131. it a bit clearer for you. Now I am going to indent these a little bit because I like
  132. it to look nice and neat and tidy.
  133. We have our meta for our character set in place.
  134. We also want to put in place some meta details around other bits and pieces
  135. for our site. One of the most important ones when working with a responsive site is
  136. our viewport. Now this sets the size of our page.
  137. The size of the pages should be viewed at.
  138. I mind saying that the width of the device is scale one.
  139. in and it's the full width of our device.
  140. I've got a few little other bits that I like to include as well, good for SEO,
  141. and they are just simply information based around our website.
  142. So we have our meta description, which says this is an example transactional website
  143. solution, our author, which is me, the generator, which is me, and some keywords to
  144. help with SEO, search engine optimization.
  145. Now, after we've put our basic meta details in place, which would have zero impact
  146. on our actual site itself, what I want us to do is link to our
  147. CSS that we have included here.
  148. The way I'm going to do that is start off with a comment so that I
  149. know that this is for my CSS.
  150. Just so that when I'm looking at it, I can easily find those different sections.
  151. I want to have a link command in place.
  152. That is a href that will, if I click on browse,
  153. go to my CSS. and I'm linking directly to the bootstrap CSS and I'm gonna click
  154. okay.
  155. Now it's relevance is going to be, it's a type of style sheet.
  156. And that will link my CSS to it.
  157. Now when I save that page there, bootstrap becomes a linked page at the top here.
  158. If I put this file up and I refresh my local host, nothing changes,
  159. but in the view page source, we now have that link to our CSS included as well.
  160. aside from that that's for our generic rules that are generated for everything
  161. i also want to link to a href stylesheet i haven't yet created but i can
  162. put the link in ready
  163. which is going to be a css and it's going to be called style.css and it
  164. as well is going to be a style sheet.
  165. And all this is, is rather than overwriting the rules of Bootstrap in any way, if I
  166. want to put in some custom CSS, I put it in the style sheet, which is loaded after
  167. the Bootstrap sheet, which allows me to then put in any customizations I like
  168. without having to modify Bootstrap's original coding.
  169. Now in my body section for my site then, I'm going to break it down into different
  170. containers that contain the elements of my website.
  171. To start off I want a main section so I'm going to use a main tag
  172. and the main tag is going to be a class of container.
  173. Now as I put this in place it will help me
  174. autofill until it decides it doesn't want to do it the way I expect it to.
  175. The end of my main this section here will be in my footer document so
  176. i'm going to open up footer a second and make sure that my body is there and then my
  177. main finishes but close that again just to make sure that everything stays nice and
  178. neat i do want to put both files so they're both on my web server
  179. and if i refresh this yet again we still have no changes but we can see
  180. i'm including this code in place.
  181. Indentation in my footer section is terrible.
  182. I'll deal with that later.
  183. Inside my container then, my main section, what I'm going to do is start to put in
  184. place my
  185. design for my page. So I'm going to focus here on my first page here and just
  186. stylize it all around this. This will be my index page.
  187. As I did say, this will form the code for most of my page anyway but this is going
  188. to be my index section.
  189. I have at the top here this padded section where my logo is going to go and where my
  190. text is going to go.
  191. So I'm going to put in place a divide for it, a div tag.
  192. This allows me to add different classes to it to make it look how I want it to
  193. and I'm just simply going to stop there a second and end the div tag.
  194. Now I'm going to add in some classes from Bootstrap.
  195. One of them being p-4 which adds a four
  196. pixel width element as padding around the whole of my document.
  197. I'm going to put in an mt which is the margin at the top of my
  198. container and I want that to be of consideration three.
  199. I want it to be rounded which is very nice
  200. And actually the last thing I'm going to put in place is text and I want it to be
  201. background BG and it is dark.
  202. Now all of these elements you've seen auto-filling come directly from Bootstrap
  203. themselves.
  204. Inside of there then, inside this div tag, I'm going to put in another divide and
  205. I'm going to put in a class called rub.
  206. Now responsive website design and bootstrap themselves work with rows and
  207. containers.
  208. One row is a horizontal width of your screen and contains 12 containers.
  209. So they can be spaced at container sizes 1 through to 12 and any sort of combination
  210. between.
  211. I'm going to put in place a div section here.
  212. It's going to be a class type column.
  213. MD for medium size and it's going to be eight.
  214. So that's going to take up eight columns within my site.
  215. I'm going to scroll this down a little bit because we don't need, I can't yet, wait
  216. for it to get to it.
  217. And in there I'm going to say that I want it to be centered using the
  218. px0 command. That will center any text I put in place in there.
  219. And what I'm going to do is put
  220. one and I'm going to put in Parkwood Vale
  221. library and underneath that then
  222. I'm going to put in a paragraph and in my paragraph I'm also going to put in the
  223. text that you'd see on the Parkwood Vale site if you were to load it up.
  224. Now I can scroll. Now I can add classes to how
  225. these look So, if I put in class equals, I'm going to say
  226. display, and I'm going to put in a display for like I
  227. did originally.
  228. I could also see if this one works.
  229. F, S, T. Yep. Say that I want my font to be a static italic style.
  230. So, if I save this page now, and I refresh this,
  231. make sure you use the put command.
  232. refresh this i start to get my text in place it's not the right color it's in the
  233. right position and it fills up the right section of this with my p my
  234. um paragraph and add a class to it as well and that class
  235. is going to be a lead of text and it's going to have a
  236. margin to it an my3
  237. and if I save that put it and refresh it
  238. you can just see that it increases the space and the stylings of it I have a nice
  239. big space here where I'm going to put my logo and that is in my images folder in the
  240. png or the WebP element and I'm going to show you through those two in a second
  241. before we go that further step though I'm going to look at this and see that's not
  242. the right color
  243. and I'm going to go to my p tag here next to my dark text and just use an
  244. inline css command I could put this in my style sheet if I wanted to but I'm going
  245. to show you an inline element first it's going to be a background color now you get
  246. a lot of noise when you're typing in here it could help this background color I can
  247. click onto it it does help come through but sometimes it can be quite overwhelming
  248. just get used to ignoring it and just type what you want to type regardless trying
  249. to tell you to type. So my color originally was
  250. set to this purpley blue color here.
  251. Now if I save that, put that file up and refresh my
  252. page,
  253. it's not changed the color.
  254. So what I can do is I can force it that my background color is important and
  255. should be obeyed using important as a tag
  256. element there now what that will do is say to change it to this color
  257. regardless of what comes before it and now it
  258. should pick up let's see if that has come through on my page source background
  259. colors there but it wasn't put up properly so let's take that
  260. put that up refresh this the importance there has it worked
  261. it has there we go so it's going back that color that right shade
  262. so i've got my header section in place i'm going to scroll down
  263. and outside of this div then inside of my call my row div i'm going to add in a
  264. new div
  265. which again is going to be a class this time around though instead of being
  266. colmd8 we're going to fill up the rest of our columns which is called md4
  267. and we're going to put our padding for our element there as well let's close that
  268. off and put that in place so this is going to now take up the rest of the space
  269. within my banner bar i would originally traditionally use an image
  270. tag
  271. for my image tag and browse to my
  272. pictures my image say my PNG and I'd go for my Parkwood Vale library
  273. image and that puts that in place and if I was to save
  274. it I get I get used to clicking on that put button
  275. and then refresh it I I get a massive logo that takes up too much space.
  276. I can use CSS classes to control the size of that logo.
  277. And what I'm going to do is I'm going to have the class equal to MX auto, which will
  278. center it. I'm going to put the display element as a block, so it displays it in a
  279. block style. I'm going to set the height, this time around, to 200 EM.
  280. and I'm going to add in my alt text for anyone with
  281. any additional requirements as
  282. Parkwood
  283. Vale logo.
  284. Now if I refresh that page nothing will happen because I forgot again to click on
  285. the put button and then refresh that page.
  286. Now let's put it down to the right size and that's
  287. happy all looking as I expect it to but if I was to go into my
  288. inspect section and I was to use the lighthouse scoring system
  289. to analyze my desktop page Google will go through analyze how
  290. my page looks so far and it will tell me recommendations based around how my design
  291. is in place
  292. as you can see hitting quite high on pretty much every element here but if i do
  293. scroll through there will be a section where it says width and height not added and
  294. to use caching and it should be an element somewhere html doesn't have the
  295. language tag i can deal with that one a bit later on but it should say about
  296. pictures and using um the more modern style images, which is what
  297. we created when we converted from PNG to WebP the other session.
  298. Now, the way we do that is we keep this as a fallback for if that doesn't work, and
  299. we add in a picture tag instead.
  300. Now, our picture tag becomes a container that does contain our image,
  301. but also contains alternative options for it and these go before
  302. it so I'm going to put in my source here for my picture and my source is going to be
  303. a source set r s r c s e t equals and then I'm going
  304. to tell it where to find my images so it's going to be image forward slash WebP
  305. forward slash and this time it is the same name but ending
  306. with dot webp and then the type
  307. because you have to specify what type it is is image forward slash
  308. webp and that puts that in for my original source
  309. element at the moment if I right click on this I want to save image as it come up as
  310. a PNG but if I was to remember to put the file to
  311. and then refresh it when i go to save image as this time around it's now a WebP
  312. file because edge is a chromium based website and supports these newer
  313. image types it would display a newer image type if someone was using an older
  314. website an older web browser sorry or using something like firefox it might not
  315. accept it safari might not accept it they are taking they are becoming a lot
  316. a lot more commonplace but we still need to have that failover just in case we need
  317. to use it. And that would set up my main container, this top
  318. block here for my website.
  319. I'm now going to look at my menu bar across the bottom here.
  320. Before jumping into the menu bar I'm going to have a quick drink, refresh myself and
  321. then come back to this.
  322. okay welcome back man so now we've done our main element there for our
  323. banner we're going to start looking at next at how we put in place our menu bar
  324. now i put that main there and i end the main in the footer section but on reflection
  325. i don't want to end it there so let's get rid of that save that and put that because
  326. otherwise i forget that and just end my main section here
  327. and I'm going to create another main element in place in two seconds time and these
  328. are my different sections for my different set parts I could put in a comment nicely
  329. to remind myself and just say banner so that is my banner element and
  330. I could do underneath here just so that I know where it is I could do
  331. end banner I'm putting that end banner
  332. section there and if I was to actually indent all of that ever so slightly I should
  333. be able to minimize it so that I can get rid of that code there so it makes it a
  334. little bit easier for you to see what's going on so there's the end of my banner and
  335. I'm gonna put in place a comment and I'm gonna say now far because
  336. that's what
  337. and go from there.
  338. So in the same way then, I'm going to put in a container for this that is going to
  339. be containing my navbar. So I'm going to go div.
  340. I'm going to put in a class equals, and it's going to be a type of container.
  341. Now the reason I'm using container all the time with these elements is container has
  342. some built-in properties. If I very quickly just open this up and inspect that
  343. section there.
  344. As it's a type of container, if I was to bring these elements up here, it has
  345. its max width set for me and it has some different properties to affect how
  346. it changes and adjusts in size, keeping its responsive nature in place.
  347. So that's why I'm using containers for these elements here so that they keep to the
  348. same size on my page all the way down.
  349. now in my nav bar itself then i'm going to have a nav command this
  350. class is going to be a type of container again but this time around rather than just
  351. being a standard container it is going to be a fluid size container
  352. actually in fact i'm getting ahead of myself there my nav is going to be a type of
  353. navbar and then it's going to be a navbar
  354. expand
  355. on large size
  356. and I'm going to use a background of a light navbar
  357. now I won't be able to show you how those impact anything just yet
  358. but when I come through and I've added some elements into my navbar I'll show you
  359. what the
  360. Now, if I save that and put that and refresh this,
  361. nothing really changes. I haven't put anything in my navbar yet.
  362. What I'm going to do is I'm going to put in this is where my container comes in
  363. place.
  364. Class container and that's with my container being a fluid
  365. style container, which all that means is use as much of the space as you can.
  366. So inside my navbar, inside my container, I want a fluid container.
  367. I know it can get a little bit confusing having all of these commands in place.
  368. What I'm going to do is I'm going to set up my first element, which is my
  369. A class,
  370. my standard link, which is going to be called my navbar,
  371. and it is my navbar's brand.
  372. Now, inside my navbar's brand, it's going to href.
  373. So, its horizontal HTML reference is going to go to its standard page.
  374. And in here, then, I'm going to say Parkwood there.
  375. If I save that, put that, and refresh it,
  376. it hasn't pulled
  377. through. I'm going to click on the wrong thing.
  378. There we go.
  379. Now, thank you very much.
  380. I get Parkwood Vale here. It is in line, and this is where I can actually jump back
  381. and show you. Here, if I change this to BG Dark, and I
  382. put that, making sure I'm on my header far this time.
  383. When I refresh it, it comes up as a black nav bar.
  384. if i went into bg dark and there was different options
  385. i can go dark subtle and i can a danger subtle sorry and i can
  386. push that i get a pinky color so there are all sorts of built-in
  387. colors and built-in bits and pieces that you can utilize now this seems like a good
  388. appointment as any to jump back into that bootstrap page i was talking about earlier
  389. so if i go to bootstrap
  390. and I go on to their site, and I go on to the documentation.
  391. In here is everything you'd need to know about Bootstrap.
  392. All the different CSS tags and everything they are looking at can be found here.
  393. So I'm on the navbar section, and as I scroll down, it has all of these different
  394. elements in place. It explains to me how to use the different elements, so the brand
  395. for your company, the navbar itself, the toggler, all these different sections.
  396. And as I go further down, it'll take me through some colorings and other bits and
  397. pieces. So I've got here theme, blue, dark colors, and all different ways of
  398. doing it.
  399. So that's the documentation within Bootstrap, which is extremely,
  400. extremely in-depth and thorough.
  401. Realistically, you should be able to find anything you want to Bootstrap related in
  402. the Docs section. But if you are having any issues, by all means, you can message me
  403. and I can see what I can do to help.
  404. So I've got that in place then.
  405. And what I'm going to do is put in a button which will allow me to expand out my
  406. page if need be. So what I've got here is a button tag.
  407. It's classed as a navbar toggler.
  408. It's a type of button and it's got some extra data elements included,
  409. which hopefully you can see here, that will allow you to have that in place.
  410. And when I actually save this and put the icon for it in place as
  411. well, so let's just drop that in.
  412. When I push that up,
  413. realistically, nothing appears here just yet because that section I've just put in
  414. place is there. Let's do a double check actually, because I've got that open.
  415. Yep, the icon is there the span is there brilliant for when it is in
  416. Phone mode it is this section here that I was just working on putting this different
  417. element in place Now you may just looked at what I've done there and thought what
  418. the hell has he done? How's it gone like that?
  419. I'm gonna show that one again.
  420. I right clicked I went to inspect here Which allows me to look at the code behind it
  421. using my browser in some fashion And I have this little option here which has a
  422. symbol of a phone and a tablet on it where I can toggle into different devices
  423. Now on the drop down I can choose what device I want to work with and it presets the
  424. dimensions for me And I can also rotate it so the moment it is in landscape mode
  425. if I click here It will go into portrait mode and I can see how it looks if it was
  426. on a device So if I went back to the iPhone 12 Pro section, that's my
  427. phone here in landscape mode. And if I went to rotate, it would rotate it to
  428. portrait mode. And as we are on the same Wi-Fi, I
  429. should be able to go, if I remember the IP for it,
  430. 2.168.159.4.
  431. And I should be able to pull this up because WAMP should run it through.
  432. Although I think it's getting caught on the firewall itself.
  433. 1, 2, 1, 6, 8, 1, 5, 9, 4. Yes, it's not loading on my phone.
  434. So it must be a firewall issue there.
  435. So let's just close this back out a second.
  436. I've shown you where that toggle is.
  437. And I've shown you how to get into developer mode there.
  438. And let's jump back in and start adding some pages in place.
  439. So all of these sections are there.
  440. enter let's tab that in and then gonna have a look
  441. at what I'm going to include
  442. in my section here I have home categories search about us sign in and create
  443. an account if I actually go to Parkwood Vale I've
  444. got home I've got browse books facilities acknowledgements feedback forms
  445. search and account so it did differ slightly to what it was I originally designed.
  446. What I'm going to do is in this section here then in my nav section I've got my A
  447. class in place. I've got the end of that there and I'm going to put in now a new div
  448. section.
  449. Now this divide, this div section, in fact actually my bad I didn't quite finish my
  450. button off otherwise nothing would show.
  451. There we go that's the end of my button tag that span could possibly be tagged in
  452. now with that done I'm going to put in place my div and that div is going to be a
  453. class and it is a class of collapsible so that it can disappear if it needs to
  454. and it is a navbar
  455. collapse in place there
  456. and all that means is that anything inside of this action, if it's on a phone,
  457. don't show it natively.
  458. Now, the way that Bootstrap works to create its nav elements is it utilizes
  459. unordered lists. they are set as a class
  460. themselves of a navbar
  461. and
  462. it is a navigation type. I can add some other elements into it as well so I'm
  463. going to put it into the margins as an auto element so that it sets those out.
  464. I'm going to put a bottom margin on top as well of a two and I'm going to put in
  465. margin bottom on the larger element screens as zero because it'll take up too much
  466. space otherwise.
  467. And again, these are all just elements that you can play about with.
  468. They are documented
  469. heavily in Bootstrap's site, so you can see how to set those out.
  470. I will put in a list item, which will need a class of nav
  471. item so that it knows it is a type of navigation item for it.
  472. Now inside my nav item, this is where I put in my link, so my a href.
  473. And that's where I link it to wherever I want to link it to.
  474. So as this is going to be my browsing for my books, I'm going to put in a browse
  475. books link there. I'm going to write the words
  476. here of browse books
  477. and that's
  478. in place now to put it in place here I got browse books facilities acknowledgements
  479. and feedback form all I have to have is
  480. the same thing over and over a couple of times so I got browse books
  481. next one up I'm going to say is facilities and I'm going to Facilities section
  482. there. It's going to go to my Facilities page, lowercase F.
  483. I'm going to put in my Acknowledgements page.
  484. I'm going to put in Acknowledgements,
  485. lowercase A. And I don't need the feedback form.
  486. That was just there as a demonstration to see how it would look.
  487. If I put this up and I refresh my local page, I get my
  488. elements in place here. They're not pulling through as they should.
  489. little look as to why.
  490. What I've forgotten to do is give them a class on the tags here.
  491. Now by using the control key I can tag three elements, press space,
  492. type class equals and it puts all three in at the same time.
  493. Click and save that. Now when I refresh this one
  494. put it first then refresh it and they come up looking
  495. just the same as they do here the only difference being i don't have the underline
  496. in place just yet
  497. now i could have a link in place to my feedback form like i did previously
  498. and i'm just going to copy that put that in place there call it feedback
  499. and the reason i want to show you this one is just
  500. one last simple thing. I have my link from
  501. Microsoft Forms to go back into there.
  502. And if I go over and target it to a new
  503. page, and I'm going to say new,
  504. what will happen is and I put it up there and refresh
  505. it if I click onto it it opens a new tab as opposed to
  506. removing this tab here now I know if you've done any bits and pieces before with it
  507. you may be well aware of that command but if you come in from a draw plus point of
  508. view you may not know it so I just wanted to put that in place there for you so you
  509. could see what was going on
  510. so I've got my links to my different pages but my nav bar is not yet complete
  511. If I look at this, we have our search and our account buttons over on the other far
  512. side. I don't yet have those here.
  513. What I need to do then is put those in place.
  514. I'm done with this side of my unordered list though.
  515. So I can close that off and I'm in there.
  516. And I'm going to remain inside my collapsible section because I
  517. want these all hidden. And what I'm going to do is I'm going to put in a very simple
  518. form.
  519. and my form element here is only going to contain one input
  520. so i don't need a button for it because i'm going to use ajax as a type of searching
  521. element its id is going to be called my search
  522. and what i'm going to do is give it a bit of a stylization to it again using the
  523. bootstrap built-in elements we have a form element it's a form control i'm looking
  524. for and i'm going to put in that auto me its
  525. type is going to be a search so i've got that in place there
  526. and its placeholder text i can put in place
  527. to say search
  528. now that placeholder can say whatever you wanted to say i've got it here at the
  529. moment and it just search, I could go back into here and say instead of search,
  530. find a book.
  531. And that's what my placeholder text would say.
  532. And I'm just going to put that there for a second.
  533. And if I save this and put this up and refresh it, we get find a
  534. book appears over here. I click into it.
  535. Nothing happens at the moment.
  536. I got the X, which will close it.
  537. I'll come back to that.
  538. but it's not relevant at this point so I will come back to it when we do that
  539. section.
  540. I then want another unordered list section.
  541. That unordered list is going to be the same element as before so it's going to be a
  542. class equals and in there I'm going to say nav
  543. bar hyphen nav and I'm going to say mb hyphen two.
  544. Underneath is going to have its list item
  545. which is a class of nav item.
  546. And inside that section, I'll also still have that A
  547. tag, which is a class of nav
  548. link.
  549. Now, that link this time around is going to say account,
  550. and it is going to be a href to my account page.
  551. And save that.
  552. Put that.
  553. Refresh it. And we get the account button.
  554. So our nav bars, if I put them side by side,
  555. both have these elements in place.
  556. Now that expands. This one doesn't.
  557. That is because we haven't included the JavaScript forages yet.
  558. We'll get to it. work by the end of this video.
  559. But if I was to put them underneath each other, so one underneath the other, you'd
  560. see that they were pretty much identical.
  561. With that in place then, that's our nav bar setup finished for now.
  562. We are done with all of this section here.
  563. That's the end of my div tag here, which is the started up this section here, which
  564. is my nav bar. So I'm going to put in place the end
  565. nav bar section
  566. and save that so now I should be able to collapse my nav bar and I got
  567. end nav bar there as well if I put that up there and refresh my page
  568. everything is how it should look and that is the end
  569. of my head section. I've got the end of my navbar in place, all of that's there
  570. ready to go. And what we're going to do next is jump into the footer section, which
  571. will allow us to fix those issues with the navbar not working, the dropdown not
  572. working, before we look at the main index element.
  573. I have another pause by here a second, grab another drink, have another quick
  574. refresh before we go into this next section.
  575. okay so this final part then i call it the final part who knows let's go down and
  576. see what happens first things first i'd forgotten to give the id to a
  577. navbar so i've gone back into my navbar section i've gone after my button element
  578. where i set the controls name the data target as the navbar support on my
  579. navbar class I've given it its id navbar supported content.
  580. Now that's in place I've refreshed my page and it still doesn't do
  581. anything because we haven't included the javascript but without that the javascript
  582. wouldn't make a difference. I'm going to jump into the footer page now so I can
  583. close my header I'm done with it Dreamweaver doesn't like us having too many things
  584. open so let's close that and let's start into our footer section here
  585. Our footer section is going to be quite simple to start with, but we are going to be
  586. adding some CSS elements to stylize it a little bit differently as we go through.
  587. So even though we're on our footer page, we want to tag it as our footer section.
  588. And let's just end that footer section there to say that that's what we've got in
  589. place.
  590. The class for it is simply going to be our footer.
  591. We're going to have it as an auto for our margin.
  592. and we're going to put in just a few other little background elements just to
  593. stylize it into the right place as it was within Parkwood Vale's demo.
  594. As with previously, I'm going to use a container.
  595. So I'm going to have a class of container and end that
  596. class. And inside that class I'm gonna have a text span of
  597. a muted text meaning I
  598. want it to be a little bit dull looking now I'm just gonna put in my copyright
  599. details there for Parkwood Vale just again made up copyright details and put those
  600. in place and save that if I put and then refresh my page
  601. I'll get my bar going across the up there in the wrong place but we'll deal with
  602. that in a second but if i was to go like this that still doesn't do anything and
  603. it's bugging me so let's get that fixed
  604. what we want to do instead then is underneath this section we are going to have a
  605. script
  606. because our scripting should be one of the last things we have in place so i'm going
  607. to have a script tag.
  608. I can never spell the word script properly.
  609. The source for my script tag is simply going to
  610. browse into my Parkwood Vale and I got this bootstrap bundle JS file.
  611. Now that was taken directly from my download of my
  612. distribution JS bootstrap bundle.
  613. Copied that into that folder, refresh the element local files
  614. there it is and I've linked that there now we don't want this to take a priority
  615. and take up time when it's loading this for us so we're gonna put in place a
  616. simple command called a defer tag which means that it will load it but not take
  617. priority with it I want to save it and And over here then, I'm going to
  618. go to footer and put it. Make sure that I've put that file up as well.
  619. So everything should be in place.
  620. And when I refresh this now, I go like this.
  621. I should have had a jump out bar.
  622. Why is that not working? View page source.
  623. Muted text footer. It hasn't included my script tag there.
  624. I can see that's not loaded.
  625. So, footer, boot shop there.
  626. Perhaps let's just remove that defer for a second.
  627. And upload that.
  628. And there it is. It now jumps out.
  629. Perhaps it was the defer tag. Let's check it back in and see if it works.
  630. The defer tag.
  631. And put that.
  632. Refresh our page.
  633. it should have yeah the deferred tag shouldn't have affected it in that way it
  634. obviously just hadn't updated correctly so now we have in place our banner
  635. our navbar and our footer if i reload Parkwood Vale our banner
  636. with our logo there slightly different sizing our navbar
  637. same as our navbar and at the very bottom our footer is the same as our footer.
  638. That's our template sections completed with the exception of the fact that we don't
  639. have our background picture in place.
  640. So let's see if we can do something about that.
  641. I have a style CSS document here just right click new file and put in our style CSS
  642. and if I open up my style CSS here it is an empty CSS document.
  643. And what I want to do is have a look at what we're going to include to make sure it
  644. includes everything we want it to.
  645. Start off with, we need to stylize the HTML tags we're going to be using.
  646. I'm going to say HTML to tag all of our body.
  647. And I'm going to say that with our HTML tag, I'm going to be focusing on its
  648. position. And its position for everything is going to be relative.
  649. So anything that has any changes or anything like that, it's all linked back.
  650. I say it's min height is going to be 100% because I want it to be the full of my
  651. screen. I say padding. And this time the padding at the bottom of my screen is going
  652. to be 60 pixels.
  653. I save that.
  654. I'm going to go down a little bit further.
  655. I'm going to put in my body tag.
  656. And I'm going to directly impact my body because I want to focus on my background.
  657. And this time if I scroll through these, I want my background image.
  658. then I'm going to put in a URL tag I'm going to browse to it and the picture I want
  659. is in my Parkwood Vale images folder and we're going to start off with our webp
  660. background image.
  661. Now again we can't guarantee that they all work so we have a fallover too and I'm
  662. going to browse to the png version of that same file
  663. and I'm going to end that with a terminating tag.
  664. I'm also going to say that my body has a margin on its bottom section as well which
  665. is a margin 60 and
  666. i'm going to leave it as it is at the moment i do want to stylize my footer
  667. my footer tagged by using the footer tag there its position is going to be
  668. absolute
  669. which means that it doesn't move it isn't relative it is locked in place
  670. the bottom element means that any position from the bottom of my screen is zero
  671. its width not windows width is going to be 100 percent
  672. and let's not forget to make that its height is just going
  673. to match that 60 pixel element that I've specified for the different sections
  674. now with that in place then they're all saved there is
  675. going to have to put that up to there make sure that in my index
  676. so there is my not my index sorry my header my header has
  677. that link to my star css should be in place let's close that let's close that close
  678. that and close that so everything's closed down and if I go into here and refresh
  679. we have a background picture and our footer
  680. is in the right place that's because if I go back into my CSS a second
  681. of this section here given its absolute position at the bottom of my screen 100%
  682. width and 60% height and these padding elements and margin elements make sure that
  683. we don't overlap that in any way
  684. And that there is the template element for all of my pages.
  685. If I jump back onto here a second, if I go to browse books, facilities,
  686. acknowledgements, all the pages, accounts page, have the same background, same
  687. layout, same structure.
  688. And now on here, they do as well.
  689. The main difference being, if I try to go to them, they don't find them because we
  690. haven't created them as of yet.
  691. The only one that will work is the feedback form.
  692. We have a background picture and we have this section here.
  693. That will put in place all of the basic elements we need for all of our different
  694. pages. My index page then, if I was to reopen up my index page here, has my
  695. header included, my footer included,
  696. and I can start to put in place what I want to.
  697. So in between this, I will have a main section, which will have its class
  698. container,
  699. and that puts in place my main section for the main of my text.
  700. Inside my class container then I can start to put in different elements.
  701. Now I haven't set up my slideshow yet.
  702. I'm going to leave the slideshow for next week's video but I will put in place some
  703. of the text elements so you can see how they look.
  704. So I'm going to put in place a div
  705. here,
  706. a div tag, and that div tag is going to be set up
  707. with a class
  708. equals P,
  709. and it is a padding for.
  710. Now inside that div tag there,
  711. text and my bits and pieces. So I'm going to have some basic p-tags for my different
  712. paragraphs.
  713. So there's my first paragraph and I'm just going to take it directly from Park with
  714. Vale and paste it there. Now if I was to put my index
  715. page up and refresh my index page, it appears,
  716. but we can't really see it. We need to change the color so that we can
  717. read what's going on on our different section here.
  718. Now inside my container to colorize it all what I'm going to do is put in a div
  719. and I'm going to class that div as a
  720. margin bottom four so we've got a bit at the bottom section of it and i'm going to
  721. stylize it putting in place a background color
  722. and the background color is simply going to be an off white color ef ef ef
  723. giving it that grayish sort of look and if i close that tag
  724. i want to end it the other side of this and all of
  725. this should be indented correctly.
  726. Now when I refresh it, if I remember to put it,
  727. it comes up in the right color.
  728. So I can now see it. And as you can see, that nav bar is not, that photo bar is not
  729. jumping up to grab it all the time.
  730. It stays in place.
  731. If I go here, we have this section here in place.
  732. I'm going to go through. I'm going to add in the next paragraph so paragraph tag
  733. again and simply put in place the next set from
  734. parkwoodvale
  735. and then i'm going to put in p because
  736. there's four p tags to start off
  737. And in a second, I'm going to show you how I've stylized some of those differently.
  738. So there's all my P tags. If I put that file up, I can refresh it.
  739. And there are my different sentences.
  740. On here, it looks different because we don't have that slider banner.
  741. But there's our text. The text is a different font.
  742. I'll come on to fonts at a later stage.
  743. I have that in place there then.
  744. And all I'm going to do for my different P tags, let's keep them all in line, shall
  745. we?
  746. How did I do that I missed
  747. But there and let's check that there so they're all in And at the starting point
  748. of each of my p tags I'm gonna give them a class and that class is a
  749. class of lead text and margin three
  750. And if I put that up and
  751. and refresh this, we get it a little bit nicer on its layout.
  752. So we're starting to put together and structure our pages.
  753. Once I've done all of that and I'm happy with all of that section, this is where I'm
  754. going to start going into using those rows, those divs and things I was talking
  755. about within Bootstrap.
  756. So again, I'm going to go div class equals
  757. row.
  758. And inside that class of row, I'm going to go div class
  759. call MD6.
  760. Now on this section, you have
  761. photo half a table.
  762. six by six. So they each take up an equal proportion of my section.
  763. On the one side, then I have my opening times, which is my table.
  764. On the other side, I had my picture.
  765. So I'm going to put in place a picture tag like we did in our
  766. logo section. I'm going to put in its source
  767. is a source set
  768. equal to and I am gonna just simply
  769. use the same set up as I did previously
  770. like and put that in place I'm also going
  771. to include the link to my image,
  772. capital I,
  773. and that's where my image property comes into place.
  774. So if I save that and put that up and refresh this,
  775. it's not finding that picture.
  776. So have I not included that picture correctly?
  777. What have I done wrong there then?
  778. I said images, WebP, outside WebP.
  779. Let's have images, WebP. Do I have, I have outside WebP.
  780. Why is it not happy with that one?
  781. I got images. That's why, I know why.
  782. That says image, they say images.
  783. Let's remove the pluralization,
  784. save it,
  785. reput it.
  786. Make sure I'm putting the right thing.
  787. And refresh this, and my picture appears.
  788. slightly not indented there and it's missing the title for opening times.
  789. My picture is there.
  790. So I'm starting to put this in place before my row.
  791. I'm simply going to put in my H2, which is my title and it's going to be class.
  792. Let's see. We've got display.
  793. I want it display 4.
  794. and I want it in italic so fst italic and I want a margin
  795. on the bottom of it which is a margin four and it's just going to say
  796. open in times and save that now it's in this row it's in its
  797. columns it's in that section there I didn't, as I did with Parkvale, put all of
  798. this itself. So let's div that and say class
  799. equals padding for, which is why I had that difference in size just now.
  800. And all of this is going to be indented before
  801. putting this section there. Now, put that file,
  802. refresh it, and there we go.
  803. Looking almost identical.
  804. On the other side then, in this section here, we're going to start putting in our
  805. table. Our table is just made up in a standard HTML format.
  806. So I'm going to say table, and I'm going to close that off.
  807. And then my table tag, I'm going to go into place and set my class for it.
  808. So its class is going to be a type of table, surprisingly, and is the
  809. table striped.
  810. Now, again, if I come back into here and I go to Bootstrap,
  811. in the Bootstrap documentation, you'll have a section.
  812. If I search for it, just to show you how the search works, if I go to table borders,
  813. we have our different table layouts and different styles.
  814. tables, large tables, we've got all the different elements all to do with our tables
  815. here and how they could possibly look.
  816. If I go back to the very top of our table, we've got overview and we've got our
  817. colors and this is the one we're using which is table table striped.
  818. On our table striped then we're going to put in place the header section so t head.
  819. Our t head doesn't have its own class.
  820. we're going to have inside of our t head a tr for a table row and inside
  821. of that a th for its own element for its header section
  822. now this is going to have a class to it which is simply
  823. call one
  824. do we have column now just call one and that
  825. is simply going to say in there Day.
  826. And underneath. A second th.
  827. That follows suit. Which is going to say.
  828. Times.
  829. Let me just copy that.
  830. And with that in place then. That's all set up for our head section.
  831. We then go into our table body.
  832. T.
  833. Body.
  834. And we're going to do a separate row.
  835. for each day of the week. So TR for table row.
  836. Inside there, we're going to have a TD for each table element.
  837. And the first one, obviously, you can say Monday.
  838. Depends on how you start your week.
  839. I always start with a Monday, not a Sunday.
  840. I'm going to say TD then for my next section, which is going to be the times.
  841. So I'm going to say 9.30 a.m. until
  842. I say 5 p.m.
  843. now if you copy that one two three four five six
  844. seven depending if you want to have different times of the day that's where you
  845. could specify it but you did put in Tuesday,
  846. Wednesday,
  847. the different
  848. days of the week.
  849. save that put that up and when i refresh this now we have our
  850. days and times just like we have here
  851. there's those elements i have in place about when it's closed i haven't included
  852. that there but that would just be simply updating this here to say closed
  853. so it specifies that difference.
  854. And if I refresh that now, that now says closed.
  855. We have that there. Last part is the location, the address and details.
  856. I'm going to skip slightly over the location.
  857. Now, where we to this table has taken up a lot of my space.
  858. So we got a background there. We got that section there.
  859. And let's bring that down.
  860. Let's add some good practice in place and put in some comments.
  861. so intro and let's say down here we're gonna
  862. end intro
  863. and then if I go down here this would be
  864. table section
  865. and underneath it I'm going to end my table section
  866. just
  867. so that that's all a little bit nicer a little bit neater and easier to manage
  868. like I said I'm gonna jump over the actual
  869. nav element here because this is gonna come in a bit more of an advanced video I'm
  870. gonna jump straight to this address and contact details section so I'm gonna put
  871. this in place here as address and then
  872. end
  873. address
  874. and let's put that in place
  875. so that works very much in the same way as our previous sections we have a div
  876. that is going to be of class and it is
  877. P4 for this section. So it's got its padding in place.
  878. It's going to have a H2 for my secondary heading.
  879. And that is going to have the same element.
  880. So class is still going to be display 4.
  881. I still want to have it in italic.
  882. So FST italic. And I still want it to have its margin
  883. of 4 in place.
  884. And all I'm going to do in that section there then is a address and that's me
  885. set up ready to go into that next section.
  886. I'm going to put in a p tag and inside that p tag I'm going to put that as a class
  887. lead
  888. my3 and paste the address that I made up for Parkwood Vale.
  889. It is a completely fictitious address and it will lead to nowhere.
  890. I'm going to do the same thing.
  891. So we've got that p4 there on that section.
  892. I'm going to do the same in another div.
  893. So I've got all of those there.
  894. what I forgot to do somehow is put in my row.
  895. So I want div class equals
  896. row margin top five.
  897. All of this is going to be indented.
  898. I'm going to take that end div there dot there.
  899. in a second because it's a div class call
  900. md6
  901. and
  902. i'm going to repeat that just copy that and paste it and change it over so instead
  903. of address i got contact details and then just use
  904. again the made-up contact details that are in place.
  905. Let's indent that P and save that.
  906. And now if I put that in place, what I should get is on my local host, my
  907. contact details are there as well, just like they are there.
  908. But again, the only exception, the only difference being the font style.
  909. So I've designed in this video, the homepage of my website,
  910. that if I drag it down and put it side by side with Parkwood Vale, you can see they
  911. look the same, slightly different on narrowing elements.
  912. They both have the pop-up menus.
  913. We haven't included the JavaScript for our image gallery, so I have not included an
  914. image gallery. And we haven't gone over the advanced features for our API here for
  915. Google location, so I haven't included that.
  916. But there is my whole home section for my video.
  917. That is one complete page rundown done.
  918. If I wanted to go into, I'm going to go to facilities as my next page.
  919. What I'd need to do is create a new page on the site here called facilities.
  920. So let's go into my site. Let's minimize some of these folders.
  921. And I'm going to right click, go to new file and call it facilities
  922. .php.
  923. and I'm going to go close this down and in fact actually I'm going to
  924. take my include head there onto my facilities page I want to
  925. include hair I also want to include the foot on my facilities page
  926. include foot and I'm going to save those there and in
  927. my head section just because we
  928. to go through .htaccess i need in my nav bar where it says
  929. facilities to do dot php
  930. now if i put that up and put up my facilities page up there
  931. i should be able to now go from here if i hover over
  932. facilities in the bottom corner it says facilities.php if i click onto it it loads
  933. my facilities php page no longer get that error saying it doesn't exist
  934. Parkwood Vale, it takes me back home.
  935. So I have those links in place.
  936. And as you can see from those links, they look identical.
  937. If I look on the actual Parkwood Vale facilities page, they do look identical.
  938. And then this is just a combination of those div row sixes.
  939. So I could steal code from my index page,
  940. especially where I have my, say, address section here.
  941. I could take the address section, copy it to my
  942. facilities page and paste it there.
  943. Now if I put that page and load it a second you'll see that it doesn't quite fully
  944. work because I haven't included one other thing which is on my
  945. index page my container and my background color so if
  946. i my container my background color in place and then i finish off my div
  947. and my main
  948. elements and save and put those now when i refresh this
  949. it does come into line ever so slightly
  950. slightly gap a slight gap there because of the way that the top of this page is set
  951. out it should come into place it's that p4 section there that i don't have on this
  952. one so where's that that's div class p4 to start with so i want
  953. that in there but we'll be replacing that with our image
  954. gallery when we come to do it.
  955. And then it's just a case of using our call sixes to invert back and forth between
  956. pictures so we can put that in place.
  957. Now this video itself has been about an hour and a half in length.
  958. Hopefully that should be a nice in detailed in-depth guide on how to create your
  959. homepage, how to include the elements you need, link your pictures and put
  960. everything in place. If I very quickly jump back into inspect and
  961. I go back to the lighthouse function,
  962. in fact, where did that disappear to?
  963. It's on this arrow here, lighthouse, and I analyze it again for desktop,
  964. analyze my page. It should give me nice high values.
  965. It may have one or two little issues with some of the accessibility features.
  966. okay so we're still up in the high 90s 100 for some accessibility like i said
  967. background image ratio color h my language doesn't exist little easily fixable
  968. elements largest content there some other bits and pieces nothing
  969. to be concerned about hopefully that code is easily
  970. visible to you hopefully you can follow this through and see how to create that
  971. template and your first
  972. In the next session, we will go through how I created that image gallery so
  973. we can add that element in place before we start looking at interactivity with PHP.
  974. Any issues, by all means drop me an email, try and contact me and I'll do my best to
  975. try and alleviate this. And if you need this broken down further, let me know and I
  976. will do my best to do so there.
  977. Thanks again for watching guys.