Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Admin area title and section

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 153 Views
  • Sultan
    Avatar
    Community Member
    8 Posts

    Admin area title and section Link to this post

    I have tried to change the setApplicationName in the back end by the following process.
    I have a text box in admin area which when filled must take and show as the title in the admin area.
    For example in LeftAndMain.ss we have
    <title>$title</title>

    So when the text box is filled with something $title must take the text box value.
    For that what i did is I made a CustomLeftAndMian.php

    in that i have written a function

    public function CustomTitle(){
          $titlefirstpart = CustomLeftAndMain::SuperAdminVals()->Providedby; // this returns the text box value
          if(!$titlefirstpart)
          $titlefirstpart = "Hubflx";
          return ($section = $this->owner->SectionTitle()) ? sprintf('%s - %s', $titlefirstpart, $section) : $app;   
       }

    and I have also overridden LeftAndMain.ss and inside that i have
    <title>$CustomTitle</title> ..

    Now I get the result as expected, that is i get the value from the text box.

    But the problem is on ajax load the value changes and takes what is given in mysite/_config.php in LeftAndMain::setApplicationName('Hubflx');

    Again when i refresh the page it takes the text box value.. It does not work on ajax load..
    Any suggestions to fix this will be greatly appreciated.. Thanks a lot..

    153 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.