christopherbolt/silverstripe-publishwithme

Items dont publish with page

adrian-stein opened this issue · 1 comments

I am using SS3 and have done exactly what you said in mark up, but the items dont publish. Is there something else I need to do?

I have multiple 'MainBanner' objects on a 'Page' type'. as below

private static $has_many = array(
    'MainBanners' => 'MainBanner',
);

private static $publish_with_me = array(
    'MainBanner',
);

Do I use MainBanner or MainBanners in the above array? I have tried both and it does work. It is like the module longer works? What am I missing?

You should use 'MainBanners' in the array.
Just want to check the basic stuff first please:

For SS3 confirm you have installed the 1.0 branch.

Make sure that your 'Page' model has the 'PublishWithMe' extension, add the following to your Page.php file:

private static $extensions = array(
"PublishWithMe"
);

Also make sure that your 'MainBanner' model has the Versioned extension, add the following to your MainBanner.php file:

private static $extensions = array(
"Versioned('Stage', 'Live')",
);

After adding the extensions or changing the $publish_with_me run /dev/build