Imageblock modification

stdio

Joined: 2004-09-14
Posts: 30
Posted: Mon, 2008-04-21 06:14

Hi,

I would like to modify the Imageblock a bit. I have activated the Random Images feature and I would like to link to the main album instead of the picture. For example, instead of www.domain.com/album_name/picture.jpg I would like to link to www.domain.com/album_name/. How can I do this? I searched but no luck. Help please?

Thank you.

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 9507
Posted: Mon, 2008-04-21 13:20

I think the imageblock has a target= switch
might not be via the UI.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
stdio

Joined: 2004-09-14
Posts: 30
Posted: Tue, 2008-04-22 01:47

Hi Dave,

Thank you for your answer but I think I don't quite understand. I am not sure if you understand what I want to do. I created a screenshot so you can see.

I would like to link to the main album instead of the photo. So in this case instead of http://www.celebritywallpapers.us/v/Celebrities-D-E/Elizabeth_Hurley/Elizabeth_Hurley_116.jpg.html I would like to link to http://www.celebritywallpapers.us/v/Celebrities-D-E/Elizabeth_Hurley/. And so on for all images in the image block. Can this be done? I am sorry for my poor english. Hope you understand what I want to do.

Thank you!

AttachmentSize
x.JPG57.95 KB
Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 9507
Posted: Tue, 2008-04-22 02:08

I understand. You can achieve this with the external image block
http://codex.gallery2.org/Gallery2:Modules:imageblock#External_Options

http:// EXAMPLE.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title&g2_link=http://test.com

You might be able to do this by adding the blocks manually to the template.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
stdio

Joined: 2004-09-14
Posts: 30
Posted: Mon, 2008-04-28 08:21

Dave, sorry to bother again. I really need this and I just can't figure out how to do this. Can you please explain? I would really appreciate it.

Thank you!

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 9507
Posted: Mon, 2008-04-28 23:04

Can you get the external imageblock to work?
The external imageblock admin page has directions for adding a imageblock to a page. Site admin-> Image Block.
There it will show you how to add a bock to a external page or template.
You will not be able to go to the album from the item. You will be able to go to any url you like from the item.

Once you get the imageblock to work you will be able to add the g2_link parameter.
If you cant get the external imageblock to work:
http://codex.gallery2.org/Gallery2:How_To_Use_The_External_Image_Block_When_url_fopen_Is_Disabled

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
stdio

Joined: 2004-09-14
Posts: 30
Posted: Wed, 2008-05-07 14:08

Dave, I assume the external imageblock works, but not sure how to test it. What do I need to change in AlbumBlock.tpl? I am experienced with linux/system administrator but my coding language is very poor. Would you care to show me how to do all this?

Thank you!

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 9507
Posted: Wed, 2008-05-07 20:48
Quote:
but not sure how to test it.

just browse to the url
or create a test page with this as the contents:
<?php @readfile('http://EXAMPLE.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title'); ?>

Then you can add it to the template file like:

{php}
@readfile('http://EXAMPLE.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_show=title');
{/php}

or read up on how to add blocks to templates:
http://codex.gallery2.org/Gallery2:Themes:Reference:Blocks but that requires some knowlage of templates: http://codex.gallery2.org/Gallery2:Themes:Anatomy_of_a_Theme

or
the easy way: http://codex.gallery2.org/Gallery2:How_To_Setup_Image_Blocks

_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
stdio

Joined: 2004-09-14
Posts: 30
Posted: Thu, 2008-05-08 02:15

Hi Dave!

I just tested. I created a test.php file and it works! I got random images when refreshing this page. How sweet :) Now, could you assist me once more please? Instead of linking to www.domain.com/AlbumName/image.jpg.html in the ImageBlock, how can I link to www.domain.com/AlbumName/? Honestly, I read your posts xx times, but I just can't understand. I ask for your help once more.

Thank you!!

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 9507
Posted: Thu, 2008-05-08 02:40

just add
&g2_link=www.domain.com/AlbumName
to the url

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
stdio

Joined: 2004-09-14
Posts: 30
Posted: Thu, 2008-05-08 03:15

That would not work Dave. I have 3 random items that appear in the Random ImageBlock. I would need each one to link to their AlbumName. For example I have these album names:

Britney_Spears
Cameron_Diaz
Elisha_Cuthbert

and random images show up in the imageblock. This is how is supposed to look in the end:

(currently): www.domain.com/Britney_Spears/image1.jpg.html (should be): www.domain.com/Britney_Spears/
(currently): www.domain.com/Cameron_Diaz/image1.jpg.html (should be): www.domain.com/Cameron_Diaz/
(currently): www.domain.com/Elisha_Cuthbert/image1.jpg.html (should be): www.domain.com/Elisha_Cuthbert/

So no matter what images come up in the random imageblock they should link to their respective album names. Do you understand what I'm trying to say? :/ I am trying really hard to explain. Hope you understand and this can be done.

Again, thank you for being so kind.

Best Regards.

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 9507
Posted: Thu, 2008-05-08 03:23

I understand. It can't be done, unless you have intimate knowledge of the imageblock module.

The minislideshow might have a parameter that might do what you want:
http://www.flashyourweb.com/staticpages/index.php?page=mini_2.0.5

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 9507
Posted: Mon, 2008-05-12 23:48
Login or register to post comments