1

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?

4 Answers 4

7

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.

2
  • for each row? so can I render first row as full and other rows as teaser? Commented Mar 1, 2012 at 11:46
  • 1
    Yes, for each row.
    – Lance
    Commented Mar 1, 2012 at 11:57
0

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.

0

You should use an "attachment" view. This is an article where the author solved a similar problem to yours.

3
  • what is attachment views? I solved this by using context module. but I think its dirty way, please explain more Commented Apr 7, 2012 at 7:45
  • I've updated my answer with a link to more information.
    – Aidan
    Commented Apr 7, 2012 at 20:01
  • Could you include a summary of what reported in the linked article?
    – avpaderno
    Commented Apr 7, 2012 at 21:19
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.