Links In The Head

Gallery2 is a wonderful and extremely powerful media sharing application, but some of its features are hard to reach for people with zero PHP/CSS experience.

So I wrote this plugin to deal with at least one of the problems.

With most themes, Gallery generates a list of “system links” at the very top of the page. Usually you see here things like “Login” and “Site Admin”. With a couple of neat plugins you can also add “About” and “Useful Links”.

But that’s about it.

Well, this top menu is too valuable a piece of real estate to ignore, and so I have come up with a way to inject into it any link your heard desires without having to mess with the templates files and learn Smarty. All you have to do is install a new module and then specify the link text and URL in the form. That’s it!

Important Note:

I do not use Gallery2 these days, and so I have fallen horribly behind in supporting this plugin. The plugin is very basic, so you should be able to fix/expand it easily. Gallery2 community is extremely helpful, so go ahead, hit the forums!

Alec Mayers has been generous enough to fix it recently, so if you run into trouble, you may try to get into his good graces 😉

The official home

Up-to-date version of the plugin (updated and improved by Alec and others) can be found at the official plugin page.


    The links could be absolute, or could be relative. I use it to point at my blog (here) and at my favorite photo (in the gallery). Your imagination is your only limit!


    This plugin is inspired by the excelent “About Page” module. A lot of the code came form “Links Page” module.

    And, of course, special thanks go to the Gallery2 team – they have created an amazingly flexible application!


    Sept 10, 2007 – version 0.1.1 – thanks to advice by valiant the module is now one file smaller and works at least twice faster (one HTTP request instead of two). Same features though.

    Sept 8, 2007 – original version 0.0.9

    Another Option

    Similar functionality is offered by the X_treme theme. If you are getting passionate about your gallery, you got to check it out: Pedro has spent a lot of sleepless nights making sure that even a total novice can enjoy full Gallery2 power.

    Support and Feedback

    Found a bug? Got an idea? An opinion? Just want to say “thank you”?
    Well, what are you waiting for? Write it right here!

    Would you like to take it over?

    I stopped using Gallery on any regular basis – switched to Drupal for the sake of some non-image functionality. This means that I am slowly but steadily falling behind on Gallery developments.

    Would you like to take over support and development of this plug-in? – Give me a yell!

    1. […] Detailed installation instructions and discussion can be found at module’s permanent page. […]

    2. Thank you, your a saint.
      I am not very good with CSS and PHP. this has saved me hours of pain.
      The gallery is under test as yet so there are no photo’s of Lowchen’s.
      Thanks again BillW

    3. Thanks for a wonderful plug-in! Seems to work great! I just have one question…

      Is there a way to change the order of the links?



    4. Cara,

      it should be possible to change the order of the links you add via the plug-in. However, it cannot help you with the order of the rest of the links (like “Login”, Register”, and “Site Admin”) – those would take a more intimate understanding of Gallery.

      Sorry, I am not likely to become that Gallery-proficient ever… But if anyone wants to pick up the torch and improve the plug-in, they have my blessing!

    5. I used FTP to put the “linksinthehead” folder into my modules directory.
      When I refresh the admin>plugins screen to find and activate the plugin, the whole website disappears ( blank white page )

      Removing the “linksinthehead” folder from the modules directory brings the website back..

      Gallery version = 2.2.3 core
      PHP version = 5.2.3 apache2handler
      Webserver = Apache/2
      Database = mysqlt 5.0.41, lock.system=flock
      Toolkits = Exif, LinkItemToolkit, Gd, Thumbnail
      Acceleration = none, none

    6. Hallo

      Thank you for this module.

      One question: Is it also possible to give to the different links a translation? perhaps through a .po file? Perhaps also to give an other URL to the links depending on the language? If yes, do somebody could tell me how to do it? This would be a great thing!

      Thank for your help!


    7. Chris,

      I have not been able to replicate the problem so far. Give me a few days – once I am back to my office I shall try to create a full replica of your environment and see what happens (thanks for detailed info!)

      to my shame I have zero experience with .po 😦
      Realistically, I won’t get time to figure it out before the end of the year. I will happily incorporate a patch if you write one 😉

    8. Fabulous, what a web site it is! This blog provides helpful
      facts to us, keep it up.

    9. certainly like your web site but you need to take a look at the spelling on several of your posts.
      Many of them are rife with spelling issues and I find it
      very bothersome to inform the truth on the other hand I will certainly come back again.

    Leave a Reply

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google photo

    You are commenting using your Google account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s


    I am sorry you have to see this. Actually, I am not – if you came here, it’s you fault. When we choose our actions we also choose the consequences.

    Despite my oversized ego I do NOT believe that anyone out there craves a daily dose of my insight. In fact, I am suspicious of people who think otherwise.

    This blog is a tool.

    I meddle with many complex computer deployments, and as I go through adding features and learning things, I also tend to forget numerous details and the reasoning behind the many choices I have made in the past. This is the place to document my adventures. And to give something back.

    If you stumble upon this and find it useful – …good for you.

    %d bloggers like this: