Use conditional logic to determine when an item in the navigation is the currently selected item and add a CSS style to change its appearance for the user.
- [Instructor] In the previous movie, we learned to show…page content as the user makes choices in the navigation.…But we realize that there's a problem with it,…which is that there's no indication for which page…is currently selected in the navigation.…And we're going to fix that in this movie…by learning to highlight the current page.…So what we want to do is have it so that when we click…on Globe Bank, that there's some indication…that Globe Bank has been selected.…And we click on History, we want an indication…that History has been selected.…Sure it says it here, but there's no indication…in the navigation, and that's what we want to add.…
So, the first thing I want to show you…is that there is a style that's already…in the style sheet to help us with this.…In public.css, if we scroll down here…til we get to the part on the navigation,…you'll see that there's a style here that says…whenever there's a class of selected, then the a tag,…the link that's inside of it, should have a different color.…Alright, that's all it is, it says anytime there's that…
- Creating a content management system
- Building dynamic content navigation
- Using context and function options for conditional behavior
- Hiding content from the public view
- Insecure direct object reference
- Allowing HTML in dynamic content
- Previewing content in the public context
- Working with cookies and sessions
- Storing status messages in the session
- Secure user authentication (login/logout)
- Regulating page access
- Nesting related resources
- Managing an ordered list automatically
Skill Level Beginner
PHP with MySQL Beyond the Basicswith Kevin Skoglund10h 26m Intermediate
MVC Frameworks for Building PHP Web Applicationswith Drew Falkman2h 57m Intermediate
1. Create a Content Management System
2. Build Dynamic Content Navigation
3. Use Context and Options
4. Cookies and Sessions
5. Regulate Page Access
6. Nesting Related Resources
Next steps1m 15s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.