Current status of the Ning Platform is always available on the Ning Status Blog.

Forum

NC for Hire

Overriding Ning's Sprite Image

Has anyone ever been able to successfully override Ning's default sprite image to produce different icons throughout the network?

I've grown tired of the default Ning sprite image...would love to know if anyone else has explored this...

You need to be a member of Ning Creators Network to add comments!

Join Ning Creators Network

Email me when people reply –

Replies

  • Should be *relatively* simple, just override the one CSS statement that gives the sprite URL with your own url to your image. The tricky bit is creating your own image where all the sprites are the same size and in the same order as Ning's... Otherwise you have a real headache re-defining each sprite's position within your new image.

    On creators, it's this line in the theme css file http://static.ning.com/creators/instances/css/theme-982_1356245232....

    .xg_sprite, .xg_icon, .rich-comment, .rich-comment em, .delete, .smalldelete, .activity-delete, ul.rating-themed, ul.rating-themed a:hover, ul.rating-themed a:active, ul.rating-themed a:focus, ul.rating-themed .current {
    background-image: url(http://static.ning.com/socialnetworkmain/widgets/index/gfx/icons/xg...);
    _background-image: url(http://static.ning.com/socialnetworkmain/widgets/index/gfx/icons/ie...);
    }

    • NC for Hire

      interesting..im gonna see if I can wrap my mind around this when i get back home..thanks Chris..

      • Check out the sprite image. It's one very tall image with loads of small icons. I think there is a large version too, and maybe an icon version, you'll find them with an inspector browsing your site. The positions are critical, as each sprite is simply the whole image as background, positioned exactly e.g.

        .xg_sprite-comment {
             background-position: left -401px;
        }

        slides it up 401px until the comment icon is in view in the element.

        The colour is defined in the png's name in hex, in this case it's 336699, look for the one in your network that matches your theme and go from that. Probably a good day's work in photoshop to replace them all with the images you want.

        • I'm having a stab at this tonight. I'm only weeping a little bit. About halfway through the first file. I'm a little naive when it comes to the way some of this CSS works, but do you think you might know what the difference is between the two files - ie under what circumstances one is used over the other, or do they just complement each other?

          It's horrible to work out, as there appears to be no standard spacing between each icon. You occasionally find that a batch are 16x16, which is convenient, but often there's no logic to them at all. If Ning were still here, I'd ask for a template with guides....

          Did you ever go anywhere with it?
  • Forgive my ignorance....what is the "sprite" image and where is it on Ning sites?

    • The "sprite" image is actually all the little icons you see on the site, all together in one image to make page loading faster and coding simpler. Imagine a very long piece of tape, with lots of little pictures on, all the same size. The envelope icon, the star icon, the alerts icon, the comment icon, the delete, edit, add, view icons and all the rest.  All the little blue pics you see on this page. Then imagine a piece of paper with a hole cut in it, big enough for only one of these images. Hold the paper in front of the tape, and slide the tape up and down. You only see one image at a time. That's how the sprite image is used, with css. See this page for examples http://www.w3schools.com/css/css_image_sprites.asp or open the links in my comment above to see the sprite image for the creators icons. You'll have to zoom in lots as your browser will shrink it to fit in the window... It will be tiny, and on the very left of the page.

  • I do but instead of trying to position a sprite I replace it with an icon or image, I will type up an example a bit later as I am in the process of replacing one on the new activity feed. I replaced the media upload icon for my videos page and hid all the others so only they could choose the you tube button instead to lessen any confusion of which one to use

    Here is an example image of it, by the way I made it bigger on purpose

    Here is the code I used for the YouTube button

    /* You Tube Icon*/
    .page-video .entryEditPage .mce-icon-row .icon-media{background-image:url(http://api.ning.com:80/files/*whl3J3XpWQhJUbT*13KqDKeYTf6c1T2phBiG8VYWfgd0ODVqP3woA-Um4Wx1BMBYSFkyQZ3SRprmVzov40Vj1oZmAhTx2cd/Youtube.png);background-position:center center;background-size:100%}
    /* ReSize the link to take the youtube icon */
    .page-video .entryEditPage .mce-icon-row a { height:60px;width:60px;}
    .page-video .entryEditPage .mce-icon-row{ font-size:1.4em;margin-bottom:10px }

    So basically I added the icon as a background image then as I wanted the icon bigger I resized the part which holds the little icons. It's very much the same with any of the sprite images, rather than mess around with positions from the icon sheet if you are replacing ones here and there it's quite easy to do it this way and then you can play around with the sizing etc.

    Oh by the way if you are wondering how I got rid of the other icons on that little toolbar here is the code I used for that

    /* Remove the icons except for the link and video ones */
    .page-video .entryEditPage .mce-icon-row .icon-link {display:none}
    .page-video .entryEditPage .mce-icon-row .icon-image {display:none}
    .page-video .entryEditPage .mce-icon-row .icon-pastetext {display:none}
    .page-video .entryEditPage .mce-icon-row .icon-file {display:none}

    JF you can actually see this as you are a member log into my site then go to the videos page and choose add video to see this.

    • NC for Hire

      ha!  will do.. this post was from 2013 but i suppose others are still interested in it.. great ill check it out John..

This reply was deleted.

Search the Creators Network

Latest Activity

Vipster replied to Vipster's discussion How to change the text color of one navigation tab with CSS in Ning 2.0?
"That's working. Thanks!"
3 hours ago
Ramin Tehrani replied to Ramin Tehrani's discussion Global CSS keeps losing and pages get deleted- how to resolve-urgent help needed
"You mean, the CSS codes will come back. By the way, how would I know which default theme is being u…"
3 hours ago
Ramin Tehrani replied to Ramin Tehrani's discussion Global CSS keeps losing and pages get deleted- how to resolve-urgent help needed
"Hello Tim,
Actually, there is only below CSS scripts which I didn't add. I had added huge chunk of…"
3 hours ago
Tim Atkinson replied to Ramin Tehrani's discussion Global CSS keeps losing and pages get deleted- how to resolve-urgent help needed
"Mind you, these things tend to happen when Ning is testing stuff...this could be a positive develop…"
3 hours ago
Tim Atkinson replied to Ramin Tehrani's discussion Global CSS keeps losing and pages get deleted- how to resolve-urgent help needed
"Similar happened to me - lost a couple of revisions I'd recently made, but not whole CSS - did any…"
3 hours ago
Tim Atkinson replied to Kos's discussion OK Ning Wizards - I Need Your Help
3 hours ago
Strumelia replied to Traddie's discussion Contingency Planning. What's Yours?
"I know very little as well about all this.  But... I believe the only platforms that will actually…"
4 hours ago
Writer Chick {Diane} replied to Jeffrey Haskins's discussion Interesting post on Ning Facebook.....
"Your opinion carries a lot of weight around here, as does JFarrow's.  :) "
5 hours ago
John Bizley replied to Vipster's discussion How to change the text color of one navigation tab with CSS in Ning 2.0?
"You can do it by specifying the url of the tab in css to change a colour of a particular tab, this…"
7 hours ago
Donna Mac replied to Tim Atkinson's discussion My letter to Bernard Desarnauts, SVP & GM, Ning
"That does indeed sound like your solution!  :)"
8 hours ago
Strumelia replied to Ken Rich's discussion Ning Lied To Us - Your Content is Not Safe
"Yay!  I'm going to be part of building/migrating my beta test network site on Jamroom-  big, big th…"
8 hours ago
Ken Rich replied to Tim Atkinson's discussion My letter to Bernard Desarnauts, SVP & GM, Ning
"Well it seems there is another viable path out of Ning, which only makes me happier, because I hate…"
8 hours ago
Strumelia replied to Ken Rich's discussion Ning Lied To Us - Your Content is Not Safe
"Yep, me too, I've sent a note top Paul and I too would like to be part of the beta migration to Jam…"
8 hours ago
Donna Mac replied to Tim Atkinson's discussion My letter to Bernard Desarnauts, SVP & GM, Ning
"Ning PRO site that is still running until the end of this year.  I would keep it in a second if I t…"
8 hours ago
Ken Rich replied to Ken Rich's discussion Ning Lied To Us - Your Content is Not Safe
"No problem, happy to help..."
9 hours ago
John Koch-Northrup replied to Ken Rich's discussion Ning Lied To Us - Your Content is Not Safe
"I've sent a note to paul at jamroom. My music and creative related community would likely fit perfe…"
9 hours ago
steve replied to Jeffrey Haskins's discussion Interesting post on Ning Facebook.....
"oh yes Anam, ive seen it a lot worse than this. :("
9 hours ago
Ken Rich replied to Tim Atkinson's discussion My letter to Bernard Desarnauts, SVP & GM, Ning
"Cool... Thanks for the info... It seems to be in the same category of solutions, in that it is a "o…"
9 hours ago
Ken Rich replied to Ken Rich's discussion Ning Lied To Us - Your Content is Not Safe
"Aw shucks - yer making me blush - lolIf the truth be told, I have felt betrayed by Ning ever since…"
9 hours ago
Traddie replied to Ken Rich's discussion Ning Lied To Us - Your Content is Not Safe
"Hi.  That's not my site, I'm just saying that they have moved to a drupal solution. They have lost…"
9 hours ago
More…