Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 06:27:48 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155556 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Placement of Random Image  (Read 877 times)
Chrissy

Offline Offline

Posts: 13


« on: January 30, 2008, 12:56:33 AM »

Hello,

I have installed the Random Image module and have it working great by inserting RandomImage('/media/pics'); into a code section BUT I actually would like it to appear on the right side of my content area where I have a table set up. I only need this on one page so thats why im using a table to create 2 columns with text on the left and the Random Image on the right. Any ideas on what to do about getting it to show up there huh

Thank you!
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6977


WWW
« Reply #1 on: January 30, 2008, 08:45:21 PM »

by moving the module call into the template instead of the code section.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

marathoner

Offline Offline

Posts: 495


« Reply #2 on: February 08, 2008, 04:18:16 AM »

Chrissy-

You could move it into a template but there's no reason that you can't do this for a given page. What exactly are you doing? Have you looked at the HTML created by your page? If the generated IMG tag is in the second TD of the TABLE it should display correctly. Also, you might simply want to right align the image instead of bothering with a TABLE.

I haven't tried it...but the following code section should work:
Code:
$table = "<table>\n";
$table .= "<tr>\n";
$table .= "<td>\n";
$table .= "This is the first column. The random image should be to the right of this text in a separate column.\n";
$table .= "</td>\n";
$table .= "<td>\n";
$table .= RandomImage('/media/pics');
$table .= "</td>\n";
$table .= "</tr>\n";
$table .= "</table>\n";
echo $table;
Logged
marathoner

Offline Offline

Posts: 495


« Reply #3 on: February 09, 2008, 03:29:57 AM »

Oops...I tested my posting above...doesn't work...but this does:
Code:
echo "<table>\n";
echo "<tr>\n";
echo "<td>\n";
echo "This is the first column. The random image should be to the right of this text in a separate column.\n";
echo "</td>\n";
echo "<td>\n";
RandomImage('/media/gallery/2007/thumbs');
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";

Logged
sparkdigital

Offline Offline

Posts: 348



WWW
« Reply #4 on: February 20, 2008, 08:13:21 AM »

Hi,

I've done something similar to what you're asking:
> add a content block to your template page
> go to 'manage sections' of the page where you would like the random image to appear
> add a 'code' block to that page
> in 'modify page' simply paste the random image code <?php RandomImage(MEDIA_DIRECTORY .'/random');>
> save the page.

This way there's no need for extra templates that need updating when you make any changes etc.

Hope this helps!

Konrad
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!