Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Building Websites with PHP Slim Basics & Twig Templates Layouts with Twig

Navigation links for index.html and contact.html imbedded in the header do not work after creating main.twig

After creating about.twig and contact.twig the nav links are broken. I have tried using about.twig in the anchor but it remains broken.

Is this by design or did I miss something?

Can you share your code?

2 Answers

Michael Soileau
Michael Soileau
9,431 Points

"After creating about.twig and contact.twig the nav links are broken. I have tried using about.twig in the anchor but it remains broken."

Your url route in the index.php doesn't match that right now. Right now, it matches "/" and "/about" only. So going to about.twig, about.php, or about.html will not match the url route that has been setup. If you just want it to work, rename the href's to "about" and "/"

I wondered the same thing ..... I'm guessing we'll learn that piece in the next segment. I figured if I got the /contact url to work, then I'm on the right track.