I have a function which outputs the navigation panel in a quiz module for one of my sites. Problem is I need to change the layout of the nav panel. The code is below. You can see that links to pages are output in the nav panel. However, when there's a lot of pages, they stretch all the way off the right side of the screen and the user has to scroll to the right to see them all. It looks unprofessional. I need to have a fix where the pages, if more than say 20, are output (wrapped) on multiple rows in the nav panel. Who can help for $10? Payment by Paypal when work is finished. function quiz_print_navigation_panel($page, $pages) { //$page++; echo '<div class="paging pagingbar">'; echo '<span class="title">' . get_string('page') . ':</span> '; if ($page > 0) { // Print previous link $strprev = get_string('previous'); echo ' <a class="previous" href="javascript:navigate(' . ($page - 1) . ');" title="' . $strprev . '">(' . $strprev . ')</a> '; } for ($i = 0; $i < $pages; $i++) { if ($i == $page) { echo ' <span class="thispage">'.($i+1).'</span> '; } else { echo ' <a href="javascript:navigate(' . ($i) . ');">'.($i+1).'</a> '; } } if ($page < $pages - 1) { // Print next link $strnext = get_string('next'); echo ' <a class="next" href="javascript:navigate(' . ($page + 1) . ');" title="' . $strnext . '">(' . $strnext . ')</a> '; } echo '</div>'; } Code (markup):
Try: function quiz_print_navigation_panel($page, $pages) { //$page++; if($pages < 20){ echo '<div class="paging pagingbar">'; echo '<span class="title">' . get_string('page') . ':</span> '; if ($page > 0) { // Print previous link $strprev = get_string('previous'); echo ' <a class="previous" href="javascript:navigate(' . ($page - 1) . ');" title="' . $strprev . '">(' . $strprev . ')</a> '; } for ($i = 0; $i < $pages; $i++) { if ($i == $page) { echo ' <span class="thispage">'.($i+1).'</span> '; } else { echo ' <a href="javascript:navigate(' . ($i) . ');">'.($i+1).'</a> '; } } if ($page < $pages - 1) { // Print next link $strnext = get_string('next'); echo ' <a class="next" href="javascript:navigate(' . ($page + 1) . ');" title="' . $strnext . '">(' . $strnext . ')</a> '; } echo '</div>'; } else { echo '<div class="paging pagingbar">'; echo '<span class="title">' . get_string('page') . ':</span> '; if ($page > 0) { // Print previous link $strprev = get_string('previous'); echo ' <a class="previous" href="javascript:navigate(' . ($page - 1) . ');" title="' . $strprev . '">(' . $strprev . ')</a> <br>'; } for ($i = 0; $i < $pages; $i++) { if ($i == $page) { echo ' <span class="thispage">'.($i+1).'</span> '; } else { echo ' <a href="javascript:navigate(' . ($i) . ');">'.($i+1).'</a> <br>'; } } if ($page < $pages - 1) { // Print next link $strnext = get_string('next'); echo ' <a class="next" href="javascript:navigate(' . ($page + 1) . ');" title="' . $strnext . '">(' . $strnext . ')</a> <br>'; } echo '</div>'; } } PHP: Also would help if you could let me know your site url so i can see...