great! That was the Problem! Now it works well!

Another question to the context I can set argument in $theme->content():
I think i can use any string for the context, because the context only applies 
to $theme->content(). (Correct me if I'm wrong!) This also shouldn't be 
conflict with templates that normally will be used to display for multiple 
posts:

The normal templates for multiple post have the following names: multiple.php 
or entry.multiple.php and so on.
The context based templates uses the fallback that you described:

> multiple.entry.php <-- context appended to content type
> multiple.post.php <-- context appended to class of variable
> entry.php <-- from the content type of the post
> post.php <-- from the class of the variable storing the post
> multiple.php <-- just the context


May be that it comes to confusion if 'multiple' or 'single' is used as context, 
but it should lead to conflicts if I'm right.
Otherwise the description in the 
wiki(http://wiki.habariproject.org/en/Creating_a_Custom_Theme#Content_Types) is 
not correct.

Thanks for your great help!

Regards, Thomas

Am 18.09.2010 um 15:47 schrieb Owen Winkler:

> On 9/17/2010 1:16 PM, Thomas Schrader wrote:
>> Ok, I understand now a little bit better how this works. I removed the 
>> context so i simply call $theme->content($post); in the foreach loop. But 
>> this doesn't solve the problem, it still display the same post five times. 
>> Is it possible that there is an issue with reassigning the post in the 
>> $theme->content() method? var_dump($posts) shows, that $posts contains the 5 
>> Posts that should be displayed. The output directly in the foreach loop also 
>> works pretty fine, but if I use $theme->content() it doesn't work.
>> 
>> I attached the output of vardump.
>> 
> 
> Ok, I have a new thought on the problem:
> What does your entry.php template look like?
> 
> When you use $theme->content() the thing that is passed to render becomes 
> $content in the output template.
> 
> So if you call:
> 
> $theme->content($post);
> 
> Then in your entry.php template, to output the title, you need:
> 
> <?php echo $content->title_out; ?>
> 
> There's no (easy) way for the theme system to know the name of the variable 
> you passed to ->content() and so it puts that value into $content when it 
> calls the template.
> 
> If you change $post to $content in your entry.php, I think that could correct 
> your issue.
> 
> Owen
> 
> -- 
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to 
> [email protected]
> For more options, visit this group at 
> http://groups.google.com/group/habari-users

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/habari-users

Reply via email to