Embedding Views in PHP snippets with Views 2
Just a quickie - embedding views in PHP snippets etc. Sometimes blocks or panels don't quite cut the mustard and we need to directly insert a view via some PHP.
I started off here - the method I've used before to achieve this. There's another howto on Innovating Tomorrow. However, views_build_view, and indeed theme_view, are both no longer part of Views...
After a bit of searching I found mention of a new function; its also mentioned in the Views 2 documentation (work in progress).
So, the resulting PHP is wonderfully simple:
print views_embed_view($view_name, $display_id = 'default');
I was tearing my beard out, so I hope this helps someone.
articles
latest comments
leafish_paul
leafish_paul
NicolasH (not verified)
Brad Bowman (beeradb) (not verified)
Dale (not verified)
latest tweets
- Nursing a bruised wrist and listening to some random Russian feller's choons: http://www.last.fm/user/liago0sh — 7 weeks 1 hour ago
- Blimey. Take a break for a weekend and a whole bunch of sites get a facelift. — 8 weeks 6 days ago
- thinks every cloud... last minute tickets get for Radiohead at Manchester (http://hellotxt.com/l/T7N1 Gutted Andy... — 14 weeks 21 hours ago
- Loving Unison (http://tinyurl.com/6muvj) — 14 weeks 3 days ago
- Moving large Drupal e-commerce sites with corrupted DB tables = ++unfun. — 15 weeks 2 days ago
some news of interest
recently bookmarked
recent code
news from friends
Amazee - Drupal powered social collaboration. A redesign case study.
Leadel - A Drupal & Flash intensive site
Student Activities Supports 170 Drupal 6 Sites at Texas A&M
Acquia out of beta
When Cold Water Attacks!
October 2 -- Knight Drupal Initiative review meeting
Announcing the new Getting Involved handbook
Davis Applied Technology College Drupal Case Study
Everyone’s an expert

GIMP 2.6 released, one step closer to taking on Photoshop
GeeXboX uShare UPnP A/V Media Server HomePage
Discounts not applied in e-mail templates?
















Post new comment