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

Sometimes you may want ADs or special contents display in the main page, profile pages or any other pages only. It's easy to display contents only in main page. Because you could add a text box that only show in main page. But how to control contents only display in profile pages but not in main page and any other pages? And how to control contents display in every pages except the main page and profile pages? Actually it's very easy. You just need a little CSS. 

 

Here are the steps:

1. Add a text box for all pages.

2. Edit the text box in HTML mode, put all content/ad inside a div tag with a special unique id:

<div id="ad_sidebar01">
.... Your content or ad code here .... 
</div>

 

3. Go to the Advance CSS, add this CSS code if you don't want it display in the main page but any other pages:

.xg_widget_main #ad_sidebar01 {display:none;}

 

Or this CSS code if you don't want it display in all profile pages:

.xg_widget_profiles_profile #ad_sidebar01 {display:none;}

 

If you add both, the content will display in every pages except the main page and profile pages.

 

4. If you want it display in profile pages only, use this code:

#ad_sidebar01 {display:none;}
.xg_widget_profiles_profile #ad_sidebar01 {display:block;}

 

Remember to replace #ad_sidebar01 with yours.

 

 

 

This tips is tested with both Design Studio and old themes.

 

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at iYouMe.net.

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

Join Ning Creators Social Network

Votes: 0
Email me when people reply –

Replies

  • NC for Hire

    Good Lord. This is brilliant. I use scripts to do this sort of thing, and here I'm supposed to be the CSS person. Alex, I am blown away with the simplistic yet genius thought process behind this.

    SUPERB thinking!

    Jen

  • NC for Hire

    Wow, I left a comment the other day Alex, and it disappeared. Not sure how I did that, LOL. I think this is what I said, since I said about the same on my site:

    Good Lord. This is brilliant. Alex, I am blown away with the simplistic yet genius thought process behind this.

    Best Regards,

    Jen

  • NC for Hire
    Awesome.
  • Hi Alex....I take it you have to edit the text box in the member profile page if you want the content to appear only in member profile pages? Thanks

    • Hi, if you want the content to appear only in member profile pages, you need to put a text box FOR ALL PAGES FIRST. That means put a text box in main page, and the place of text box can let it be displayed for all pages. Edit it, add div tag and classname. Then add the right CSS in step 4. :)

  • Hi Alex,

    I've seen some discussions around the net about whether or not its against Google Ads' Terms Of Service to hide ads.  I believe it may be.  Advertisiers pay for served ads and don't want them hidden.  People should look into Google Ads' Terms Of Service before doing anything to Google Ads with jQuery, js, or CSS.  Of course I'm not a CSS pro so maybe what I'm seeing in your post is not the hiding of ads, but to my mediocre eye on CSS, it looks like it is!  Just my opinion on Google Ads, I may be wrong but may be worth looking into as I hear Google has no problem deleting people's Adsense accounts at the drop of a hat.  Other Ad servers may or may not have a problem with hiding ads.  Great tip, easy to implement, very well explained!  Just makes me a little nervous, and again, just my opinion.

    Best wishes!

    "TJ"

     

    • Thanks so much for your advice, TJ. I didn't know that Google AD has terms like that. I'm not sure if I use a Google AD I have to display it on all pages in my site? Do I have the right to control which pages and where to display the AD ? I am not hiding it all.

      But I'll pay more attention about what you said. So thank you again. :)

       

      Alex

      • Hi Alex!

        Here is more information on Google Ads.  Your tip is very useful for many different kinds of content, but in my opinion, based on the Google Adsense Terms of Service, which I shall copy and paste right in here, it is a violation if someone were to use your code with Google Ads.  Yes, you can control what pages show Google Ads, but the right way to do that is to just put the Adsense code on the pages you want to show ads on.  You can't, in my opinion after reading the TOS, use CSS to hide an ad that Google thinks and expects to be showing to the visitors of a particular page.  Google has no idea you are hiding their ad.  They may be collecting money from an advertiser who thinks and expects that his ads are showing on any page that a person put the ad code on, because Google considers it a display of an ad once the js code runs.  If you hide that ad, then in my opinion, that breaks Google Adsense TOS.  So here is what it says, I have added BOLD to some words near the end...:

         

        5.      Prohibited Uses. You shall not, and shall not authorize or encourage any third party to: (i) directly or indirectly generate queries, Referral Events, or impressions of or clicks on any Ad, Link, Search Result, or Referral Button  (including without limitation by clicking on “play” for any video Ad) through any automated, deceptive, fraudulent or other invalid means, including but not limited to through repeated manual clicks, the use of robots or other automated query tools and/or computer generated search requests, and/or the unauthorized use of other search engine optimization services and/or software; (ii) edit, modify, filter, truncate or change the order of the information contained in any Ad, Link, Ad Unit, Search Result, or Referral Button, or remove, obscure or minimize any Ad, Link, Ad Unit, Search Result, or Referral Button in any way without authorization from Google;....

         

        This is found at this link:

        https://www.google.com/adsense/localized-terms

         

        I am not a lawyer, but in my opinion, it is clear to me that removing a Google Adsense Ad with CSS is a violation of their Terms Of Service.  Others may come to other conclusions.  But there is potentially big money at stake for some Network Creators who rely on their Google checks.  So I thought it would be good to have this information here for all to read and contemplate.

        Best wishes to all!

        "TJ"

         

        • Thank you TJ for sharing so much useful info and your opinion.  Really Help. We face the situation is we have template system, we have to do like this because we can't edit page by page. I don't know how google will think about this. I'll ask them.

      • NC for Hire

        Hi Alex,

        I agree with TJ, you can't hide Google Ads without going against their TOS. But, what you're doing is just a method of showing or not showing content. I think you just happen to choose Google as part of your class name, since the sidebar is often used for Google Ads. Your method is great. I would just change the class name. Then the tip is not related to Google Ads. In fact, I didn't even see the Google part, I was so impressed with the idea. ;-)

         

        I'm just offering humble suggestions Alex, not my business really.

         

        And agreeing with TJ again, yes you can decide where you want to show your own Google Ads.  That is totally your decision.

         

        Best Regards,

        Jen

This reply was deleted.
 

Some interesting articles related to community management, digital marketing etc. could be found in our digest. Don't hesitate to leave a feedback so we would know that we should continue :-)

Latest Activity

Ron updated their profile
28 minutes ago
⚡JFarrow⌁ replied to ⚡JFarrow⌁'s discussion
Style Hack: How to Have Different Backgrounds for Different Groups
"still love this hack"
10 hours ago
Alina Langley replied to Suzie Nielsen's discussion
Ning 2.0 For Sale
"Do you atill have a NING 2.0 site? I am looking for one, please DM me :)"
Apr 12
Alina Langley updated their profile photo
Apr 12
Alina Langley updated their profile
Apr 12
LEO Mobile App Builder updated their profile
Mar 26
Aase Lillian replied to Aase Lillian's discussion
Community - activity page
"Ok, thank you. Please send me details as I have no idea on how to do it. "
Mar 19
Aase Lillian and ⚡JFarrow⌁ are now friends
NC for Hire
Mar 19
⚡JFarrow⌁ updated their profile photo
Mar 18
⚡JFarrow⌁ replied to Aase Lillian's discussion
Community - activity page
"Yes you can add emojis to your community pretty much anywhere you like.
If you need some help…"
Mar 18
Aase Lillian updated their profile
Mar 18
Aase Lillian posted a discussion
Hi all. Is it possible to add emojis to the community? I also wish the activity page to include…
Mar 18
More…

Meanwhile, you can check our social media channels