Bruce,
Thanks a lot for your repply.
I've tried to implement this, but no luck again, i think i'm still misplacing the code, here i attach the Splash.php file as it looks right now:
Splash.php
<?php
class Splash extends Page
{
static $has_many = array ('Randomizados' => 'Randomizer');
public function getCMSFields()
{
$f = parent::getCMSFields();
$f->addFieldToTab("Root.Content.Randomizados", new DataObjectManager(
$this,
'Randomizados',
'Randomizer',
array('Descripcion' => 'Descripcion', 'Retratista' => 'Retratista'),
new FieldSet(
new HTMLEditorField('Descripcion'),
new ImageField('Retratista')
)
));
//ADDED LINE
return $f;
}
}
class Splash_Controller extends ContentController {
function LatestBlogPosts($num=5) {
$blogs = DataObject::get_one("BlogHolder");
return ($blogs) ? DataObject::get("BlogEntry", "ParentID = $blogs->ID", "Date DESC", "", $num) : false;
}
}
?>
In my template file Splash.ss i have:
......
<% control Menu(1) %>
<div class="columna $URLSegment">
<h1><a href="$Link">$Title.XML</a></h1>
<% if URLSegment=blog %>
<p>Novedades, historias, anécdotas y vivencias sobre las diferentes actividades que realizo. Noticias frescas y posts interesantes para fomentar el contacto con los que disfruten el sitio.</p>
<% if LatestBlogPosts(2) %>
<% control LatestBlogPosts(2) %>
<% include BlogFront %>
<% end_control %>
<% else %>
<h3><% _t('NOENTRIES', 'There are no recent news entries. ') %></h3>
<% end_if %>
<% end_if %>
$Descripcion
<% if Children %>
<ul>
<% control Children %>
<li><a href="$Parent.URLSegment#$URLSegment">$Title</a></li>
<% control Children %>
<% if Destacado %>
<li>$ImagenPhotoSet.SetWidth(150)</li>
<% end_if %>
<% end_control %>
<% end_control %>
</ul>
<% end_if %>
<% if Children %>
<% include Mosaicos %>
<% end_if %>
</div>
<% end_control %>
.......
Always i'm getting the "no entries" message. If i place the code in another place, i don't have any output.
Am i missing something? some <% control %> sentence before pasting the code on the template?
It is right placed the funcion code on the Splash.php file?
Thanks a lot for your support
Regards
Eduardo