Hi, I made my home page available to public but I wish to have a different view for public then logged in users.
How would i go about removing latest activity feed on home page if user is not logged in?
Also, would it be possible to remove network description and replace it with different message for those who are not logged in?
Network: ccnapier.ning.com
*edit*
I have found on these forums something that could help me, just not sure how to structure the code correctly. Could anyone help? I would like the module heading to stay, just below it custom html to appear.
The classes and ids that I am not sure about are highlighted in bold.
<script type="text/javascript">
if ((ning.CurrentProfile == null) && (x$(".xg_module_activity").length > 0)) x$("#xg_module_body activity-feed-skinny").html("Sign In to view the latest activity on Creative Computing!");
</script>
#xg_module_body activity-feed-skinny I am pretty sure it doesn't work because this is id and class together... would it be possible to have this sort of condition?
*edit*
Figured it out. I'll leave it here for anyone who might need it. (It hides latest activity on home page in right small column, as well as displays different network description to guests.) Add to custom code.
<script type="text/javascript">
if (ning.CurrentProfile == null) {
x$("div.xg_module_activity").remove();
x$("div.xg_module_network_description").html("Welcome Guest!");
}
</script>
Tags: latest activity, remove
Permalink Reply by Hala Amer on January 19, 2012 at 11:58am Please let me know if you notice it effects feeds to facebook and twitter. I will try it myself but I'm not very saavy technically so I'm sure there is a lot I might miss.
Permalink Reply by Tomas Jurkevicius on January 23, 2012 at 6:08am It shouldn't affect the feed to facebook or twitter because this script doesn't exactly "remove" the latest activity, but rather hides it from guests. (I am guessing as I cannot test this right now).
Permalink Reply by Tomas Jurkevicius on January 20, 2012 at 5:28am "right small column" being the network description module.
Replacing bold part x$("div.xg_module_network_description").html("Welcome Guest!"); with different module name will result in custom message appearing in a different module.
Permalink Reply by Hala Amer on January 19, 2012 at 11:56am You are AWESOME! Thank you so much! I've been trying to figure out how to do this forever :)
Permalink Reply by Debby Bruck on January 19, 2012 at 12:07pm Fascinating idea. Please tell us how this benefits you? I like for the general public to learn about homeopathy as a viable alternative to drugs and medicine. My NING is open only to professional homeopaths, physicians and those in the health fields. So, the general public cannot post comments or post forums, etc.
Having the activity open to only members might encourage members to sign in and participate more or maybe not? Wondering your thoughts?
Permalink Reply by Hala Amer on January 19, 2012 at 12:34pm For me, we are a network of mothers. Some of the information is not a big deal and there are no issues in it being public, and some of it, of a more private nature. Only the main page of the site is public, the rest is private. I leave it so that the main page features/highlights the important aspects of the sites and gives titles of discussions and blogs. If anyone wants to explore further, I like them to be a member, and they are required to sign in. As such, they are bound to our policies and code of conduct. People might want to post pictures of their children or discuss a sensitive topic without having everyone who browses the site see it. Even with the other aspects of the site being private, you could still see everything in the "Latest Activity" module, and all you needed to do was keep pressing the "more" button So essentially you saw everything everyone did. I think it helps make my members more comfortable posting and engaging, which helps create a sense of community for us.
Your site sounds wonderful btw! I have a lot of admiration for homeopaths.
Permalink Reply by Debby Bruck on January 20, 2012 at 10:20am It worked! So awesome. Now we will see what happens. ♥
Permalink Reply by Airwalk on April 2, 2012 at 11:56am Hi Tomas,
I need your help: your script doesn't work for me. There simply is no change. Could you please explain your script step-by-step?
For example your script has the following:
x$("div.xg_module_activity").remove();
x$("div.xg_module_network_description").html("Welcome Guest!");
The "Latest Activity" module is represented by this "x$("div.xg_module_activity").remove();", right? So if I write "x$("div.xg_module_video").remove();" then the video module should be hidden, right?
What does x$("div.xg_module_network_description").html("Welcome Guest!"); stand for?
Please help me because I am a bit lost... .
Many thanks,
Tomek
Permalink Reply by Tomas Jurkevicius on April 2, 2012 at 4:59pm Hi,
First of all, you need to ensure that there is a module name .xg_module_video (it could be called something else). I would try to find out for you, but i don't have an active ning site atm.
The x$("div.xg_module_network_description").html("Welcome Guest!"); is to change network description module into custom text (if user is not logged in, providing your web page is public and has network description module enabled.)
Permalink Reply by Patrick EMIN on September 21, 2012 at 9:37am I find this code much better:
<script type="text/javascript">
if (ning.CurrentProfile == null) {
x$("div.xg_module_activity").html("You should register to get all functionalities");
}
</script>
Margie replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
soaringeagle replied to Alex's discussion 'More styling in the Design Studio'
Margie replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
Thiago Santos de Moraes replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
Cindy replied to Allison Leahy's discussion 'What is your Ning 3.0 URL?' in the group The Sandbox
Kos replied to Allison Leahy's discussion 'What is your Ning 3.0 URL?' in the group The Sandbox
Kos replied to Allison Leahy's discussion 'What is your Ning 3.0 URL?' in the group The Sandbox© 2013 Created by Ning.
