Making a related content box

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

I am trying to work out how to make a related content box on my website I thorght about using a meta tag or something.
How would one do something like this? Normally I would make them myself but for this website it requires that the website works them out for its self.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Which part do you actually need help with ? :scratchhead:

I would use the <meta> keyword element as you suggested if it was a site I had control over or could be certain I was going to get well targeted keywords from.

Here's an example of retrieving the keywords using javascript.

Code: [ Select ]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Title</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta name="keywords" content="one,two,three"/>
</head>
<body>
    <div>
    <script type="text/javascript">//<![CDATA[
    var elms = document.getElementsByTagName('meta');
    for(var i=0; i<elms.length; i++)
    {
        if(elms[i].name.toLowerCase() == 'keywords')
        {
            document.write(elms[i].content);
            break;
        }
    }
    //]]></script>
    </div>
</body>
</html>
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3. <head>
  4.     <title>Title</title>
  5.     <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  6.     <meta http-equiv="Content-Style-Type" content="text/css" />
  7.     <meta name="keywords" content="one,two,three"/>
  8. </head>
  9. <body>
  10.     <div>
  11.     <script type="text/javascript">//<![CDATA[
  12.     var elms = document.getElementsByTagName('meta');
  13.     for(var i=0; i<elms.length; i++)
  14.     {
  15.         if(elms[i].name.toLowerCase() == 'keywords')
  16.         {
  17.             document.write(elms[i].content);
  18.             break;
  19.         }
  20.     }
  21.     //]]></script>
  22.     </div>
  23. </body>
  24. </html>
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

its got a kind of blog system on it and baced on the keywords of the blog the website needs to find blogs with the same or symler tags and put the link on to that blog. My problem is is that I have no way to seraprate the key words of that blog from the meta description tag for the site.

I don't think im explaining this very well bascily is it possible to make your own meta tags? and then use the above code on that? Or will that not validate?

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 62 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.