Jump to:

1851 Posts in 1606 Topics by 561 members

Blog Module

SilverStripe Forums » Blog Module » [Solved] Template which loads blog entry outside blog module

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 615 Views
  • borriej
    Avatar
    Community Member
    267 Posts

    [Solved] Template which loads blog entry outside blog module Link to this post

    Hello,

    I got the blog module installed.
    Now in my pagetree i also have this page 'viewall', this template gets all blogentry's and renders them underneath eachother with the complete story expanded. So visitors who want to view all blog entry's underneath eachother can read it like this.

    This works great.

    <?php
    class ViewAllBlogs extends Page {
       static $db = array(
       );
       
       static $has_one = array(
       );
       static $allowed_children = array();
       
    }

    class ViewAllBlogs_Controller extends Page_Controller {
       
       function ViewAll($num=9999) {
          $news = DataObject::get_one("BlogHolder");
          return ($news) ? DataObject::get("BlogEntry", "ParentID = $news->ID", "Date DESC", "", $num) : false;
       }

       
    }
    ?>

    Now.. my language is set to Dutch in the config.

    // Set the site locale
    i18n::set_locale('nl_NL');

    This works great for the blog, but on the view-all page all the blog sentences (like posted on..) are in English again. On the blog section of my site they do appear in Dutch.

    How do i fix this?

    template

       <% _t('POSTEDBY', 'Posted by') %> $Author.XML <% _t('POSTEDON', 'op') %> $Date.Long

  • borriej
    Avatar
    Community Member
    267 Posts

    Re: [Solved] Template which loads blog entry outside blog module Link to this post

    create a language file in xoverwrite/lang
    and create an empty _config.php file in the dir

    nl_NL.php

    <?php

    global $lang;

    //LOGIN
    $lang['nl_NL']['Member']['REMEMBERME'] = 'Wachtwoord onthouden?';
    $lang['nl_NL']['Member']['BUTTONLOGINOTHER'] = 'Log-uit';

    //BLOGS
    $lang['nl_NL']['BlogEntry.ss']['POSTEDBY'] = 'Geplaatst door';
    $lang['nl_NL']['BlogEntry.ss']['POSTEDON'] = 'op';
    $lang['nl_NL']['ViewAllBlogs.ss']['POSTEDBY'] = 'Geplaatst door';
    $lang['nl_NL']['ViewAllBlogs.ss']['POSTEDON'] = 'op';
    $lang['nl_NL']['BlogHolder.ss']['VIEWINGTAGGED'] = 'Bekijk berichten getagd met';
    $lang['nl_NL']['BlogHolder.ss']['VIEWINGPOSTEDIN'] = 'Bekijk berichten geplaatst op';

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