I'm creating a new template, using PHPTemplate, and I would like to be able to use a different image in the banner depending on what page the user is viewing. I'm doing something similar with quotes, etc. by creating a block and only making it visible when the user is on a given node. I tried to do something similar with a combination of flexiblock and the image module but I couldn't get it to work. The bigggest issue is that the block approach added tags around the img tag (for things like headings) which broke the tags/styles I'm using in my template to style the image display the way I want it.
Here's what I'd like to be able to do, but being a Drupal newbie I don't know if it's the right way, or even possible. I'd like to upload an image, specify which node(s) the image is associated with and then display the appropriate image in my template depending on the node. This is exactly what I'm able to do for quotes, etc. using blocks. How do I do something like this for images?
Comments
I think this should help
Read this article on how to use flexiblock to show ads.
Although it says adsense, you can use the exact same technique for banner.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
That almost does it
I tried that approach and it solved part of the problem. I can get the images on the pages I want them on but there are tags introduced by both the block and the various techniques I've used to inline the images in the block. The block wants to insert a paragraph tag and the Image filter and img_assist modules like to insert anchor tags, etc. At least I think that's what's happening. What I want is a way to just generate an img tag from an image node.
The next thing I want to try is using flexinode to create a custom content type that has a field that specifies the node id of the banner in a custom field. I would then use that in place of the store/page content types that I'm using now for page content. I haven't had time to dig into this idea yet but if anyone has done something like this, feedback would be greatly appreciated.
Solved
I was able to resolve my issues using a combination of flexiblock and img_assist. I simply used img_assist to specify the formating of the img tag, then used img_assist again to inline an image into the flexiblock content field. I used the example from the flexiblock docs to get just the content field into my template.