Ricky55 Posted April 8, 2011 Share Posted April 8, 2011 Hi I've been using includes for a while now but I'm just starting to do more with them. I'm currently working on a site where my header include brings in code from the doctype, includes my nav and then to the start of my opening wrapper div. I'm generating the page titles from the file names and I'm also using these to create my menu downstates. All is well but I was just wondering what the best practice was for creating unique meta data for each or at least some of the pages? Would I be best just creating a variable in each page and then echo out the meta data or is there a slicker way? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/233133-best-way-to-handle-unique-meta-descriptions-when-using-includes/ Share on other sites More sharing options...
chaseman Posted April 8, 2011 Share Posted April 8, 2011 I myself use the technique that you've already mentioned, what is it that you don't like about it, which makes you look out for something better? Quote Link to comment https://forums.phpfreaks.com/topic/233133-best-way-to-handle-unique-meta-descriptions-when-using-includes/#findComment-1198965 Share on other sites More sharing options...
Ricky55 Posted April 8, 2011 Author Share Posted April 8, 2011 Nothing really I'm just new to PHP and I always like to make sure I'm doing things the best way I can. I was asking more from a learning perspective. Thanks for replying. Quote Link to comment https://forums.phpfreaks.com/topic/233133-best-way-to-handle-unique-meta-descriptions-when-using-includes/#findComment-1198968 Share on other sites More sharing options...
spiderwell Posted April 9, 2011 Share Posted April 9, 2011 i made a cms system which stores title,meta keywords & page content all in a db, but its much the same result really. if i really wanted to be clever, i should build a publish button to 'write' the final page in html, so the db isnt hit on every page request, but most the sites i make arent as popular as facebook so its not really an issue Quote Link to comment https://forums.phpfreaks.com/topic/233133-best-way-to-handle-unique-meta-descriptions-when-using-includes/#findComment-1199050 Share on other sites More sharing options...
Ricky55 Posted April 9, 2011 Author Share Posted April 9, 2011 Thanks guys I can feel better about using this method now. Quote Link to comment https://forums.phpfreaks.com/topic/233133-best-way-to-handle-unique-meta-descriptions-when-using-includes/#findComment-1199146 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.