This is a suggestion to NING. Could you give every page an individual unique class name in <body>? Then we can easily write CSS or Javascript for a special page.

For example <body class="auto-generated-class-name">

Actually we did this in Yahoo! Just for safe if someone need to change something later.

 

And kindly give every text box an individual unique class name or id. Thank you.

Tags: CSS, class, iyoume

Views: 204

Reply to This

Replies to This Discussion

Right on, Alex.  I've been wanting to modify certain pages myself--such as changing the layout and columns of other pages.

Hey Alex and Antavious,

I was craving this feature myself, so I figured out how to do it using javascript.  This script will add the page url as the class(es) for any page on your site.  If you are on the home page it will set the body class to "home".  If you are on /profiles/members/ it will add the body class "profiles members", etc.  Check it out.  I hope it helps.  

You'll need to paste this code in the "Custom Code" interface for your Ning network.

<!-- begin setBodyClass -->
<script type="text/javascript">
function setBodyClass() {
var url = new String(window.location.pathname);
dirs = url.split('/');
classes = '';

if (dirs) {
for (i = 0; i < dirs.length; i++) {
var dir = dirs[i].split('.'); // removes file extentions

if (dir[0]) {
classes += ' ';
classes += dir[0].toLowerCase();

}
}
}
if (classes == '') classes = 'home';
// check if body has an existing class
if (!document.body.className) {
document.body.className = classes;
} else {
var newClassName = document.body.className;
newClassName += classes;
document.body.className = newClassName;
}
}
setBodyClass();
</script>
<!-- end setBodyClass -->

Thanks Brian, 

This is performance issue. CSS layout is much faster than Javascript. And according to the standard. Layout things should use CSS not Javascript.

RSS

Latest Activity

Rosemary Burns joined Allison Leahy's group
Thumbnail

The Sandbox

Join The Sandbox to experiment with Ning 3.0 now!The Ning Team will be triaging bug reports and…See More
1 hour ago
Profile IconNing via Facebook
Thumbnail

The Ning Platform explained in a bakers dozen of pretty slides. Enjoy!…

See More
Facebook1 hour ago · Reply
Allison Leahy joined arqueologiadigital.com's group
Thumbnail

Criadores Brasileiros - Brazilian Creators

Grupo para todas as redes Brasileiras do Ning. (Group for all Ning Brazilian Networks).See More
1 hour ago
Elshara Silverheart replied to Elshara Silverheart's discussion 'Free Site Promotion'
"Like before, remember to include the full web address of your network so that it can get properly…"
2 hours ago
Strumelia replied to Elshara Silverheart's discussion 'I am A Little Upset'
"I feel for you Elshara, it must have been upsetting.  But this is a good example of why we…"
3 hours ago
Sylvia Hysen replied to Sylvia Hysen's discussion 'Great Slider- must see!'
"Thx Where Women Blog... I did the graphic design in Photoshop and I hired a pro to do the…"
3 hours ago
Michelle Duchemin replied to Phil McCluskey's discussion 'Mini Release: CSS classes and bug fixes'
"Hi All, Just a quick question: Where can I find this document that has all the up to date CSS…"
3 hours ago
Elshara Silverheart replied to Elshara Silverheart's discussion 'SEO Success'
"I forgot to show an example of what I mean with the site map and search bots. You can see what I…"
3 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service