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

Forum

Ning 3.0 Tip: Add CSS to Member Profiles

Brought to you by popular demand on my site, jQuery to add CSS to your member profiles! 

 

Also inspired by SweetPotato's discussion and the use of "contains" for jQuery, I was able to adapt some of my own jQuery from my wordpress powered site to work for Ning 3.0 to allow members to add CSS to their profiles. 

 

PROFILE BEFORE:

PROFILE AFTER:

1)  To add this feature to your Ning 3.0 site you will need to add a profile question that contains the word "Style".  You will want to set the answer to use the Long Answer option.  I have also set mine to not show up in advanced searches.

For example:  Profile Style

Include CSS by adding it to the answer portion of the question.  Your CSS MUST include at least the "body" portion of the code.

For example: body {background-color: #191919;}

2)  Go to the Custom Code section of your Ning 3.0 site and add the following script to the End of Page Code box.

Add CSS to Member Profiles for V1 Themes

<script type="text/javascript">
x$(document).ready(function() {
x$('.profileCoverArea-question:contains("Style")').remove(); //remove the question from view

var background = x$('.profileCoverArea-questionAndAnswer:contains("body")').text(); //get the text from the .profileCoverArea-question field

x$('body').append('<style>'+background+'</style>'); //append it to the body

x$('.profileCoverArea-questionAndAnswer:contains("body")').hide(); //hide the table row with the css
});
</script>

Add CSS to Member Profiles for V2 Themes

Thanks to George H Compton IV this code has been adapted to work in V2 themes.

For V2 you will need to add the about box onto the profile page.
You'll need to go to
>Site & Pages
>My page
and add the (About) module.
Script will go to the same Custom Code section of your Ning 3.0 site, the End of Page Code box.

<!--  AnGellas Add CSS to Member Profiles themes v2 -->
<script type="text/javascript">
x$(document).ready(function() {
var background = x$('.aboutTab-questionAndAnswer P.aboutTab-answer:contains("body")').text(); //get the text from the
x$('body').append('<style>'+background+'</style>'); //append it to the body
x$('DIV.aboutTab-questionAndAnswer:contains("body")').hide(); //hide the table row with the css
});
</script>

Members will now be able to add CSS to their profile page!

Here is my Own page as a working example:

http://skemanon.ning.com/members/AnGella

The CSS I used remains responsive.  Here is a snippet to get you started:

body /*Background*/{
background-color: #191919;
background-image: url("http://") !important;
background-attachment: fixed;
background-position: bottom center;
background-repeat: repeat;
}
.content/*Text*/{
color: #fff !important;
}
a /*Links*/{
color: #999 !important;
}
a:hover /*Links on Hover*/{
color: #6b6b6b !important;
}

 

This can be customized as much as the user wishes, but for the sake of simplicity I have only added the CSS basics.

GUIDE FOR RETAINING RESPONSIVE CSS:

So long as you do not add the width property to any selectors, all CSS should remain responsive as it is piggy backed onto the site's main CSS.  For more information on basic CSS please see my discussion here:  Cascading Style Sheets AKA: CSS

Happy Coding!
AnGella

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

Join Ning Creators Social Network

Email me when people reply –

Replies

  • Great work AnGella!

  • NC for Hire

    nice work!

  • Thanks!

  • NC for Hire
    good job ;-)
    • Thanks SweetPotato!  I sure appreciate the intro to the "Contains" function in jQuery!

  • Hello AnGella, :(  I hate being the bearer of bad news but you can only see your own Style if your signed in, no one else can see the changes Signed in or not.. But with a little more work you'll have the best tip in on creators once it's working properly :)

This reply was deleted.

Search the Creators Network

Latest Activity

Thisisbully replied to Thisisbully's discussion I'm losing members because of 1 silly feature
""
1 hour ago
Jen replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Excellent!"
5 hours ago
Alida I.Gómez replied to Yana Ning Support's discussion Great news for Ning 2.0
"Quisiera saber si se puede aadir los ofrecimientos gratis a mi red actual en lo que desidimos si ha…"
7 hours ago
Thisisbully replied to Thisisbully's discussion I'm losing members because of 1 silly feature
"It should be like 2.0 in the activity feed and profile page groups imo iv been dealing with this fo…"
9 hours ago
Thisisbully replied to Thisisbully's discussion I'm losing members because of 1 silly feature
"His way doesn't even work right it just takes u to the photo page and u still have to click add aga…"
9 hours ago
Fabricio Giugni replied to Fabricio Giugni's discussion Powered by Ning How to get it out?
"You are just right."
10 hours ago
Fabricio Giugni replied to Thisisbully's discussion I'm losing members because of 1 silly feature
"I understand that you found a way to do it. And thanks for that.
We should not be punished because…"
10 hours ago
Fabricio Giugni replied to Thisisbully's discussion I'm losing members because of 1 silly feature
"    The Add Button should be on MyPage. And that's it.
The are no logical the way it is. The first…"
10 hours ago
Thisisbully replied to Thisisbully's discussion I'm losing members because of 1 silly feature
"Anything on this still have members that have no clue on how to post photos"
22 hours ago
Steve C replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Is there advanced search in 2.0 besides member search? I've never seen it and could really use it."
yesterday
Manuel Adame Jimenez replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hi, Kyryl, light works the way of your day, thank you, light.
☆♡☆"
yesterday
Kos replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Kyryl I have to say how wonderful it is to have liaison who understands CSS/HTML.  Just love it!"
yesterday
Kyryl_Ning_Support replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hi there,
Just put this into your custom CSS code field to center the video.
.videoDetailPage-video…"
yesterday
Alex replied to Fabricio Giugni's discussion Powered by Ning How to get it out?
"Yes, Glam Media forced it upon us against Ning's original policy. Originally Ning communities had t…"
yesterday
Kos replied to Kyryl_Ning_Support's discussion Chat Feature Update on Ning 3.0 is ready!
"They told me there's nothing wrong. *lol* Wrong!"
yesterday
doone replied to Kyryl_Ning_Support's discussion The long-awaited Search Option is now at your fingertips!
"Thanks, it works great for me."
yesterday
Fabricio Giugni replied to Fabricio Giugni's discussion Powered by Ning How to get it out?
"    Be a White label is the best for creators. Force us to have they ads on our website is like ter…"
yesterday
Manuel Adame Jimenez replied to Yana Ning Support's discussion Video Feature on Ning 3.0 is now available!
"Hello Kyryl, I put a screen shot, to ask you to leave the video to the center or that is option to…"
yesterday
Alex replied to Kyryl_Ning_Support's discussion Paid Access demo version
"I find it completely astonishing that any other type of paid access could even be contemplated, whe…"
yesterday
Mike Collins replied to Fabricio Giugni's discussion Powered by Ning How to get it out?
"Hi Kyryl,
This was something that Glam Media brought in and it was a real sticking point for many c…"
yesterday
More…