Ning Developer Docs

Hi everyone,

I cant seem to find a way to add some custom text and some icons at the top content areas of pages "Videos", "Photos" and "Members". My network is at http://www.akmusictalk.com/ and I don't have the Ning source code.

Basically I want to add different text on these pages at top before it lists the Videos, photos etc. I tried something on http://www.akmusictalk.com/video by adding the content through Language Editor by attaching my text to "Sort By" but the same content is duplicating on other pages where Ning uses "Sort by"...I need to add different content to different pages.

Can anyone please point me in the right direction? Thank you. I've been browsing the forum looking for this without much luck so far. Thanks!

Views: 0

Replies to This Discussion

Generally, you can use jQuery to add or remove anything from any Ning page. The jQuery doc page is:

http://docs.jquery.com/Main_Page

If you search in here for jQuery, you'll find some examples of how to add or hide things:

http://developer.ning.com/main/search/search?q=jQuery

P.S. Ning isn't allowing anyone access to the source code anymore. We have to customize with jQuery or OpenSocial.
Many thanks for the JQuery pointer James. However as I am new to it I couldn't quite make it work on my Videos page yet.

I added the below code in Analytics but the html shows up in other pages too where the ID is xg_body.

Think I'm making a mistake by attaching the script to a div ID perhaps? Can you please tell how I can 'grab' the Videos page through JQuery instead of the div ID so my html shows only on that page.

I'll go through the JQ tutorials some more in the morning, if you could please point out what I'm doing wrong it will help immensely :)

Thanks again,
S

insertionPoint.innerHTML += bannerAdHtml;
}
//if the exceptin ID exists we abort
var exceptionElement = document.getElementById('signin_email');

var insertionPoint1 = document.getElementById('xg_body');
if((exceptionElement == null) && insertionPoint1) {
var bannerHtml = ' '; insertionPoint1.innerHTML += bannerHtml;
}
//if the exceptin ID exists we abort
var exceptionElement = document.getElementById('signin_email');
I apologize in advance that I only have time for a quick answer at the moment. You might try checking for the div with the xg_widget_video class to indicate that you are on the Videos page:

if (x$('.xg_widget_video').length) {
// Put the code in your post here
}

for Videos page and Photos page and Members page:
if ((x$('.xg_widget_video').length) || (x$('.xg_widget_photo').length) || (x$('.xg_widget_profiles').length)) {
// Put the code in your post here
}

I hope that helps!
Thank you James! Your are a lifesaver. I can now add my html on the videos page thanks to you :)

For anyone who is looking to do something similar, here's what I added in the Analytics between script tags:

var insertionPoint1 = document.getElementById('xg_body');
//if the exceptin ID exists we abort
var exceptionElement = document.getElementById('signin_email');
if((exceptionElement == null) && insertionPoint1 && x$('.xg_widget_video').length) {

var bannerHtml = 'some html...';


insertionPoint1.innerHTML += bannerHtml;
}
Always glad to help! :)

RSS

© 2024   Created by Ning Developer Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service