Hi,
I am putting together a site which has a members section,
and I want to be able to include a section in the top of the page with:
Login | "You're Logged in as" | Logout | Change password
much like the top right corner of these forums.
So is there a chunk of code, or recipe, or example
that I can use in a template in order to get this
... or even what variables I might be looking for?
//BWS
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.
- Page 11(current)
- 2
- Next 10 entries
you can use CurrentMember I think. So you can do things like
<% if CurrentMember %>
...
<% end_if %>
and Hello $CurrentMember.FirstName
Explained rather shortly on http://doc.silverstripe.com/doku.php?id=built-in-page-controls&s=currentmember
Mmmm Terse may be a better word.
I take it that documentation is still a nice to have fo rSilverstripe.
Considering this is active in the corner of the CMS, I would have thought this kind of thing would be available.
Is there any plan for a User Manual/User Guide beyond the (frequently) cryptic wiki?
//BWS
hey bruce, we're currently looking for book authors: http://silverstripe.com/help-write-SilverStripe-book/
Everyone would love more documentation. We do try and write as much as we can but the time we can spend on this on top of everything else the guys have going on, somethings always going to give.
We are trying to make an effort in this area and I in particular am very keen to help out as much as possible but we do rely alot on the community to help out with documentation.
If you have suggestions where the documentation is too brief feel free to add it to http://doc.silverstripe.com/doku.php?id=documentation-requests. On that site you can submit ideas and see open requests that you can complete. If you make a request on that page it would be great as then we can see where people are getting lost/confused
Okay,
I've constructed
<% if CurrentMember %>
<p>Logged in as: $CurrentMember.FirstName </p>
<% else %>
<p> Not logged in </p>
<% end_if %>
at the top of the page & it is working fine when the page requires authentication,
but as soon as you move to (say) the home page
which doesn't require authentication, "Not logged in" appears!
Is the a session-based parameter around this?
$CurrentMember seems to be true only if authentication has been invoked?
//BWS
Nooo.
Looks like an ugly caching problem,
Grrrrrrr
//BWS
Try putting HTTP::set_cache_age(0) into your _config.php.
I think we should make that the default for 2.3...
- Page 11(current)
- 2
- Next 10 entries