HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to Change Title Seperator from — to |

i want to change the title separator from  —  to |

Tagged:

Comments

  • Sorry for my slowness. You mean the url separator? how-to-change-title-seperator-from-

  • Not url i'm talking about Title Example: How to Integrate PHP with C — Forum Name to How to Integrate PHP with C | Forum Name

  • Ah, yes! That is taken care by the /applications/dashboard/modules/class.headmodule.php

    And the variable is _TitleDivider

    I am unable to inject a change by... maybe somebody else can help with the correct method of doing this injection :)

    class mypPlugin extends Gdn_Plugin {
      public function __construct($sender, $_TitleDivider) {
        $_TitleDivider = ' | ';
        parent::__construct($sender, $_TitleDivider);
      }
    }
    

    But this very nasty hack works like a charm :)

    class myPlugin extends Gdn_Plugin {
      public function base_render_before($sender) {
       $mirrorOnTheWall = new ReflectionClass($sender->Head);
       $property = $mirrorOnTheWall->getProperty('_TitleDivider');
       $property->setAccessible(true);
       $property->setValue($sender->Head, ' | ');
      }
    }
    
  • Okay, it turns out I was over thinking things. It's just a one-liner... hurrah!     $sender->Head->setTitleDivider(' | ');

    And your plugin or theme hook would like this

    class myPlugin extends Gdn_Plugin {
      public function base_render_before($sender) {
       $sender->Head->setTitleDivider(' | ');
      }
    }
    
Sign In or Register to comment.