[Solved]: Adding photo links to the top of my gallery [Solved]: Adding photo links to the top of my gallery
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: Adding photo links to the top of my gallery

Started by disposition, April 02, 2008, 05:52:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

disposition

Hi,

If you look at my gallery you will see the links "FORUM, CHAT, NEWSBLOG, CONTEST.  I want to change these into photo images but I am not sure how to do this.  I hope you can help.

I attached my theme just in case you need it.
The folder in the zip called "logopics" these are the photos that I want in replace of the links.

www.blackdeathmetal.com


steveeh131047

Not sure if this is a good way, or the best way, but it worked when I just tried it on my development site.

I like to edit "gallery/themes/yourtheme/theme.php" so that the menu items added by the addbutton function are "hard coded", rather than picking up the {tokens}. I just tried swapping one of my menu names in theme.php with <img src="thumbnail.jpg"> and it worked fine; the menu name was replaced by the image and it still linked OK.

disposition

Thanks for the reply, I guess I just don't get what I am supposed to change in the theme.  You are obviously a bit more rehearsed than me. :)


disposition

O.K. I got the logos on now I just have to make them look correct.  Thanks for your help.

steveeh131047

I'm also relatively new to cpg - I'm sure if the following is not right one of the Dev Team will correct me  :)

In your theme.php file you should be able to find something like this:

  // HTML template for template sys_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
    addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);


with probably a lot more addbutton function calls to add all the required menu items. The "tokens" between the "curly brackets" get filled in when the page is dynamically generated by the cpg core PHP stuff. The tokens are typically filled in from information you have entered in the Config section.

But you can (and I do) replace the token placeholders with your own "hard coded" material; I find it a bit easier when I'm developing to edit theme.php than work through the Config section. So, for example, the above addbutton call could be replaced with:
    addbutton($sys_menu_buttons,'Home','Go to the home page','/','home',$template_sys_menu_spacer);

Then if you want to replace the menu word 'Home' with an image, it becomes:

    addbutton($sys_menu_buttons,'<img src="themes/mytheme/images/image.jpg">','Go to the home page','/','home',$template_sys_menu_spacer);

Hope that helps, and that I'm not too far off the mark!


disposition

Thanks for updating I used the original way and it seems to work perfect, I don't seem to have any issues with it at all.  Thanks for taking your time and helping me.

www.blackdeathmetal.com