help setting accesskeys

This is a discussion on "help setting accesskeys" within the PHP Forum section. This forum, and the thread "help setting accesskeys are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Jan 8th, 2008, 11:41
minute44's Avatar
Most Reputable Member

SuperMember
Join Date: Apr 2006
Location: Nottingham UK
Age: 25
Posts: 1,351
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
help setting accesskeys

I want to set accesskeys for my main navigation. I can do it if I substitute the PHP it has that builds the list of pages with static HTML but if I do that I lose the current page link state.

At the moment the Nav is like this:

PHP: Select all

<ul>
<?php if (is_home()) { ?>
<li class="current_page_item"><a href="<?php bloginfo('home'); ?>">Home</a></li>
<?php } else { ?>
<li><a href="<?php bloginfo('home'); ?>">Home</a></li>
<?php ?>
<?php wp_list_pages
('sort_column=menu_order&depth=1&title_li='); ?>
</ul>
I can change it to this:

HTML: Select all
<ul>
<li><a href="http://www.minute44.com" accesskey="1">Home</a></li>
<li><a href="http://www.minute44.com/about" accesskey="2">About Me</a></li>
<li><a href="http://www.minute44.com/galleries" accesskey="3">Galleries</a></li>
<li><a href="http://www.minute44.com/shout-up" accesskey="4">Shout Up</a></li>
</ul>
but obviously I lose the effect of the current page link appearing different.

Can anyone see a way for me to alter the php in the first one so that it assigns the links accesskeys 1-4?

Cheers

Dan
Last Blog Entry: Annoying people.... (Jan 16th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 8th, 2008, 12:49
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: help setting accesskeys

Well the first one is easy:
HTML: Select all
<ul>
<?php if (is_home()) { ?>
<li class="current_page_item"><a href="<?php bloginfo('home'); ?>" accesskey="1">Home</a></li>
<?php } else { ?>
<li><a href="<?php bloginfo('home'); ?>" accesskey="1">Home</a></li>
<?php } ?>
<?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
</ul>
For the rest of the links, you'll have to modify the "wp_list_pages" function. If you post the code here I'm sure we can figure something out....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 8th, 2008, 13:15
minute44's Avatar
Most Reputable Member

SuperMember
Join Date: Apr 2006
Location: Nottingham UK
Age: 25
Posts: 1,351
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: help setting accesskeys

Just trying to find the file that contains the function.

Last Blog Entry: Annoying people.... (Jan 16th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 8th, 2008, 13:20
minute44's Avatar
Most Reputable Member

SuperMember
Join Date: Apr 2006
Location: Nottingham UK
Age: 25
Posts: 1,351
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: help setting accesskeys

OK, here's the function:

PHP: Select all

function wp_list_pages($args '') {
    
$defaults = array(
        
'depth' => 0'show_date' => '',
        
'date_format' => get_option('date_format'),
        
'child_of' => 0'exclude' => '',
        
'title_li' => __('Pages'), 'echo' => 1,
        
'authors' => '''sort_column' => 'menu_order, post_title'
    
);

    
$r wp_parse_args$args$defaults );
    
extract$rEXTR_SKIP );

    
$output '';
    
$current_page 0;

    
// sanitize, mostly to keep spaces out
    
$r['exclude'] = preg_replace('[^0-9,]'''$r['exclude']);

    
// Allow plugins to filter an array of excluded pages
    
$r['exclude'] = implode(','apply_filters('wp_list_pages_excludes'explode(','$r['exclude'])));

    
// Query pages.
    
$pages get_pages($r);

    if ( !empty(
$pages) ) {
        if ( 
$r['title_li'] )
            
$output .= '<li class="pagenav">' $r['title_li'] . '<ul>';

        global 
$wp_query;
        if ( 
is_page() )
            
$current_page $wp_query->get_queried_object_id();
        
$output .= walk_page_tree($pages$r['depth'], $current_page$r);

        if ( 
$r['title_li'] )
            
$output .= '</ul></li>';
    }

    
$output apply_filters('wp_list_pages'$output);

    if ( 
$r['echo'] )
        echo 
$output;
    else
        return 
$output;

Last Blog Entry: Annoying people.... (Jan 16th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jan 8th, 2008, 14:55
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: help setting accesskeys

OK, As far as i can tell the pages get added here:
PHP: Select all

$output .= walk_page_tree($pages$r['depth'], $current_page$r); 

Let's check out that function.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jan 8th, 2008, 14:57
minute44's Avatar
Most Reputable Member

SuperMember
Join Date: Apr 2006
Location: Nottingham UK
Age: 25
Posts: 1,351
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: help setting accesskeys

You know what? I can't be arsed with this anymore. Too much work to add a farting little feature that is useless to 99.99% of users and could very well harm my existing accessibility.
Last Blog Entry: Annoying people.... (Jan 16th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jan 8th, 2008, 16:10
Highly Reputable Member
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: help setting accesskeys

ok....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up to run javascript PutjatDa JavaScript Forum 2 Jun 8th, 2007 08:42
email setting help pls!!! norms1982 Starting Out 7 May 7th, 2007 15:43
PHP E-mail setting ??? j4mes_bond25 PHP Forum 0 May 29th, 2006 13:51
Setting up a forum cyberseed Web Page Design 5 Jul 26th, 2005 20:13


All times are GMT. The time now is 19:35.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42