Quantcast
Channel: drupal.org - Site administrators
Viewing all articles
Browse latest Browse all 426

Create a quick Admin "Edit This Page" link that bypasses the content List

$
0
0

I sometimes do not like having to click on the Content link and then have to search for that page in the Content/Nodes screen, so this little code is handy for quickly editing a page while bypassing the Content list. Wordpress also has a quick command for this, but I never found it on Drupal.

global $user;
$role = $user->role ;
                                if($role=="admin" || $role=="administrator")
                                {
                                // Generate all your Drupal and PHP variables
                                    $nid = arg(1);
                                    $edit_this_page_link = ("<a style=" color:cyan;" href="' . $base_url . '/node/' . $nid . '/edit">Edit This Page</a>");
                                }

This can go into any page.tpl.php or even a preprocess function in your template's template.php file.


Viewing all articles
Browse latest Browse all 426

Trending Articles