How do I put a stencil-like texture across a sectioned object? I have a rough wood board crate I want to apply (UV map) a stencil on, but only on one side of the face AND I want it to disappear in between the boards --just like the attached example image (created in Photoshop). Any suggestions?



UPDATE: Secondary Problem in attempting the 2nd answer below: Following the answer below I could duplicate the nodes as outlined to get the decal on the bars however it still wraps around the edge of the bars and does not show just on the one side as I want it too. What am I doing wrong? (Please note: there is a follow up to this in the 2nd answer below) As you can see I applied the answer / solution  on test bars until I can figure out how to move that to the main wood shelf object's middle section. 



UPDATE 2: For a 3rd very good answer please refer to this link https://blender.stackexchange.com/a/45708/1853
This can be done quite easily actually in the Cycles render engine with an empty and by using Object texture coordinates.

First create an empty and position it where you would like the decal to be placed on your object.



Now setup the following material nodes for the bars.



Make sure Min and Max are checked on the Mapping node, this clamps the edges of the texture so that it doesn't repeat infinitely.

Instead of the two diffuse shaders you can use whatever materials you would like for the plain bars and the stenciled text.  The bottom diffuse shader is for the text, the top diffuse shader is for the bars.

This leaves one problem however: since the texture is infinitely thick along the Z-axis the texture will be stretched across the inside edges of the bars undesirably.  To fix this amend the above node setup with some math nodes as follows.



The added nodes use a Less Than Math node to to test if the absolute value of the Z component of the mapping coordinates is within a certain range (in this case I am using threshold of 0.03).  The multiply node works like a logical AND between this test and the alpha channel of the decal texture.