Social Web Directory :: Social Network Directory :: Ning Tips and Ning Support
How To Add Content to Your Header:
Summary - Prepare your content and add to an external HTML. Call into your Network Header via Analytics Box, using an iframe and JavaScript.
EXAMPLE #1:
ADD CONTENT BELOW MENU NAVIGATION BAR:
<script type="text/javascript">
x$("#xg_navigation").after("<div id='custom_ads'></div>");
var ad_html = '<iframe frameborder="0" scrolling="no" allowtransparency="true" marginheight="0" marginwidth="0" src="your_custom.html" width="955px" height="100px"></iframe>';
x$("#custom_ads").html(ad_html);
</script>
EXAMPLE #2:
ADD CONTENT BELOW NINGBAR:
Note: For some reason, the centering had to added to the script, in this case.
<script type="text/javascript">
x$("#xn_bar").after("<div align=center id='custom_ads'></div>");
var ad_html = '<iframe frameborder="0" scrolling="no" allowtransparency="true" marginheight="0" marginwidth="0" src="your_custom.html" width="955px" height="100px"></iframe>';
x$("#custom_ads").html(ad_html);
</script>
Tags:
Hi Jen, Quick question: Anytime I add an iframe and embed a html file (that's located on another server) I always add target="_blank" so they don't open within the iframe. The contents of the html include nav links that open in new windows and it's kind of annoying, lol.
Would you be able to help? How can I change it so the links open in the same window but not within the iframe.
Also, when I open this in my mobile, I can only see the logo and not the nav links..Do I need to add something to the code?
I know you're super busy and any help would be greatly appreciated.
See it here.
P.S. I know this article was written quite some time ago, but I used this tip anyway, to spruce up my 2.0 site until I get things going with the 3.0 site =)
Thanks, Mandy
Hi Mandy,
One thing to note: You can't use drop down menu items within iframes. As long as you have one level of menu links, you're good.
If the HTML you're iFraming belongs to you (other words, if you can edit it) - - to fix the issue of _blank:
For each link in original code, change _blank to _top. That should fix it.
I don't know about the mobile issue.
Best Regards,
Jen
omg that's so cool, it fixed it!! Thank you so much, I had no idea about the "top" code, never heard of this one before! You're awesome, thanks.
Mandy
My pleasure, and great! Glad that worked out. Thank you for the feedback.
Best Regards,
Jen
I loved this code so much that it got me thinking..can this be used on a page as well?
For example change the following:
x$("#xn_bar")
to something like..
x$("xg_widget_page")
I'm completely guessing here as JavaScript is not my expertise, lol.
I would love to expand the width of just a single page to embed a index.html file in an iframe and was thinking maybe this code would help?
hehe sorry for my crazy ideas..was just wondering if it's a possibility with this code. (this is for ning 2.0, btw)
or would I have to do something like this.
Thanks again. Have a nice Friday.
Welcome to
JenSocial: Social Web Directory and Ning Tips
Posted by JenSocial on May 7, 2018 at 8:35pm 9 Comments 1 Favorite
Posted by JenSocial on January 6, 2017 at 4:00pm 10 Comments 1 Favorite
Posted by JenSocial on October 22, 2016 at 1:05am 0 Comments 0 Favorites
Posted by JenSocial on September 17, 2016 at 12:00am 26 Comments 1 Favorite
Posted by JenSocial on August 31, 2016 at 3:30pm 13 Comments 0 Favorites
Ning 3.0 Tip - Add Buttons/Links Below Status Update (Quick Links to Add Photos, Posts, Discussions)
Started by Themes - Rosas Negras Mar 20, 2021. 0 Replies 0 Favorites
Started by JenSocial. Last reply by Kos Dec 6, 2016. 64 Replies 4 Favorites
Started by JenSocial. Last reply by JenSocial Jul 26, 2016. 41 Replies 1 Favorite
© 2024 Created by JenSocial. Powered by
© Copyright JenSocial.