Image Block Embedding $bodyhtml?
Rathlar
Joined: 2006-12-11
Posts: 1 |
Posted: Mon, 2006-12-11 23:25 |
I've been searching for a while now and I'm just wondering if the below is possible and where the html for it is stored. What I'm trying to do is show 10 random images on my home page which isn't very hard but what I would like to do is make 2 rows of 5 images instead of how it makes each one below the other like this... (image 01) (image 02) (image 03) (image 04) (image 05) (image 06) (image 07) (image 08) (image 09) (image 10) I used the code from the address below. After some thinking i realized the "print $bodyHtml;" line and I'm wondering where the html is stored that causes it to add a <p> tag or something similar when you use the (|)pipe to seperate blocks. Hopefully there is something I can remove or alter so that I may achieve my goal. Any help would be greatly appreciated. EDIT: I figured it out... I thought it might be a good idea to explain as I've seen more than a few people ask about how to make it horizonal. Modified the Imageblock.tpl and saved it using the instructions it listed... here is what I did(which was fairly simple) <table border=0><tr> {foreach from=$ImageBlockData.blocks item=block} <td> Note the addition of a table at the begining of the code. {/if} </td> {$blockcounter++} {if $blockcounter == 5} </tr><tr> {/if} {/foreach} </tr></table> Here you can see how I made it work with multiple rows... the if statement for $blockcounter determines how many images you want per row and creates the new row per however many you set. There is 1 draw back to this... without further modification, it seems to print $blockcounter each time(which baffles me). I rectified this by finding the Smarty compiled code for the imageblock and removed the echo statement... this solved the problem and I now have it exactly the way I want... Some modification to cellspacing and cellpadding might be in order to get the spacing you need. I hope this helps any other people who are having this problem. |
|