Bastty
Customer
... Implement those codes in any community? I mean, what's the right way to do it!
Custom Meta Description for Threads:
Custom Meta Title for Threads:
No Index for Individual Threads:
Thank you in advance!
Custom Meta Description for Threads:
Code:
public function threadView($thread, array $forum, array $node, array $post, array $user)
{
$metaDescription = $thread['title'] . ' - ' . $thread['prefix'] . ' - ' . $forum['title'] . ' - ' . $node['title'];
\XF::app()->container('page.description')->set($metaDescription);
// Rest of the code for displaying the thread
}
Custom Meta Title for Threads:
Code:
public function threadView($thread, array $forum, array $node, array $post, array $user)
{
$metaTitle = $thread['title'] . ' - ' . $thread['prefix'] . ' - ' . $forum['title'] . ' - ' . $node['title'];
\XF::app()->container('page.title')->set($metaTitle);
// Rest of the code for displaying the thread
}
No Index for Individual Threads:
Code:
public function threadView($thread, array $forum, array $node, array $post, array $user)
{
\XF::app()->response()->setHeader('X-Robots-Tag', 'noindex');
// Rest of the code for displaying the thread
}
Thank you in advance!