I'm trying to do something like this for a trending blog post sidebar:

$variables['trending_articles'] = views_embed_view('trending_articles', 'block');

But when I do it renders the entire page with the template associated with the embedded view (whether I call the variable in the template or not).

  • Well... then there is no need to create a variable. OR set the variable as the view name and in template pass that variable as the view name parameter for views_embed_view. – No Sssweat Sep 28 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.