Hiding Link In SharePoint Quicklaunch Based On Permissions - javascript

I am trying to figure out a way to hide a specific link from the Quicklaunch navigation bar on one of my sites in SharePoint 2013 and am having some trouble. Basically I am trying to make it so that a link is only visible to users within a specific group and any other users that are not part of this group will not see the Quicklaunch link. I have been reading up on how to implement this via css and javascript within the default master page but do not seem to be having any luck. I was using SPServices to get the group membership for the currently logged in user and based on there membership either hiding or showing the specific Quicklaunch item. I implemented this code into the master page and I though I had it working, however upon navigating to a different page, list, or library within the site the given link reappears. I do not know if I am doing something wrong but as a last resort I have come here for answers. If anyone could point me in the right direction I would greatly appreciate it.
Bellow is a screenshot to get a better understanding of what it is I am trying to do...

Security trimming should be automatic for the quick launch. Users not being able to see the list, should not see the quicklaunch entry. One thing i experienced in the past is that the security trimming does not work if your quick launch URL looks like this
https://url/sites/sc/Lists/internallistname
but will work if you include the aspx-page
https://url/sites/sc/Lists/internallistname/AllItems.aspx
Don't know about foundation but it's worth a try...

Related

url.split with link created by cms applied to navitagation tab

I am very new to javascript... I would like to know if someone can help me, I have made a navigation tab that I want to be active when I visit a certain url... well, with split I have been able to do it in most of the links that needed...
But the CMS I'm using generates part of that link... and I can't complete the script...
the example of the full link is:
https://www.example.com/shop/index.php?rp=/announcements/1/New-Website-redesigned.html
Well that already with the final result... the problem is that there are quite a few possible results from
https://www.example.com/shop/index.php?rp=/announcements
There are several options to choose from and among those, when you click, it sends to the link above, (eye is content created by the cms) the idea is that the tab always stays active when browsing everything that is announcements and its derivatives. ..
for this i used the following in most of my links.
if(url.split('?')[0] === 'https://www.example.com/shop/supporttickets.php'){
btn1.classList.remove('active')
btn2.classList.remove('active')
btn3.classList.add('active')
btn4.classList.remove('active')
btn5.classList.remove('active')
}
This generally works, but I can't apply it to the example above...

show contents of link

I've been searching the internet to get some information about how i can be able to detect and show what a url is about.
Facebook has a good example of what i actually want to achieve:
If you create a update on facebook and paste in a URL, facebook will detect some information about it and show a box with some text and often the right picture.
for instance, take: http://www.ebay.com/itm/Mens-Monk-Strap-Loafers-Suede-Lined-Metal-Buckle-Slip-Casual-Dress-Shoes-New-/311170422772 . then it shows the image of the shoe and headline.
Ive found other services which does this with image services and youtube, but what i need is about getting information of products most of the time, so often urls from shops. So the user pastes in a url, and i can detect what that link is about.
any ideer how this can be done ?
Is it backend code, like c# or javascript ?
Hopefully some of you can point me in the right direction. Thanks in advance!
Facebook scrapes pages for specific metadata in the back-end and uses it to generate the snippets you see, which can either be served along with the initial page load or brought in via JavaScript (front-end). From there it's a matter of using CSS and JS to style the popup to your liking.
Depending on how inter-related your site is with the content you want to display, this can be an easy task or a difficult one.

How can I disable a website using jQuery or similar?

I have a website that has merged with another. It is a high ranking website so instead of using a redirect or similar I would like to keep the website online as is so that it does not affect SEO.
I want it so that when users visit the website it appears grayed out and a central box is shown with a message saying that the website has moved to www.newsite.com and they are not able to click any buttons etc. on the page.
Is it possible using jQuery or similar?
This is possible with jQuery modal, but to be quite honest your best bet really is to issue a permanent redirect (301) to the new site. You can likewise go to each of the major search engines and use their webmaster tools to indicate the site has moved. Your SEO ranking might dip briefly but the search engines really do recognize the fact that sites and content move these days, and the ranking won't be permanently affected.
You could do this however you like. JavaScript is probably not needed here. Create a simple modal, and style it in such a way that it looks how you have envisioned.
There are jQuery plugins to do this kind of thing, but honestly that's going to be more work to hook up and create more overhead than you would just making your own.
If you need some CSS help to accomplish this, let me know and I'll update my answer.
You can hide Everything in body and append a div and style it like an modal or something as you like
$(document).ready(function(){
node = $("<div id='modal'>Site has been Moved moved etc.. </div>")
$("body").append(node);
$("body *").not("modal").hide();
});
css
#modal{
/*style modal here */
}
Doing what you say will likely damage the SEO, however is possible with some simple css an jquery as long as the user has scripting active. CSS and HTML can achieve the majority of what you want without the need for Jquery or scripting.
A properly implemented 301 redirect will ensure google maps across and acknowledges the movements of pages from one domain to another. BUt you need to do this properly.

How do I handle a large amount of user comments being displayed in a long list down a page using JQuery?

I'm wondering if doing this along in JQuery would be stable enough? or if it would need to be done in ruby/rails first?
Either way I don't want a butt load of messages being loaded when a user enters the page where they're displayed. What I want is limit results to a specific amount then either have the page load more results when a user scrolls down or have them click a "load more" button similar to how it's done on both facebook and googleplus.
Currently I have comments scrolling down my page for miles and would like to use jQuery to take control of this. I'm guessing since each comment is stored in a div / class I could use this as a way of recognising what a comment is.
Anyway trying to figure out the best way to approach this I'd really appreciate some advice and maybe links to some good tutorials on how to pull this off.
I agree with the Ohgodwhy's comment - use will_paginate in Rails.
However, I'd also look at how to do scroll-down pagination, rather than page number links, depending on your design. I like Ryan Bates's screencast on this topic: http://railscasts.com/episodes/174-pagination-with-ajax
He also has a video for doing it without will_paginate: http://railscasts.com/episodes/114-endless-page (the newer, revised version of this requires a subscription).

Use jQuery to append star to menu item if the linked page's content has changed since last visit

I would like to create a similar effect to Apple's Safari 4 Beta Top Sites page -
when when you view it and a page's content has changed since you last visited, it displays a blue star in the top right hand corner to notify you.
I would like to do the very same, but only within my website and instead of an image I would like to append a '*' or some other character to the menu item's link.
I'm sure you would use the jQuery Cookie Plugin, but my scripting is not that advanced and I do not know how to dynamically change the cookie's content. Have I explained properly? How would I do it?
Many thanks in advance
Server side:
Read the website f.ex every minute and save the timestamp if changed content.
Save the users' visit timestamp to the page
Ajax:
Check if the websites update timestamp is newer than your visitors' timestamp, if yes make the star class visible, when the user clicks on the link, make the star disappear and update the users timestamp.
--
Showing a star or an image or whatever with Jquery is not the big deal here, it's a oneliner, the complex problem is to detect website changes, because minor changes can occur, but the main content could not change. The easiest way to do this would be if the website provides rss, then there's probable that the important new content will be published via rss.
You're asking a very vague question. Have you even attempted this? Please try it first then ask for help along the way.
Also, this is not something you necessarily need jQuery for. You could do it completely on the backend. But it's hard to say which solution is best for you without know anymore details.
I guess I would recommend using php and storing the cached page into a db (in other words the user would have a "fav pages" account) then when the user visits the "fav pages" webpage, you would fetch all the users favorite pages and compare it to what has been stored in the db. But for certain pages (for example if they have a date/time string), it would be very difficult to tell if the change was something the user wants to know about. Probably you would need to create a complex algorithm to decide what change is good change and what change is just certain website features.

Categories

Resources