Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

1596 Posts in 399 Topics by 403 members

Template Questions

SilverStripe Forums » Template Questions » access user parameter

Page: 1
Go to End
Author Topic: access user parameter 270 Views
  • hiks
    avatar
    Community Member
    7 posts

    access user parameter Link to this post

    Hi again,

    I added this to my page.php

       function MyLang() {

          return Translatable::current_lang();
       }

    and now I can use <% MyLang or $MyLang in my templates. Don't ask why, I need it in my templates^^
    But now, there's a new problem:

    <% control LatestPost(2) %><% MyLang ...

    MyLang isn't working anymore, I think cause of the <% control %>. But why? MyLang is in Page_Controller in page.php, the template and the control both inherits from Page_Controller (xxx extends Page_Controller). Why is MyLang not available? There's no error, it just seems to be empty, also

    return "en" . Translatable::current_lang();

    won't return "en".

    Other possibility, can I use hierarchies in <% %>? Something like

    <% Level(1).MyLang %> // <<<<< this will throw an error

    I've given up now, don't have any idea... Also _t(...) doesn't work, it always retruns default string.

    270 Views
Page: 1
Go to Top

Currently Online: Punch Rockgroin

Welcome to our latest member: Bud

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

Comments on this website? Please give feedback.