Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » Creating new entry via frontend doesn´t work

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 966 Views
  • baba-papa
    Avatar
    Community Member
    279 Posts

    Creating new entry via frontend doesn´t work Link to this post

    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.

  • baba-papa
    Avatar
    Community Member
    279 Posts

    Re: Creating new entry via frontend doesn´t work Link to this post

    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.

  • baba-papa
    Avatar
    Community Member
    279 Posts

    Re: Creating new entry via frontend doesn´t work Link to this post

    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.

    966 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.