Currently, I handle it by using context
. before calling views_embed_view
, I set a variable in context
and in node.tpl.php
at first result I unset this variable...
is there any better way to handle it?
You could use the Display Suite in combination with Views. This allows you for example to choose a different view mode for each row or alternating view modes or whatever you want.
You shouldn't use node.tpl.php to theme something related to Views.
Instead, use one of the theme template files Views tells you about in 'Theme information' in Views UI.
You should use an "attachment" view. This is an article where the author solved a similar problem to yours.
I think in regular cases the best approach is to create an views block inside the specific view and adjust the delta for the block and the view accordingly (like mentioned in this overlapping thread).
For more specific control you could also use the module Views nodes split as mentioned in another answer.