Jump to content
  • 0

Change the Background Image


TechAngel85

Question

Is there a way to change the background image of a single wiki page from the default Skyrim image? For example, if a user is creating a guide for a different game other than Skyrim, they'd be able to change the background image to something from that game. I've tried this CSS code:

body{height: 100%;width: 100%;background: url('URL TO IMAGE') no-repeat;background-position: 50% 50%;}

It should work in theory; however, it's not. In fact, when I use the code all other CSS formatting is eliminated from the page. Very strange. :psyduck:

Link to comment
Share on other sites

Recommended Posts

  • 0

I'm not entirely sure what method is being used, as Z linked me to https://wiki.step-project.com/User:TechAngel85/MassEffect.css. Overriding CSS is applied Wiki wide, and is done by either overriding a specific skin, or making global changes. In our case, both will have the same effect since we only have one skin enabled.

 

SKIN SPECIFIC

https://wiki.step-project.com/Special:MyPage/step.css

GLOBAL

https://wiki.step-project.com/Special:MyPage/common.css

 

The link that Z provided me from Tech is not valid and will not override anything.

 

There is the CSS extension, but that was only installed as a workaround for the STEP guide. It is not intended for the masses to modify pages, thus altering the default look as it applies to everyone. Once MediaWiki is updated and the skin updated (which is required due to changes in MW), changes will be made to better support the Guide and similar rare cases where the CSS extension was necessary, thus making it obsolete and removed.

Link to comment
Share on other sites

  • 0

Tech is speaking about altering behavior of just one page to reflect look/feel for all users relating to a different game. He is specifically invoking the CSS extension behavior, which works but for the case with page-specific fonts and background image.

 

Page: https://wiki.step-pro...el85/MassEffect

CSS: https://wiki.step-pro.../MassEffect.css

 

Neovalen and EssArrBee use the same method for their guides (as we do for the STEP Guide). It is perplexing why the background atribute cannot be applied. Can you determine why it disables all of the custom page-specific css?

Link to comment
Share on other sites

  • 0

The plan has always been to get away from needing the CSS extension. It was never intended to be used by everyone.

 

If we are at the point of looking to start support for additional games, we might want to see about standing up additional instances of MW so they have a common look and feel that is their own.

 

In addition, I just checked the page you linked, and I see the background image applied.

Link to comment
Share on other sites

  • 0

There was a problem we experienced where the first element override was not applied on the STEP guide, and the fix was to create an empty reference. Doesn't appear to be working here. I have no idea why it's not working. Maybe it's because the css on a page that is the standard for user overrides. Maybe the extension doesn't allow overriding the body (the MW page says you can, but who knows if that changed and documentation wasn't updated).

 

Plan is still to eventually get rid of the CSS extension.

Link to comment
Share on other sites

  • 0

All CSS works except that particular background-image element. When uncommented, it disables all of the other CSS.

 

It IS working, but just not that element. If you inspect the page (the Mas Effect Guide page where the custom CSS is being applied), you will notice that it does not even appear in the Inspector, regardless of using !important or not.

 

Why does ALL custom CSS work (including body {}) but if the img() attribute is applied, EVERYTHING breaks ... ?

Link to comment
Share on other sites

  • 0

Not 100% sure without further inspection of code, but based on the hook points that are required for the CSS extension to work, I'm almost certain it is due to the MW parser rejecting the URL. There are protections built into MW to prevent people from doing bad things (can't use anchors directly, have to use MW markup for URL's so they are properly sanitized, etc.). If that is the case, nothing we can do about it without opening ourselves wide open to much more serious problems.

 

EDIT: Just read DoubleYou's post, and I'm absolutely certain now it's the parser scrubbing the contents and ultimately breaking the CSS entirely due to invalid formatting.

 

Result: no changing of background using url's.

Link to comment
Share on other sites

  • 0

Thanks for checking in this guys!

 

It's not that big a deal. It would have just been nice to been able to change it. The skyrim reference in the background of a game guide that isn't skyrim (such as my Mass Effect Enhancement Guide and the Fallout: New Vegas Guide) doesn't make much sense. No room to complain when it's been hosted for free. ::): I'm planning on ME2 and ME3 Guides as well....depend if the scope is big enough to do those guides or not. Currently not making them publicly known like the FNV Guide though until I can hash out a few issues.

 

Thanks again!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.