"Links In The Head" module: Links disappear

Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Sat, 2008-05-10 23:15

Links set up with the "Links In The Head" module disappear sometimes and obviously can displayed again after deinstalling and re-installing the module.

What might this be caused by?

Nice greetings, Dirk


Gallery version 2.2.4 / full package
PHP version 4.4.8 apache2handler (going to change to one of the newest, stable php releases, 5.X)
Webserver Apache
Database mysqlt 4.1.22-max-log (going to change to one of the newest, stable releases)
Toolkits Thumbnail, Gd
Operating system Linux dd16114 2.6.24.4-nmm2 #2 SMP Tue Apr 15 18:13:27 CEST 2008 i686
Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)

----------------------------------
www.galerie-der-fotos.de

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2008-05-10 23:57

It is a known issue ( http://gallery.menalto.com/node/69083#comment-273173 ) and without a maintainer it will stay that way for some time.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jens_k

Joined: 2007-01-28
Posts: 244
Posted: Sun, 2008-05-11 05:38

Hi Dirkii,

how much links do you need to implement and how often they will change? In other Words would it be acceptable for you to write them hard coded in the tpl files?

Cheers Jens
___________________________________
http://jekophoto.eu | http://jekophoto.de

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Sun, 2008-05-11 08:47

Okay, thanks, Dave,

For the link. So I will deinstall this module and not use anymore.

Another disadvantage of this module seems to be that the navigation menu does not break when the links come to a special amount about may be seven items on my sreen. So they are displayed in a row and might overlay something, e.g. the logo and cause a horizontal scrollbar.

Hallo Jens,

I do not know axactly how many it will be, yet, may be not more than five, six links I think. After implementing they should not change.

Quote:
In other Words would it be acceptable for you to write them hard coded in the tpl files?

Yes, absolutely, so I could even insert a line break (<br>). I could not find the file containing the navigation.

Thanks for your help, Dirk.

----------------------------------
www.galerie-der-fotos.de

 
jens_k

Joined: 2007-01-28
Posts: 244
Posted: Sun, 2008-05-11 09:41

Hi Dirk,

normally the section to alter is in the file /themes/<them-name>/templates/theme.tpl.
I am using the X_treme theme. The following is only an example for this theme. Other themes may have integrated the system links another way. The relevant lines of code for this example are between lines 784 and 856.

The part for one link is e.g.:

            {if $theme.params.link1}
              <a href="{$theme.params.link1url}">{$theme.params.link1}</a>
	      {assign var='TopLinksseparator' value='0'}
            {/if}

You could alter these lines to:

              <a href="URL-for-your-link">Name of the Link</a>
	      {assign var='TopLinksseparator' value='0'}

To let your links break the line if they are to wide you should have a look at line 784:
<td style="width:50%;text-align:right" nowrap="nowrap" class="SystemLinks">
After removing nowrap="nowrap" they should be break ;-)

If you are using aonther theme or not be able to find the corresponding lines at your theme.tpl you can send me your theme.tpl via PM.

Cheers,
Jens

___________________________________
http://jekophoto.eu | http://jekophoto.de

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Sun, 2008-05-11 12:47

Hallo Jens,

Thank you very much for your help, the very useful instructions which helped me figuring it out.

It seems as if I had got it working in my "ice" theme (I have installed a few test versions to check out various modules, how to set up the photo gallery best).

I was wrong telling that there appears a horizontal scrollbar, so it also seems as if there is no "nowrap" in my theme / css (could not find any by searching the themes code). So I can just use <br> to break the navigation lines and it seems to work fine. Much better than using the module.

And thank you very much for offering to modify my template. That's very kind.

Nice greetings, Dirk

----------------------------------
www.galerie-der-fotos.de

 
ultravista

Joined: 2006-10-08
Posts: 121
Posted: Tue, 2008-05-13 13:31

Is there another way to put links "in the head" without this module? I have run into the same problems and have since removed it.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-05-13 21:07

I'll try to debug this problem - although it hasn't reoccurred for me for a long time.

I've also uploaded the module to the SVN server with a MANIFEST, to see if I can get it to appear in the community plugins page.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-05-13 21:59

Stop the clock... I found the bug, I think. (45 minutes... not bad.)

The module author calls GalleryCoreApi::removeAllPluginParameters('module', 'linksinthehead'); every time the contents of the module's admin page is saved (and then goes on to rewrite the contents) without realising that that API function wipes the secret _callbacks parameter (which should contain getSystemLinks|getSiteAdminViews). Without that parameter the links aren't collected to be displayed and the module's admin page disappears from view. Why does it persist until the next module is installed? I think actually it persists until that part of the database cache is refreshed.

I'll sort out a fix tomorrow and see if that does the trick.

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Tue, 2008-05-13 22:49

Yes, very well done, alecmyers,

Thank you very much, so I cannot wait to download the fixed version.

Nice greetings, Dirk.

----------------------------------
www.galerie-der-fotos.de

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2008-05-14 20:13

This bug is now (I think) fixed - and the new version is available from the community repository - via the more plugins admin page.

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Wed, 2008-05-14 22:16

Great alecmyers, thanks very much,

Might there be anything wrong with the style buttens ("F", "k" etc. seem not to work on my system) and with the pop up color window? It does not work as it seems on my system, I cannot set any color, and cannot close it.

Nice greetings, Dirk.

----------------------------------
www.galerie-der-fotos.de

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2008-05-14 22:29

I'd never tried it before, although now you mention it, it doesn't seem to work for me either. I'm not really sure how it's supposed to function.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2008-05-15 05:47

@ style buttons: I mentioned it to the author http://gallery.menalto.com/node/69083#comment-261587 that the color picker is not required but was never updated.
alecmyers, thanks for maintaining this module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2008-05-15 08:00

I've removed the markup options from the template as you suggested; the modified code should be available from the repository after the next repository sweep.

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Thu, 2008-05-15 09:36

Many thanks for modyfing and help,

An option which could be more useful than the markup options could be to enable adding a line break manually between the added links.

Nice greetings, Dirk.

----------------------------------
www.galerie-der-fotos.de

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2008-05-15 13:15

Hi Dirk,

As you probably know, all it's possible for this module to do is declare the links. It's up to your theme how to display them, just as it is for all the other links like login/logout, Site Admin and so on. If you want to add blank lines you should modify your theme templates.

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Thu, 2008-05-15 13:33

Hallo alecmyers,

I am not quite sure whether I understand right.

What I meant was:

Navigation of Gallery in the head with added links by the module "Links in Head":

Link1 - Link2 - Link3 - Link4 - Link5 - Link6

Now having used the option to add line breaks it might look like this:

Link1 - Link2 - Link3 - Link4
Link5 - Link6

or

Link1 - Link2
Link3 - Link4 - Link5 - Link6

Nice greetings, Dirk

----------------------------------
www.galerie-der-fotos.de

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2008-05-15 13:41

Hi Dirk,

Yes I understand what you mean. It's not possible. But it's up to your *theme* to decide how to display the links, on which part of the page, which fonts, which styles and sizes etc. All this module can do is say "here's a list of links" just the same as all the other modules - there's nowhere to say "put a line break here, here and here but not here" - that's all at the discretion of the theme templates only.

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Thu, 2008-05-15 14:20

Hallo alecmyers,

Okay, yes, I understand.

I got the idea with the line breaks because some links overlayed something, e.g. the logo (so the theme decided to late) after creating a special amount of links with the "Links in Head" module and so I thought it would be good to be able to add a line break with this module.

Well, I understand this can be done only by editing the templates.

Many thanks and nice greetings, Dirk.

----------------------------------
www.galerie-der-fotos.de

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Thu, 2008-05-15 21:37

Oops, as I have just seen the behaviour of the "Links in Head" module seems to be the same like before: the added links suddenly disappear and after deinstalling and re-installing the module they are dispalyed again.

Nice greetings, Dirk

----------------------------------
www.galerie-der-fotos.de

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2008-05-15 22:42

What's the version number of the module where this happened?

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Thu, 2008-05-15 22:54

0.1.2 if I see right, alecmyers.
----------------------------------
www.galerie-der-fotos.de

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2008-05-15 23:40

It's a mystery then. Can you try to narrow down the circumstances then? Anyone else still having this problem?

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Fri, 2008-05-16 08:52

I`ll try to: If I remember right, I have done anything other than I did before updating, all I have done is just to test a bit with the "Links in Head" module, just delete and add links and suddenly they are disappeared, that`s all if I remember right. So I assume they disappeared instantly after deleting or after deleting and adding. I do not remember another related action to the module I might have done.

----------------------------------
www.galerie-der-fotos.de

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Fri, 2008-05-16 16:47

When the links disappeared (and please check this if it happens again) did the Amin page link stay visible? If so, when you click(ed) on it, were/are the links still present or were the boxes now blank? If so, could the links be restored by re-entering them?

 
Dirkii

Joined: 2008-01-16
Posts: 214
Posted: Fri, 2008-05-16 18:34

Hallo alecmyers,

Checking what you told me, I just saw that the module is deactivated though I do not mean to have done it. The links are displayed, nevertheless. I activated the module and the links stayed displayed, then I deactivated it and the links disappeared. After activating they are displayed, again. The "Site-Administration" link always was displayed doing this. Adding a new link worked okay, deleting two of about six links worked, also.

I have never noticed the "Site-Administration" link disappearing while testing and before.

I have downloaded a new module to see the behaviour of the "Links in Head" module. The links remained displaying.

I deactivated and activated any module the links added by the "Links in Head" module kept dispalayed.

I cannot reconstruct a situation at the moment which let the links disappear.

The fields of the module I have never noticed blank.

Actually Jens' method to add new links is very useful for me because I do not intend to change links after setting them and, so I can control the line breaks, also, so I will use it, I assume.

I will be watching the modules behaviour and if you have any question...

Many thanks for your help, Dirk.

----------------------------------
www.galerie-der-fotos.de

 
diverguy

Joined: 2003-08-22
Posts: 24
Posted: Mon, 2008-12-15 01:41

Gallery 2.3 is loaded on Windows server and doesn't like downloading from the repository so I can't seem to get the Links In The Head module. Instead, I would like to hard code a single link into the theme.tpl file. The link will not be changing so hard-coding it shouldn't be a problem.

I've tried adding it a number of places in the theme.tpl but it never shows up. Here's the section of the theme.tpl file:

<div id="gsHeader">
<img src="{g->url href="images/galleryLogo_sm.gif"}" width="107" height="48" alt=""/>
</div>
{g->theme include="progressbar.tpl"}
{else}
<div id="gsHeader">
<a href="{g->url}"><img src="{g->url href="images/galleryLogo_sm.gif"}"
width="107" height="48" alt=""/></a>
</div>

<div id="gsNavBar" class="gcBorder1">
<div class="gbSystemLinks">
{g->block type="core.SystemLinks"
order="core.SiteAdmin core.YourAccount core.Login core.Logout"
othersAt=4}
</div>

<div class="gbBreadCrumb">
{g->block type="core.BreadCrumb"}
</div>

I would like to add <a href="http://www.domain.com">Home</a> but I can't figure out where. Can anyone help?

In the alternative, if the Links In The Head module is indeed stable, as indicated above, could someone walk me through the process of manually downloading it and manually installing it?

Thanks,

John

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Mon, 2008-12-15 02:31
Quote:
Gallery 2.3 is loaded on Windows server and doesn't like downloading from the repository

There's nothing about running Gallery on a windows server that means it shouldn't be able to download from the repository... maybe that's something you could investigate.

As far as editing your template file goes, usually if you make some obvious change to a template and it doesn't show up you either a)have template caching on or b)are editing the wrong file (like from a theme you're not using, or there's a local/ variant and you're editing the original.

So a) turn off template caching on your admin->performance (I think) page, if you're using it, for as long as you're editing templates - only necessary if you're using 2.3 - and b) add some plain-text to the template where you want the link to appear, and verify that it shows up in the html. If it doesn't, double, triple, quadruple check exactly which file you're editing.

Finally if you're editing template files, leave the original intact, and put your editing copy in a local/ subdirectory - that way your updates survive upgrades.

Finally (OK, I lied) yes, as far as I know, linksinthehead is stable.

 
diverguy

Joined: 2003-08-22
Posts: 24
Posted: Mon, 2008-12-15 11:12

Thanks, alecmyers. Template caching was the issue. Once it was turned off, the update was easy. Appreciate the help.