Customize sys menu buttons Customize sys menu buttons
 

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

Customize sys menu buttons

Started by marek!, February 09, 2011, 11:49:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

marek!

Hi, I've read the whole coppermine manual again and again, can't find how to apply attributes to each sys_menu or sub_menu buttons separately. My coppermine site (water drop theme) http://dualcab.net/gallery is bridged with phpbb3 forum (x-vision theme) http://dualcab.net
Phpbb3 theme applies attributes to each button separately –menu buttons have different background images. In coppermine I've managed to place {sys_menu} and {sub_menu} tokens in appropriate positions but after applying classes to the whole (sys_menu} token it doesn't work properly – with the mouse over, all buttons change backgrounds image. I've put the whole menu code from sample theme into my theme.php, but unlike admin menu, which is more like table layout, sys_menu and su_menu are in php coding only. I don't know much about php so how can I apply different attribute (different class from my style.css) to each menu button separately. 
Also, in which class in css styles can I change font size and color in menu buttons?
Thank you for the any help.

Αndré

Please read that thread for a start: http://forum.coppermine-gallery.net/index.php/topic,68315.0.html

Please attach your whole theme as zip file if you need further help.

marek!

Thank you Andre. Please find  attached the Zip copy of my theme. I would like to mention I did read before the thread you referred to me and I DO have the "function addbutton" in my theme.php
As I said before I don't quite understand php coding. At the bottom of my css file I put classes from phpbb3 theme which define each menu button separately, i.e. Left Button, Right Button and Middle Button. They've got different background images. Now, if 'sys_menu' or 'submenu' were in table layout, I know how to apply classes to <td>, <div>, etc... but I have no idea how to apply styles to this for example:

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

My apologies for the trouble but I would really like to have the same buttons as in phpbb3 theme.

Αndré

Please open the theme.php file and have a look at the following part:
    addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{ALB_LIST_LNK}','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer,'rel="nofollow"');
    addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer,'rel="nofollow"');
    addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn',$template_sub_menu_spacer,'rel="nofollow"');
    addbutton($sub_menu_buttons,'{TOPRATED_LNK}','{TOPRATED_TITLE}','{TOPRATED_TGT}','toprated',$template_sub_menu_spacer,'rel="nofollow"');
    addbutton($sub_menu_buttons,'{FAV_LNK}','{FAV_TITLE}','{FAV_TGT}','favpics',$template_sub_menu_spacer,'rel="nofollow"');
    if ($CONFIG['browse_by_date'] != 0) {
        addbutton($sub_menu_buttons, '{BROWSEBYDATE_LNK}', '{BROWSEBYDATE_TITLE}', '{BROWSEBYDATE_TGT}', 'browse_by_date', $template_sub_menu_spacer, 'rel="nofollow" class="greybox"');
    }
    addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search','');


As you can see, some of the buttons have a 7th parameter
,'rel="nofollow"'

That's the place where you can add your additional css classes. E.g. change the mentioned code to
    addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_custom_link"');
    addbutton($sub_menu_buttons,'{ALB_LIST_LNK}','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_album_list"');
    addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_lastup"');
    addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_lastcom"');
    addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_topn"');
    addbutton($sub_menu_buttons,'{TOPRATED_LNK}','{TOPRATED_TITLE}','{TOPRATED_TGT}','toprated',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_toprated"');
    addbutton($sub_menu_buttons,'{FAV_LNK}','{FAV_TITLE}','{FAV_TGT}','favpics',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_favpics"');
    if ($CONFIG['browse_by_date'] != 0) {
        addbutton($sub_menu_buttons, '{BROWSEBYDATE_LNK}', '{BROWSEBYDATE_TITLE}', '{BROWSEBYDATE_TGT}', 'browse_by_date', $template_sub_menu_spacer, 'rel="nofollow" class="greybox"');
    }
    addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search','','rel="nofollow" class="my_theme_btn_search"');

and use that classes in your css file.

marek!

Thank you soooo much!!! Andre. That's what I was after!!!