ok, on my site I am using dynamic meta tags so basically.. <meta name="keywords" content="boredombase, games, videos, pictures, funny videos, funny pictures, linerider, school games, games for school, {file[title]}" /> <meta name="description" content="{file[description]}"> Is my meta tag, firstly, for the keywords, on some occasions there is no title so the meta tag will end like school games, games for school, " with the , on the end before the ". Does this matter? Secondly, on some occasions there will be no description, so if the meta tag is <meta name="description" content=""> with nothing in it, will the search engines ignore this tag and base the description on the page content?
why would you use content="" instead of just skipping out on the tag entirely? you can check in php if the variable is empty and if it is don't echo that part. that's what I'd do, personally. if you repeat your keywords a lot the only real risk is that of duplicate content. but if the content isn't borderline duplicate, it won't be an issue. vbulletin, out of the package, uses the same keywords on every page... and vb's get crawled fine.
Come on Ryan, you;ve been playing around with PHP long enough now... $meta_keywords = '<meta name="keywords" content="boredombase, games, videos, pictures, funny videos, funny pictures, linerider, school games, games for school'; if (tep_not_null($file['title'])) { $meta_keywords .= ', ' . $file['title']; } $meta_keywords .= '">'; echo $meta_keywords; if (tep_not_null($file['description'])) { echo '<meta name="description" content="' . $file['description'] . '">'; } PHP: Using the function I pasted in the other thread.
I have an excuse - school, lol. I seem to be getting an error on this line. if (tep_not_null($file['title'])) { Fatal error: Call to undefined function: tep_not_null() in /home/base/public_html/include.php on line 3
Oh haha. OK, I added back so my code is now: <?php $description = $file['description']; if($description == ''){ $description = "description was empty"; } $meta_keywords = '<meta name="keywords" content="boredombase, games, videos, pictures, funny videos, funny pictures, linerider, school games, games for school'; if (tep_not_null($file['title'])) { $meta_keywords .= ', ' . $file['title']; } $meta_keywords .= '">'; echo $meta_keywords; if (tep_not_null($file['description'])) { echo '<meta name="description" content="' . $file['description'] . '">'; } PHP: I still get the error on line 8 though. if (tep_not_null($file['title'])) { PHP:
I'm learning... Never knew meta tags could be generated dynamically... Does dynamic generations have an added advantage??
Nope not really, apart from the meta tags are automatically created based on my file title and description etc.
Dude, read my posts in the other thread. You still don't have the funtion, you pasted another suggestion from that thread. Pick one or the other but like this it won't work. If you want my code from this thread to work, go to the other thread and paste the "function tep_not_null($value) {...etc" towards the top. EDIT: http://forums.digitalpoint.com/showpost.php?p=1827474&postcount=4 that code
Sorry, I didn't realise you meant that OK, I done that and it got rid of the errors, however it only showed the keywords meta tag and didn't show the file title.
I came up with a fix. I included {filemeta} and {indexmeta} in my header, but only pulled {filemeta} on the display page file so it was ignored on index and all the other pages apart from the file page. Thanks for help guys