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

Ning via Facebook

#inspirewithNING More talks, inspiration and success stories on #NING platform! Create your…

Philip Voice replied to Aubrey Williams's discussion Paid Access 2017
"I already charge access for Premium members using GoCardless. I would like to continue."
7 hours ago
Kyryl_Ning_Support replied to Aubrey Williams's discussion Paid Access 2017
"Hi Matt,
Yes, the Paid Access feature will support credit cards and PayPal as well.
Best regards,
N…"
11 hours ago
Kyryl_Ning_Support replied to Kevin Acosta's discussion Photo uploads being auto resized
"Hi Kevin,
Thanks for your feedback, your opinion is very important for us as it's helping us to mak…"
11 hours ago
Matt replied to Aubrey Williams's discussion Paid Access 2017
"Thanks, so the "credit card" support is additional to PayPal?"
12 hours ago
Kevin Acosta replied to Kevin Acosta's discussion Photo uploads being auto resized
"Yeah, well please pass along to the programmers in charge of such decisions that this new "feature"…"
21 hours ago
Ning via Facebook

#createwithNING Each online community is unique and special. What`s YOUR secret of network…

Kyryl_Ning_Support replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi Stanislav,
I do apologise for the misunderstanding. It seems that my colleague has decided that…"
yesterday
Kyryl_Ning_Support replied to Kevin Acosta's discussion Photo uploads being auto resized
"Hi there!
The same question has been mentioned in this discussion http://creators.ning.com/forum/to&hellip;"
yesterday
Sherry Ritchie and James joined Ning Creators Social Network
yesterday
Stanislav replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Kyryl, here is my ticket log with Anastasia, from which I understood I need to create new page and…"
yesterday
Aubrey Williams replied to Aubrey Williams's discussion Paid Access 2017
"Thanks for the response Kyryl, but based on Ning's history of not launching things on time, I can't…"
yesterday
Aubrey Williams replied to Aubrey Williams's discussion Paid Access 2017
"Naveen, please tell me more. Were you able to integrate Stripe with your Ning site in a way that re…"
yesterday
Kevin Acosta replied to Kevin Acosta's discussion Photo uploads being auto resized
"Well, even the FULL SIZE 38.5" x 36" poster that I attache was scaled down, so now that doesn't eve…"
yesterday
Kyryl_Ning_Support replied to Aubrey Williams's discussion Paid Access 2017
"Hi there,
We plan to initially release the PaidAccess for Ning 3.0 with PayPal and credit card supp…"
Monday
Kyryl_Ning_Support replied to Naveen Jain's discussion Wiki like functionality in Ning
"Hi there!
Unfortunately, we don't have the module on our platform that would be working in the way…"
Monday
Kyryl_Ning_Support replied to Anastasiia_NING support's discussion Ning 2Q 2017 plan!
"Hi there!
Thanks for the question.
No, you don't have to create the new network each time the new f…"
Monday
Matt replied to Aubrey Williams's discussion Paid Access 2017
"Good point, Stripe is awesome. "
Monday
ASDKFljflkj is now a member of Ning Creators Social Network
Monday
Alliance replied to Alliance's discussion Profile members on MY Page
"Thanks so much for this help things look sooooo much better now."
Monday
More…