Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » batch publishing translated pages

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

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

Page: 1
Go to End
Author Topic: 851 Views
  • servalman
    Avatar
    Community Member
    211 Posts

    batch publishing translated pages Link to this post

    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

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: batch publishing translated pages Link to this post

    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!

    851 Views
Page: 1
Go to Top

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

Comments on this website? Please give feedback.