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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

batch publishing translated pages


Go to End


2 Posts   1264 Views

Avatar
servalman

Community Member, 211 Posts

28 September 2010 at 2:46am

Hello

I'v been trying to find a solution in the forums to my problem but I coud not.

So here is my question :

When you try to batch publish pages in a translated language, you get an error this a major prob to me because I have 5 languages to deal with.

Is there a solution if so please point it to me

Thanks

T

Avatar
swaiba

Forum Moderator, 1899 Posts

28 September 2010 at 3:59am

Hey T,

Assuming you can trigger the script it is easy to put a page to live within PHP... So as long as you can get the pages easily...

$dosPage = DataObject::get('Page',<SOME WHERE CLAUSE HERE>);
foreach($dosPage as $doPage)
{
	$doPage->writeToStage('Stage');
	$doPage->publish("Stage", "Live");
}

I'd imagine the where clause would be something like "Locale != '<ORIGINAL LOCALE>'"

Hope this helps!