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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Blog Module /

Discuss the Blog Module.

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

Creating new entry via frontend doesn´t work


Go to End


3 Posts   1387 Views

Avatar
baba-papa

Community Member, 279 Posts

15 October 2009 at 10:32pm

I installed SS 2.3.3 with blog 0.2.1. Everything works fine except that I can´t write new entries with the blog manager. The form shows up, it can be submitted and the new entry finds it´s way to the database. My problem now: New entries don´t show neather in the frontend nor in the backend.
I appreciate your help.

Avatar
baba-papa

Community Member, 279 Posts

15 October 2009 at 11:26pm

Now I know why they do not show. In my _config.php i set

i18n::enable();
i18n::set_locale('de_DE');
Translatable::set_default_locale("de_DE");

Entries via the frontend get the locale "en_US". Now I need to find out how to change that.

Avatar
baba-papa

Community Member, 279 Posts

16 October 2009 at 8:30am

I added one codeline to the BlogHolder_Controller:

        $form->saveInto($blogentry);
        $blogentry->ParentID = $this->ID;
        $blogentry->Content = $form->datafieldByName('BlogPost')->dataValue();
        $blogentry->Locale = "de_DE"; //Otherwise "en_US" will be set and the entries won´t show if site language isn´t english.
        $blogentry->Status = "Published";
        $blogentry->writeToStage("Stage");
        $blogentry->publish("Stage", "Live");

This is a quiet cheap solution, maybe I´ll finde a better one.