Is there a way to...

Bastty

Customer
... Implement those codes in any community? I mean, what's the right way to do it!

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!
 
I think it'd need some custom development rather than editing core files, but I'm sure it's doable. Might be best to ask someone like JoyFreak who knows more about add-ons than me :)
 
Back
Top