TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 523
  • Total: 524
  • lurkalot

Meta tag conventions??

Started by sturmkatze, March 22, 2009, 06:19:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sturmkatze

Okay, so I've been up all day driving. Smoke is trailing out of my ears and I have a small question... when I am doing the meta tags in the index template, how do I do the description? I have this below... where do I add the description to this?? Sorry for being obtuse, I'm tired. Thanks...

<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '

Ianedres

This is modifying the SMF core code rather than TP, but will try to help just the same.

The 'content' field is being supplied the page's name; if you want to add text to it, try this (using your provided code):
<meta name="description" content="', $context['page_title'] . ' : your new text goes here' , '" />', empty($context['robot_no_index']) ? '' : '

I put a colon in the string to set it off from the page title...  but you can change it to your liking.

This should be part of a bigger echo statement, but should drop right back in where you got it. I can only emphasize to make backups beforehand.

sturmkatze

Basically what I'm trying to do is add the meta tag description. Below is how I would do it on a regular html website.

<meta name="description" content="my site description text here">

Ianedres

Look through the code for the "new text" section; that should do what you want.

This website is proudly hosted on Crocweb Cloud Website Hosting.