1
Cozzie
customizing the description metatag
  • 2008/12/3 10:31

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Hi, I've added this code to my newbb forum pages (viewtopic.php)

$xoops_pagedesc $viewtopic_forum->getVar('forum_name') . ', ' ". $forumtopic->getVar('topic_title') . "";


It means that my metatag page description now shows as the forum name followed by the title of the post.

Its not a bad solution i think but it means my meta description is very similar to the page title. I think a better solution would be to have the pagedesc assigned as the text of the first post of each topic (perhaps with a character limit of 255).

But try as I might I can't make this assign. So I was just wondering if anyone might know how to do this?

Thanks a lot

2
ghia
Re: customizing the description metatag
  • 2008/12/3 11:20

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


It will be a similar code to add but in the part where the post_id is handled. For code, have a look in viewforum.php, where the title attribute of the thread links is filled in with the posttext.

3
Cozzie
Re: customizing the description metatag
  • 2008/12/4 3:00

  • Cozzie

  • Not too shy to talk

  • Posts: 133

  • Since: 2007/7/13


Thanks a lot for the reply Ghia

I've really tried to figure it out based on what you said but still can't get it. Any chance you could explain a bit more?

thanks

4
ghia
Re: customizing the description metatag
  • 2008/12/4 3:19

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


If you hoover with your mouse over the topics in a forum list (viewforum.php, click on Q&A at the top on this page to see it), then a short extract from the start of the text appears (In the html source you see this text also in the title attribute of the link.). I think, it is this kind of text you want for your metatag. So, you can look in the code of viewforum how they assembled it for this title attribute.

5
BigJim
Re: customizing the description metatag
  • 2008/12/8 3:10

  • BigJim

  • Just popping in

  • Posts: 78

  • Since: 2007/7/16


I follow your meaning and I've tried to do this but the code is very confusing to me - can anyone help futher???

Thank you

Login

Who's Online

439 user(s) are online (312 user(s) are browsing Support Forums)


Members: 0


Guests: 439


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits