hello,

I have a small question about the footermap.

When I'm logged in, in my drupal 7 website, the footermap shows up perfectly with the css styling that comes with the module (footermap.css).

But when I loggout en view a page (=different from the homepage)
the layout changes to default (html ul and li)

so: All login pages and the hompage always show op perfectly
but when I logout the layout changes...

Can anyone help me?

greetings

Comments

mradcliffe’s picture

Do you have any localization modules installed? It's possible that logged in is using one language and logged out is using a different one.

Another possibility. Are there any access restrictions configured in the footermap block (admin/structure/block)?

sander_cassiers’s picture

first of all thank you for your reply.

I don't have any localization modules installed (I think)
And there are no restricionts for the block.
I'm going to try to find out wy it changes the view with mozilla ff.

greetings

dman’s picture

Looking at the code this effect has an explanation. Though it's not intentional or desired.
The css is added to the page when the block content is generated. When logged in, caching doesn't happen so much. And all is cool.
But when logged out, the *content* gets cached (block level caching is on) but the css is not added to each page as it was the first time.
:-(

This happens ... and it's not what we expect - especially when developers never log out.

It doesn't seem to make sense to invalidate caching for this particular module, instead the css should be included at a point where it can be cached properly.

As far as I know, there is no cache-compatible way to add css during theme rendering, even though that feels like the most reasonable place to insert it with drupal_add_css. General wisdom instead says to put it in hook_init, or now in D7 you can just do it in the info file.
This probably needs work.

sander_cassiers’s picture

hmm.. that makes some sence but has no solution :)

the problem is that it doens't change the view when I'm on the home page logged in AND logged out.
this is the same view. but wen I'm logged out, and view a page different from the home page the view switches to no css view.

Is there a way to get that block to have the same css file all the time?

dman’s picture

put it in hook_init, or now in D7 you can just do it in the info file.

sander_cassiers’s picture

yes.. in my .info file : stylesheets[all][] = styles.css
I already had that but that still doesn't seem to work either..

dman’s picture

Well no.
looks like
http://drupalcode.org/project/footermap.git/tree/refs/heads/7.x-1.x
it's called footermap.css
and that info addition must be made in the module directory, not your own theme.

Or if this is getting difficult, just copy that css into your own theme...

sander_cassiers’s picture

Thank you very much Dman!

There was no link in footermap.info to the footermap.css.

inside the footermap.info must be ' stylesheets[all][] = footermap.css '
all this time I assumed there was a link but there wasn't :)

thnx again!

fixed

dman’s picture

This addition is *one* way to do it.
Personally, I don't see a problem with doing it this way - for this module I'd guess it makes sense for this CSS to be available pretty much everywhere. It's not always appropriate to put it in the .info but for this case .... I think you've got a safe answer, and I'd suggest this as an update to the module code, instead of the current drupal_add_css()

For anyone else that wants to try this - you probably will have to clear the cache after making this addition if you need it to work.

SwFlipNico’s picture

Issue summary: View changes

Hi all,

I've encountered the same problem and was able to solve it by switching the css positioning code (position, left, top css properties) from the block-block-X id selector to the id selector of the div containing the block.

Hope this will help...

  • mradcliffe committed 49c332d on 7.x-1.x
    Issue #1323450 by sander_cassiers, dman, mradcliffe: Change CSS to load...
mradcliffe’s picture

Status: Active » Fixed
Issue tags: -drupal 7, -footermap

This should be fixed by using #attached (#214856: CSS and JS for Cached Blocks (drupal_add_css incompatible with blocks)). This is what 8.x-1.x does as well now.

I missed this issue a long time ago and never was able to follow-up appropriately, sorry.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.