Jump to content

Meta tag: Description


Aladin

Recommended Posts

Posted

IPBoard v3.1.2, SEO question.


User is posting a new topic. Besides Topic Title he also has an option to post Topic Description.

Why (if exists) Topic Descripion is not put in field:
<meta name="description" content="Topic Descripion" />

and only! if Topic Descripion is not available then
<meta name="description" content="First post limited X characters" />



Users are far better in describing their own topic, then first X chars. of first post.


What should be changed and where to make this change?

Posted

Change /admin/applications/forums/modules_public/forums/topics.php

Original code:
$this->registry->output->addMetaTag( 'description', str_replace( "n", " ", str_replace( "r", "", strip_tags( $this->_firstPostContent ) ) ), FALSE, 155 );


Change to:

if ( $this->topic['description'] )
{
$this->registry->output->addMetaTag( 'description', str_replace( "n", " ", str_replace( "r", "", strip_tags( $this->topic['description'] ) ) ), FALSE, 155 );
}
else
{
$this->registry->output->addMetaTag( 'description', str_replace( "n", " ", str_replace( "r", "", strip_tags( $this->_firstPostContent ) ) ), FALSE, 155 );
}



Is this solution or some other changes should be made?

Posted

This may be better off in the feedback forum, since you want a certain change made and that's the place to make requests. Would you like this moved there?

Posted

Whether or not that code will work, I don't know as I haven't tried it out. However, you are free to make any modifications to your own board that you want to make.

Moving this to the feedback forum so that the suggestion can be considered for future releases.

Posted

Tho code works. Otherwise I would not post it.
Just needed confirmation if its ok or it should be done in other way?

You might consider making it standard in future versions.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...