Message of the day:
Release 4.5.0 is out. Changelog: https://docs.silverstripe.org/en/4/changelogs/4.5.0
SilverStripe 4 related information and questions.
While I haven't had to do this myself since SS3, looking at the code, you'd need to write your own
IdentityStore implementation. So have a look at
BasicAuthAuthenticationHandler for how you might achieve this.
Hi folks. What's the best way to login a member manually now that Member->LogIn() is depreciated? I am writing the member through a sign up form and I want to log them in straight after. I could not find good documentation on this. Cheers
I don't understand what you have asked.
I need to migrate the page type history to the newest version. How do I do this?
@Joseph McCleery has joined the channel
Yup. That has been done and I just re did it
Can you post the relevant parts of your config, including the relevant
Page class calls
use for the relevent DataObject subclass, and your
DataObject for sure is extended by
Versioned, then the following should work (This works on my own 4.4 site)
- private static $owns = [
- private static $has_one = [
- 'LogoMobile' => Image::class,
- 'LogoMobileHighResolution' => Image::class
` private static $has_one = [ 'EBook' => EBook::class ];
private static $owns = [ 'EBook' ];
class EBook extends DataObject
` private static $belongs_many = [ 'LandingPages' => LandingPage::class, 'EBookDownloads' => EBookDownload::class ];
private static $extensions = [ Versioned::class, ];
and the page above is
EBook relation to
LandingPage work as you expected? I mean in terms of saving and publishing?
$owns just for now)
Because everything you've posted so far looks OK to me.
if I make a change to ebook and just save and not publish it shows right away on the page
is it the way I call Ebook from the template maybe?
I just go
<% with $EBook %>
is there a recommended way to get either live or stage base on the version the page it at?
No, not really. For a start a "Stage" (aka "Draft" <-- stupid naming) isn't a "Version". A "Version" as SilverStripe knows it, is only something that is, or has been published.
If an object is published, and the user-access is from a non-authenticated session (i.e. a new browser, or an incognito browsing session) then
$Foo as you're doing should just work, and return the currently published version.
Well if the URL has
?stage=Stage the content shows if not it does not
I just unpublished the page and then republished it and the Ebook section now shows on the live version....
I have not chanegd anything but it appears to work as expected now
maybe as I created the page before adding versioning??
Thanks for the help 🙂 At least I did it right, I was starting to think I was loosing my mind 😛
Right. Ensure you have flushed your cache every time you make a change to YML config and to any private (config related) statics
ops. Fixed up the typo
I can see it on the draft version of the page but not live