Posted on: 07/27/06 01:39pm
By: Anonymous (Babooya)
Howdy!
How would I move the random image block from Media Gallery to display in the header area. I want to display a random image everytime a user comes to the site (kinda in the area of the logo). Any help would be appreciated.
Random image from Media gallery to header
Posted on: 07/27/06 01:47pm
By: mevans
Babooya,
Moving the random image block to the header isn't that difficult, if you have a good understanding of html, etc.
You need to call the php function for the random block in header.thtml, insert the following line of code where you want the random block to display:
<?php echo phpblock_mg_randommedia(); ?>
That could replace your logo in your header.thtml as an example.
You will probably want to edit the template that I used for the random block, probably remove the 'Browse Album' that shows underneath the image. That template is
random_block.thtml and it is located in the plugins/mediagallery/templates/ directory.
Let me know if this gets you started.
Thanks!
Mark
Random image from Media gallery to header
Posted on: 07/27/06 02:20pm
By: Anonymous (Babooya)
Thanks for the quick reply...that worked! I just need to adjust the size. Do I hardcode that in the random_block.thtml file or do I change the variable?
Random image from Media gallery to header
Posted on: 07/27/06 04:23pm
By: mevans
Probably the best way to change the size is to change the code. See this
wiki entry[*1] for instructions on how to change the size in the code.
Thanks!
Mark
Random image from Media gallery to header
Posted on: 07/28/06 11:36am
By: Anonymous (Babooya)
Last time...honest
Your advice has been right on. Can I ask how to have it display on the homepage only...Thanks in advance!
Random image from Media gallery to header
Posted on: 07/28/06 11:51am
By: mevans
Babooya,
I'm not sure I can answer your last question, as far as I know, Geeklog calls the same header for all pages, there isn't anything to say use this header for the home page and another for different pages.
I haven't searched the forums to see if there are any discussions about using a custom header per page/area. You might check that. Maybe if this is doable someone who knows a little more about the subject might chime in.
Thanks!
Mark