WordPress.org

Ready to get started?Download WordPress

Forums

Flexi Pages Widget
In dropdown mode first can't be selected and links are incorrect (fix provided) (1 post)

  1. maximinime
    Member
    Posted 1 year ago #

    When script is enabled, there is no Go button. The first item in the list is already selected, so no onchange event fires when you choose it, so you can't get to that item.

    Also, you have links available but you're forcing the use of page ID for for the URL.

    This can be fixed in flexipages_dropdown() by changing to this line:

    $page_dropdown .= str_repeat("\t", $depth+1).'<option class="level-'.$level.'" value="'.htmlspecialchars($page['link']).'"'.$selected.'>'.str_repeat("    ", $level).$page['title'].$date.'</option>'."\n";

    And in flexipages() modify the start of the <select>:

    $pages = "<form action=\"". get_bloginfo('url') ."\" method=\"get\">\n<select name=\"page_id\" id=\"page_id\" onchange=\"if(this.selectedIndex)top.location.href=this.options[this.selectedIndex].value;\">";
    $pages .= '<script type="text/javascript">document.write(\'<option value="">\' + '.json_encode(__('Select', 'flexipages')).' + \'<\/option>\');</script>';

    This would also resolve this issue.

    http://wordpress.org/extend/plugins/flexi-pages-widget/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic