1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » [Solved] Template which loads blog entry outside blog module
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 457 Views |
-
[Solved] Template which loads blog entry outside blog module

2 March 2011 at 3:30am Last edited: 2 March 2011 3:32am
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
-
Re: [Solved] Template which loads blog entry outside blog module

3 March 2011 at 11:43pm
create a language file in xoverwrite/lang
and create an empty _config.php file in the dirnl_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';
| 457 Views | ||
|
Page:
1
|
Go to Top |
