Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Added a new page in admin cms but after reload, it is not under admin cms


Go to End


2 Posts   1237 Views

Avatar
chetanp

Community Member, 2 Posts

30 May 2017 at 10:31pm

Edited: 31/05/2017 7:32pm

I am trying to add new settings page and emails page. When you click on emails menu, it is under silverstripe admin cms but After reloading Emails page, it is not under silverstripe admin cms.

Here is controller code:

public function index() {
    $getmem=Member::currentUser();
    if($getmem->RainloopEmail !='' && $getmem->Pass !='')
    {
        $com=$getmem->RainloopEmail.":".$getmem->Pass;
        $encrypted = base64_encode($getmem->RainloopEmail) ;
        $rainloopemail=$encrypted;
        $encrypted =base64_encode($getmem->Pass);
        $pss=$encrypted;

        $hash=base64_encode($com);

    }
    else
    {
        $rainloopemail='';
        $pss='';
        $com=$getmem->RainloopEmail.":".$getmem->Pass;
        $hash=base64_encode($com);

    }
    $url='http://op.mctitsolutions.com/rainloop/rainloop.php?hash='.$hash;
    $arrayData = new ArrayData(array(
'Width' => '100%',
'Height' => '100%',
'Location'=>$url ));

return $arrayData->renderWith(Array('EmailsAdminController_Content','Coach_message','Page'));

}

And here is template file code:
<div style="padding:55px 20px">
$EditForm
<iframe  id="MainPopupIframe"  width="$Width" height="605px" src="$Location"></iframe>
</div>

Avatar
chetanp

Community Member, 2 Posts

31 May 2017 at 7:35pm

minor modifications needed. finally found solution myself.
Added new function in controller. and loop used for displaying in template file. this solved my problem.

public function getViewEmails() {
    $hash='';
            $getmem=Member::currentUser();
    if($getmem->RainloopEmail !='' && $getmem->Pass !='')
    {
        $com=$getmem->RainloopEmail.":".$getmem->Pass;
        $encrypted = base64_encode($getmem->RainloopEmail) ;
        $rainloopemail=$encrypted;
        $encrypted =base64_encode($getmem->Pass);
        $pss=$encrypted;

        $hash=base64_encode($com);

    }
    else
    {
        $rainloopemail='';
        $pss='';
        $com=$getmem->RainloopEmail.":".$getmem->Pass;
        $hash=base64_encode($com);

    }
    $url='http://op.mctitsolutions.com/rainloop/rainloop.php?hash='.$hash;
        return new ArrayList(array(
                new ArrayData(array(
                        'Url'=>$url,
                        'Width' => '100%',
                ))
        ));
}

Here is my template file.
<div style="padding:55px 20px">

<% loop ViewEmails %>
<iframe  id="MainPopupIframe"  width="$Width" height="605px" src="$Url">
 </iframe>
   <% end_loop %>
</div>