James Crook, web geek ++

Add a block within a node.tpl.php file - Drupal 7

01 Aug 2011

To insert a block directly within any node.tpl.php file, or indeed within any page.tpl.php file, you can use module_invoke.

To find the right variables to pass go to the block page within Drupal admin and hover over the 'configure' links for each block. The path tells you the module and block id that make up the first and third variables. The second one should always be 'block_view' if you want to view the block (and we do).

Example: inserting a webform block

To insert a webform block directly into a node tpl, first make sure you've enabled a block from the advanced settings on the webform itself.

Then visit 'Structure' > 'Blocks' and look at the configuration link for the webform block in question.

If the configure link is admin/structure/block/manage/webform/client-block-44/configure then the code to place it will be:

$block = module_invoke('webform', 'block_view', 'client-block-44'); print render($block);

Categories: 

Comments

15 Apr 2012

Thanks for sharing...I just used it in one of my tpl files. Placed a menu block into the content area of a certain content type. Worked perfect.

03 Oct 2013

Essential blog post! I truly enjoyed reading it, as well as most of the posts on here. That is a truly good blog, thanks for taking the time to put it together. Thank you! <a href="http://goo.gl/r9iIT7">machine computer</a> <a href="http://goo.gl/M5Q3UD">Jual voltage stabilizer</a> <a href="http://goo.gl/64vQJT">Jasa SEO Murah Bukan Pakar SEO</a> <a href="http://goo.gl/tdh1iT">Jasa SEO dan Pakar SEO</a> <a href="http://goo.gl/nRifKz">Cara Murah</a> <a href="http://goo.gl/creCyl">distributor vinyl beli vinyl importir vinyl</a> <a href="http://goo.gl/BPgErc">Beli Wallpaper Toko Wallpaper</a> <a href="http://goo.gl/UUd49V">kayu lantai parket vinyl lantai</a> <a href="http://goo.gl/ui4h9d">Masakan Khas Indonesia Resep Masakan Resep Makanan Resep Minuman Masakan Ala Indonesia</a> <a href="http://goo.gl/TawMx2">RESEP PUDING BUAH</a> <a href="http://goo.gl/CVCS5X">Resep Dadar Gulung</a> <a href="http://goo.gl/UNlmEE">Resep Sayur Lodeh</a> <a href="http://goo.gl/JmifuW">Resep Tumis</a> <a href="http://goo.gl/t2b3GJ">Resep Telur Dadar</a> <a href="http://goo.gl/w07Lyy">Resep Tempe</a> <a href="http://goo.gl/RLjuwF">RESEP IKAN</a> <a href="http://goo.gl/Em6P3K">RESEP SAMBAL GORENG</a> <a href="http://goo.gl/ciBClC">Resep Kepiting Saus Padang Paling Enak</a> <a href="http://goo.gl/a2AkmL">Resep Sate Kambing Bumbu Kecap</a> <a href="http://goo.gl/8SxKaX">Resep Daging Sapi Lada Hitam Empuk</a> <a href="http://goo.gl/iO4pSI">Resep Sup Daging Lezat Gurih Enak</a> <a href="http://goo.gl/1Hs5HK">Resep Mie Ayam</a> <a href="http://goo.gl/JyqEtq">Tips Selama Kehamilan</a> <a href="http://goo.gl/d7R8qN">Tips Yoga Ibu Hamil</a> <a href="http://goo.gl/NYt0q5">Tips Sehat Hamil</a> <a href="http://goo.gl/6VXrfH">Tanda Kehamilan</a> <a href="http://goo.gl/l497LD">Buku Tips Hamil</a>

09 May 2014

LinkedIn is a career choice and freelance salary
negotiation counter offer jobs offer freelancers with plenty of
opportunities and benefits. Managing the face of the company and talk to him about recruitment.
Get yourself enrolled in all the above areas will definitely help
you get the job you want. If you don't know someone in this town, with tons of conventions, it's all about temp work.
This includes suggesting various certification courses as well
as job seekers looking for companies that wish to hire workers from the city as well as in the UK.

27 Jun 2014

Simply wish to say your article is as surprising.

The clarity in your post is simply excellent and i can assume you are an expert
on this subject. Well with your permission let
me to grab your RSS feed to keep updated with forthcoming post.
Thanks a million and please carry on the enjoyable work.

27 Jun 2014

I was suggested this blog through my cousin. I am now not positive whether this submit is
written by him as nobody else recognise such specified
about my difficulty. You are wonderful! Thanks!

28 Jun 2014

I do not know whether it's just me or if perhaps everybody else experiencing issues with your blog.
It appears like some of the text within your content are running off the
screen. Can someone else please provide feedback and let
me know if this is happening to them as well?
This may be a issue with my web browser because I've had this happen before.
Thank you

06 Jul 2014

Allow our cause. My friend was just informed they have this.
We need to present our assistance!

06 Jul 2014

Thankfulness to my father who stated to
me about this blog, this web site is truly remarkable.

07 Jul 2014

Magnificent items from you, man. I have be aware your stuff previous to and you are just too magnificent.
I really like what you've got right here, certainly like what you're stating and the best way wherein you say it.
You are making it enjoyable and you still care for to keep it sensible.
I can't wait to learn far more from you. This is really a terrific web site.

23 Jul 2014

I am really loving the theme/design of your blog. Do you
ever run into any internet browser compatibility issues?
A few of my blog visitors have complained about my blog not working correctly in Explorer but
looks great in Safari. Do you have any recommendations to help fix this problem?

14 Jul 2014

Whats up this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors or
if you have to manually code with HTML. I'm starting a blog soon but have no coding
experience so I wanted to get advice from someone with
experience. Any help would be enormously appreciated!

15 Jul 2014

Hi there every one, here every one is sharing these familiarity, therefore it's pleasant to read this weblog, and I used to pay
a quick visit this website everyday.

22 Jul 2014

You really make it seem so easy with your presentation but
I find this topic to be really something which I
think I would never understand. It seems too complex and very broad for me.
I'm looking forward for your next post, I will try to get the hang of it!

16 Jul 2014

Every weekend i used to pay a quick visit this site,
because i want enjoyment, since this this website conations really good funny data too.

19 Jul 2014

Furthermߋre, tҺosе who have their mobile phone number may send threatening and
psychologically damaging text messageѕ. Therefore, they conducted a study
comprised of 1,285 studеnts who were under evaluation by the 2012
Youth Risk Behavioг Survey in ʟos Angеles middle schoоls.
federal law also criminalizes eleϲtronic transmissіon օf sexually explicit messageѕ and images betwеen minors and adults, aѕ well as enticing a minor to engage in sex
acts via cߋmputer or text mesѕage (as well as physical mail).

21 Jul 2014

Hey there would you mind stating which blog platform you're working with?

I'm going to start my own blog soon but I'm having a
difficult time selecting between BlogEngine/Wordpress/B2evolution and
Drupal. The reason I ask is because your design seems different then most blogs and
I'm looking for something completely unique. P.S My apologies for being off-topic but I had to ask!

22 Jul 2014

Hello! I'm at work browsing your blog from my new iphone
4! Just wanted to say I love reading through your blog and look forward
to all your posts! Keep up the fantastic work!

23 Jul 2014

Internet these days is a great help in purchasing one
of these. Hybridization can be used to change the outward appearance of a plant or it can change the
inner characteristics of a plant to make them easier to grow or more appealing to consumers.

You may berate yourself because you didn't handle the situations effectively.

24 Jul 2014

Skills:Bluff + 3, Climb + 13, Handle Animal + 4, Jump +
13, Listen + 4, Search + 6, Spot + 4. Let those easy combos fall to the bottom,
and create that waterfall. Martin was a young teenager who tweeted typical things a teenage boy might.

24 Jul 2014

Another is that if I click on it. Three star suggests the stock a conservatgive pen. 8 billion gain from it.
Now let's look at is" AAAA towing,"" focussd on smaller specialized services not especially happily,I think as a motivating source for occasional customers, lenders will want to wake up. In a new one Kav clicks on the debtor's real estate. Careers are alkso considerably more headroom today. For the context of my head from generation athlete prototype getting hurt. Glass containers are located in Canada generation athlete prototype in 2011.

22 Jul 2014

Remarkable things here. I am very satisfied to look your post.
Thank you a lot and I'm taking a look forward to touch you.
Will you please drop me a mail?

23 Jul 2014

Excellent blog you have got here.. It's difficult to find god qualigy wrtiting like youds nowadays.
I seriously appreciate people like you! Take care!!

08 Jul 2014

Hello There. I found your blog using msn. This
is a very well written article. I will be sure to bookmark
it and return to read more of your useful info. Thanks
for the post. I'll definitely comeback.

09 Jul 2014

Hi, I am Mark. Been surfing for almost a 2 days and I
have found a great solution to this article. Really, really thank you so much!

:>

11 Jul 2014

Just want to say your article is as amazing. The clarity
in your post is simply great and i can assume you are an expert on this subject.

Well with your permission let me to grab your RSS feed to keep
up to date with forthcoming post. Thanks a million and please continue
the rewarding work.

11 Jul 2014

Hi, I do think this is an excellent website.
I stumbledupon it ;) I may revisit yet again since I book-marked it.
Money and freedom is the best way to change, may you be rich and continue to help others.

18 Jul 2014

Newbies are those people also forget so make sure there are ways you roger hamilton wealth dynamics can create wonders.

The last two questions will suggest them the ownership
of the puzzle will come your way.

19 Jul 2014

Thank you for the good writeup. It in fact was a
amusement account it. Look advanced to far added agreeable
from you! However, how can we communicate?

21 Jul 2014

Way cool! Some extremely valid points! I appreciate you
writing this post and also the rest of the website is also very good.

21 Jul 2014

Appreciating the time and effort you put intgo your site aand
detailed informaion you present. It's awesome to
come across a bkog every once in a while that isn't the same old rehashed
information. Fantzstic read! I've bookmarked your site and I'm including
your RSS feeds to my Google account.

22 Jul 2014

Iսsed to be able to find ɡood informatіon from
your aгticles.

24 Jul 2014

I am in fact pleased to glance at this website posts which includes lots of
valuable facts, thanks for providing these kinds
of information.

22 Jul 2014

Magnificent beat ! I wish to apprentice at the
same time as you amend your website, how could i subscribe for a weblog site?
The account helped me a acceptable deal. I have been a little bit familiar
of this your broadcast provided bright transparent idea

24 Jul 2014

This design is spectacular! You certainly know how to keep a
reader entertained. Between your wit and your videos,
I was almost moved to start my own blog (well, almost...HaHa!)
Excellent job. I really loved what you had
to say, and more than that, how you presented it. Too cool!

22 Jul 2014

Fastidious replies in return of this difficulty with firm argumemts and explaining everything about that.

21 Jul 2014

If you are going for best contents like me, only pay
a quick visit this website everyday because it gives feature contents,
thanks

23 Jul 2014

While Pongߋ Resume Builder is a paid service, the builder is fгeе to try.
), with that of Graham Faulkner, in Brother Ѕun, Sister Moon; so, also, might it as well have been by way of nothіng more than a mere
toss of the coin, that I've selected Stuart Whitman'ѕ leading
performance, here, over-against the equally superlative one, of Powerѕ Boothe.
But, tҺen, just check it out yourselveѕ, if you don't know it alreadу; for at least the one, Calvary Chapel (the branch I'm rеferring to, here, Ьeing the Downey-Flake, Cа.

19 Jul 2014

I don't even know how I ended up here, but I thought this post was good.
I don't know who you are but definitely you are going to a famous blogger if
you are not already ;) Cheers!

21 Jul 2014

The above mentioned fast weight loss isn't impossible with a
serious jump in the food you've eaten. For too long ago discovered a link between the hands.
Each and the safest diet pills for women every person WILL encounter challenges and tough situations.

She loves to jog and get a hold around it. Did I hear a 'what's that?
But thinking and dreaming about our desired weight is
that there is no" magic" here.

20 Jul 2014

If you don't like assault rifles, put points here instead of Bloody Revival.
*** SPECIAL UNLOCKABLE: This one is hard to do, but if you manage to
play in a multi-player or co-op game with someone that has this unlock OR if you can get in a co-op
with a Gearbox employee, you'll get "And They'll Tell Two Friends".

Just imagine playing Diablo 3, DOTA 2, Starcraft 2, CODIII, Borderlands 2,
etc. The machine’s customizable fanatics work repeatedly plus
noisily in highest possible acceleration. On the minus side, it costs anarchy stacks and requires you to fight in melee.
This skill causes your Sabre Turret to last an additional 2 seconds per rank and to fire an additional shot
per salvo per rank. Some video games have provided improvement in "Cognitive Flexibility", which is the ability to switch quickly from one task to another.
From the limited information offered to date, it seems that a significant time frame has
been spent to rectify the tiny shortfalls that were specific
to Borderlands 2 Key Generator. The forking structure means
you are likely to have points leftover after obtaining the
final skill that you will probably want to spend in a different skill tree.
Guns will also be much better to identify visually so forget about cross hairs over weapon to see if you wish to add it to ones inventory.

12 Jul 2014

Gambooge is highly recommended as a natural fat burner.
Well, a better, happier mood means no emotional eating. Side effects can include
digestive tract discomfort, nausea and headache.

12 Jul 2014

Attractive component of content. I simply stumbled upon your
site and in accession capital to assert that I acquire actually enjoyed account your blog
posts. Any way I will be subscribing on your feeds and even I success you get admission to persistently rapidly.

17 Jul 2014

Very quickly this site will be famous among all blogging viewers, due to
it's pleasant articles

18 Jul 2014

It is appropriate time to make some plans for the future and it's time to be happy.

I've read this post and if I could I desire to suggest you few
interesting things or suggestions. Maybe you can write next articles referring to this article.
I want to read more things about it!

14 Jul 2014

I've been surfing online more than 3 hours today, yet
I never found any interesting article like yours. It's pretty worth enough for me.
In my view, if all website owners and bloggers made good content as you did,
the net will be a lot more useful than ever before.

18 Jul 2014

That what good Internet coaching wealth profile test can do" ethos. In the same thing again.

19 Jul 2014

I'll right away grab your rss as I can't in finding
your e-mail subscription link or newsletter service.
Do you have any? Kindly let me understand in order that I may subscribe.
Thanks.

20 Jul 2014

casino na wirtualne pieniadze

21 Jul 2014

Appreciate the recommendation. Let me try it out.

21 Jul 2014

Hi! Would you mind if I share your blog with my myspace group?

There's a lot of people that I think would really enjoy
your content. Please let me know. Thanks

Pages

Add new comment