hi all,
i'm pretty new to the world of web development, and i can't seem to find an answer for this particular problem.
i'm building a website of about 200 pages in three languages. it's already clear to me that re-occuring elements will have to be pulled in dynaically with php, like the footer and nav bar.
what isn't clear to me, is how do i dynamically attach the "current" class to the right nav item based on the page i'm in.
for instance, if i'm in "home" - then attach the current class to home, if in products- then to products, and so on.
the old fashioned way is to add and remove the class manually on each and every page (not an option)
how do i dynamically attach a class to an item pulled from an external file?
my guess would be to match the page's url to the nav bar element, and if it exists- add the class....
are there any examples of such a code?
thanks
wassabi