Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.