SMF Development > Bug Reports

Meta board description to be used...

(1/2) > >>

ɔɔɔɔɔɔuɥoɾ:
index.template.php


--- Code: (find) ---<meta name="description" content="', $context['page_title_html_safe'], '" />
--- End code ---


--- Code: (replace) ---<meta name="description" content="', empty($context['description']) ? $context['page_title_html_safe'] : $context['description'], '" />
--- End code ---

The above code will use the board description (if you entered it) instead of the board name. It has been helpful for me and could be for others.

If descriptions for boards are not used, the meta description will be reverted to what it does currently, uses the board name.

Good idea?
Bad idea?
Why?

Kindred:
actually, I moved tyhis to bug reports....   because in reality, the way you  posted SHOULD be the action, if not the way, the description is handled...

K@:
Is this all versions of SMF? Or, just v2.x?

Arantor:
The same change could be applied to 1.1.x. However I'd also note that $context['description'] is used in other places too.

A better solution would be have both MessageIndex.php and index.template.php use $context['meta_description'] in line with $context['meta_keywords'].

Also, if you're fixing this up, you might as well go as far as adding code to get the first post in the thread display, parse_bbc, strip_tags, and push that into the $context['meta_description'] there. (No, you can't get it as a by-product of the regular post getting; the headers have already been issued at that point. Though if you really wanted to, you could issue some kind of replace string in to the description as a placeholder, and replace it in the buffer before sending it on.

ɔɔɔɔɔɔuɥoɾ:
A bug huh ???

This is supposed to happen by default?
I think their is potential for SEO improvement using this change.
I thought of this a few days ago, I asked a friend about the meta description, after a little discussion about why the meta description tag is still important for SEO (Google anyway), We got a solution, we can thank Arantor for the solution, it was discussed HERE.

Navigation

[0] Message Index

[#] Next page

Go to full version