Placing the menu in an <ul> Placing the menu in an <ul>
 

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

Placing the menu in an <ul>

Started by CaptainB, January 02, 2008, 07:57:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CaptainB

Hi!

I have run into troubles while costomizing my theme (a modified version of the default hardwired theme).
If you look at this code, you can see that I've removed the button-images, and just put the links for "Albums", "Login" etc in an unordered list (Ignore the "striked through bold text for now) :

// HTML template for sys menu
$template_sys_menu = <<<EOT

                      [s][b]<ul class="gallery_menu">[/b][/s]
             
<!-- BEGIN home -->
<li><a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a></li>
<!-- END home -->
<!-- BEGIN my_gallery -->
                                        <li><a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a></li>
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                                        <li><a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a></li>
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                                        <li><a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a></li>
<!-- END my_profile -->
<!-- BEGIN faq -->
                                        <li><a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a></li>
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
                                        <li><a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a></li>
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
                                        <li><a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a></li>
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                                        <li><a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a></li>
<!-- END upload_pic -->
<!-- BEGIN register -->
                                        <li><a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a></li>
<!-- END register -->
<!-- BEGIN login -->
                                        <li><a href="{LOGIN_TGT}" title="{LOGIN_LNK}">{LOGIN_LNK}</a></li>
<!-- END login -->
<!-- BEGIN logout -->
                                        <li><a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}">{LOGOUT_LNK}</a></li>
<!-- END logout -->
[s][b]</ul>[/b][/s]

EOT;

// HTML template for sub menu
$template_sub_menu = <<<EOT
[b]<ul class="gallery_menu">[/b]
                       
<!-- BEGIN custom_link -->
                                        <li><a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a></li>
<!-- END custom_link -->
<!-- BEGIN album_list -->
                                        <li><a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a></li>
<!-- END album_list -->
                                        <li><a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a></li>
                                       
                                        <li><a href="{LASTCOM_TGT}" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a></li>
                                       
                                        <li><a href="{TOPN_TGT}" title="{TOPN_LNK}">{TOPN_LNK}</a></li>
                                       
                                        <li><a href="{FAV_TGT}" title="{FAV_LNK}">{FAV_LNK}</a></li>
                                       
                                        <li><a href="{SEARCH_TGT}" title="{SEARCH_LNK}">{SEARCH_LNK}</a></li>
                                       
[b]</ul>[/b]

EOT;


That works as intended and puts the links in an unordered list. However, if I want to put the sys_menu items in an unordered list too (the bold striked through code), it messes it all up, and suddenly nothing is ordered as a list no more.

Here's my page: http://www.behrentzs.com/gallery/ (with the first menu items lined up as they should, while the rest arn't).
Does anybody knows why that happens and how to correct it?

CaptainB

Ìt seems like the bold and strike-though dosn't work when some text is included in code, so here's the template attachted along with the modified theme.php:

Joachim Müller

You failed to add the starting/ending <ul>-tags properly. This is how your theme.php should look like:<?php

// HTML template for sys menu

$template_sys_menu = <<<EOT

 /*The UL works, for the sub_menu, if I do not put the underneath in an UL tag. If I do, none of em' will work*/

<ul class="gallery_menu">                      

              

<!-- BEGIN home -->

<li><a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a></li>

<!-- END home -->

<!-- BEGIN my_gallery -->

                                        <li><a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a></li>

<!-- END my_gallery -->

<!-- BEGIN allow_memberlist -->

                                        <li><a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a></li>

<!-- END allow_memberlist -->

<!-- BEGIN my_profile -->

                                        <li><a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a></li>

<!-- END my_profile -->

<!-- BEGIN faq -->

                                        <li><a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a></li>

<!-- END faq -->

<!-- BEGIN enter_admin_mode -->

                                        <li><a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a></li>

<!-- END enter_admin_mode -->

<!-- BEGIN leave_admin_mode -->

                                        <li><a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a></li>

<!-- END leave_admin_mode -->

<!-- BEGIN upload_pic -->

                                        <li><a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a></li>

<!-- END upload_pic -->

<!-- BEGIN register -->

                                        <li><a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a></li>

<!-- END register -->

<!-- BEGIN login -->

                                        <li><a href="{LOGIN_TGT}" title="{LOGIN_LNK}">{LOGIN_LNK}</a></li>

<!-- END login -->

<!-- BEGIN logout -->

                                        <li><a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}">{LOGOUT_LNK}</a></li>

<!-- END logout -->
</ul>





EOT;



// HTML template for sub menu

$template_sub_menu = <<<EOT

<ul class="gallery_menu">

                        

<!-- BEGIN custom_link -->

                                        <li><a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a></li>

<!-- END custom_link -->

<!-- BEGIN album_list -->

                                        <li><a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a></li>

<!-- END album_list -->

                                        <li><a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a></li>

                                        

                                        <li><a href="{LASTCOM_TGT}" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a></li>

                                        

                                        <li><a href="{TOPN_TGT}" title="{TOPN_LNK}">{TOPN_LNK}</a></li>

                                        

                                        <li><a href="{FAV_TGT}" title="{FAV_LNK}">{FAV_LNK}</a></li>

                                        

                                        <li><a href="{SEARCH_TGT}" title="{SEARCH_LNK}">{SEARCH_LNK}</a></li>

                                        

</ul>



EOT;



// HTML template for gallery admin menu

$template_gallery_admin_menu = <<<EOT



                <div align="center">

                <table cellpadding="0" cellspacing="1">

                        <tr>

<!-- BEGIN admin_approval -->

                                <td class="admin_menu" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></td>

<!-- END admin_approval -->

                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>

                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>

                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>

                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>

                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>

                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>

                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>

                                </tr><tr>

<!-- BEGIN log_ecards -->

                                <td class="admin_menu"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></td>

<!-- END log_ecards -->

                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>

                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>

                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>

                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>

<!-- BEGIN documentation -->

                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>

<!-- END documentation -->

                        </tr>

                </table>

                </div>

EOT;



// Function for writing a pageheader

function pageheader($section$meta '')

{

    global 
$CONFIG$THEME_DIR;

    global 
$template_header$lang_charset$lang_text_dir;



    
$custom_header cpg_get_custom_include($CONFIG['custom_header_path']);



        
$charset = ($CONFIG['charset'] == 'language file') ? $lang_charset $CONFIG['charset'];



    
header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');

        
header("Content-Type: text/html; charset=$charset");

    
user_save_profile();



    
$template_vars = array('{LANG_DIR}' => $lang_text_dir,

        
'{TITLE}' => $CONFIG['gallery_name'] . ' - ' strip_tags(bb_decode($section)),

        
'{CHARSET}' => $charset,

        
'{META}' => $meta,

        
'{GAL_NAME}' => $CONFIG['gallery_name'],

        
'{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],

'{ADMIN_MENU}' => theme_admin_mode_menu(),

        );



    echo 
template_eval($template_header$template_vars);

}



// Function for writing a pagefooter

function pagefooter()

{

    
//global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;

    
global $USER$USER_DATA$ALBUM_SET$CONFIG$time_start$query_stats$queries;;

    global 
$template_footer;



    
$custom_footer cpg_get_custom_include($CONFIG['custom_footer_path']);



    if (
$CONFIG['debug_mode']==|| ($CONFIG['debug_mode']==&& GALLERY_ADMIN_MODE)) {

    
cpg_debug_output();

    }



    
$template_vars = array(

        
'{SYS_MENU}' => theme_main_menu('sys_menu'),

        
'{SUB_MENU}' => theme_main_menu('sub_menu'),

        

        
'{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL') && $CONFIG['vanity_block']) ? theme_vanity() : '',

    );



    echo 
template_eval($template_footer$template_vars);

}



?>



CaptainB

I tried to copy what you posted up, but now none of the lists work.. see here:
http://www.behrentzs.com/gallery/

Joachim Müller

Well, I thought that you wanted to display the list items next to each other, as you deliberately appeared to have edited your stylesheet accordingly. Edit http://www.behrentzs.com/gallery/themes/behrentzs/style.css, find.gallery_menu { list-style:none;
}

.gallery_menu li {float:left;
display:inline;
}
and edit accordingly. If you want an actual vertical list with bullets, then just empty that section, as you override the default behaviour with your custom stylesheet.

CaptainB