#StackBounty: #2013 #javascript #jquery #navigation #top-link-bar No Masterpage/CSS Access. Need to programatically set up drop down me…

Bounty: 50

First off, my limitations. I do not have access to the master page(s) or global css (either using SPD or not…). Nor do I have the ability to use managed or global navigation. This is a Team Site and Publishing Features are locked down so I cannot turn them on. So the site in question only has access to “Top Nav Links” which does not allow drag and drop on the site, or layered drop downs in the site settings. I also do not have access to this particular site collection with PowerShell, so those methods are out.

That being said, I am looking for a way to set up a drop down menu. Methods should be JavaScript/jQuery and CSS and most likely using a SP List to determine what links will be used for the top nav and drop downs. (CSOM and REST methods would also work as long as instructions are clear in snippets)

While annoying, the limitations are prohibitive and as such I realize that I will need to apply the js via a SEWP or via file on a CEWP per page I want this nav bar to visible on.

I have spent quite a lot of time looking this up, but it seems everything is forcing the use of master pages/css or just styles currently existing drop downs.

Anyone have any ideas on how to do this? Code snippets greatly appreciated so I do not need to try and develop this from scratch.

Thanks!

EDIT
I have come up with a partial solution, but need some help in getting the drop down portion working:

https://code.jquery.com/jquery-1.9.1.min.js

function loadBlogs() {
    var ul1 = document.getElementById("zz14_RootAspMenu");
    var li1 = document.createElement("li");
    li1.appendChild(document.createTextNode("Blogs"));
    li1.setAttribute("id", "TNBlogsDD");
    li1.setAttribute("class", "static");
    ul1.appendChild(li1);
    var li2 = document.getElementById("TNBlogsDD");
    var ul2 = document.createElement("ul");
    var br = document.createElement("br");
    ul2.setAttribute("id", "dropList");
    li2.appendChild(br);
    li2.appendChild(ul2);       
    var li3 = document.createElement("li");
        li3.setAttribute("id", "dlItem1");
        var a1 = document.createElement("a");
            a1.appendChild(document.createTextNode("Google")); //Name of Link Location
            a1.setAttribute("href", "http://www.google.com"); //For URL of link
            li3.appendChild(a1);
        ul2.appendChild(li3);
        document.getElementById("ul2").style.display = "none";

    li1.addEventListener("onmouseover", dropListOn);
    li1.addEventListener("onmouseout", dropListOff);
};
function dropListOn () {
    document.getElementById("dropList").style.display = "block";
};
function dropListOff () {
    document.getElementById("dropList").style.display = "none";
};
$(document).ready(loadBlogs);

Any assistance in editing this so Google does not appear initially and works onmouseover and disappears onmouseout would be appreciated


Get this bounty!!!

#StackBounty: #2013 #javascript #jquery #list-view #css Responsive content to list view width in SharePoint 2013

Bounty: 50

When I change the width of a SharePoint list to a certain amount of Pixels, I have the problem that some content of the list gets cut off on the right side – see the following Screenshot:

enter image description here

Is there any trick, that SharePoint automatically wraps text or adjusts the width of pictures (in other words: adjusts the content) to the chosen list width – so that content won’t get cut off?

I unfortunately do not have permissions to use SharePoint-Designer. I am working with SharePoint 2013 On-Premise.


Get this bounty!!!

#StackBounty: #2013 #list #javascript #development #list-view Can i eliminate duplicate items which have the same (Title & Created-…

Bounty: 50

I am working on a custom list inside our SharePoint on-premises 2013. i created the custom list to store the users who access a discussion board items, by following this approach:-

1- Inside the discussion board’s flat.aspx page, i entered the following javascript which will add a new item inside the cusotm list, by passing the item title as follow:-



$(function(){

   var itemtitle = document.title; 
   var withoutflatstring = itemtitle.substring(0, itemtitle.length-7);
   var itemType = GetItemTypeForListName("NewsAnnouncementsLogs");
        var item = {
            "__metadata": { "type": itemType },
            "Title": withoutflatstring 
        };

        $.ajax({
            url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbytitle('" + "News and Announcements Logs" + "')/items",
            type: "POST",
            contentType: "application/json;odata=verbose",
            data: JSON.stringify(item),
            headers: {
                "Accept": "application/json;odata=verbose",
                "X-RequestDigest": $("#__REQUESTDIGEST").val()
            },
            success: function (data) {
                            //success(data);
            },
            error: function (data) {

            }
        });
});
// Get List Item Type metadata
    function GetItemTypeForListName(name) {
        return "SP.Data." + name.charAt(0).toUpperCase() + name.split(" ").join("").slice(1) + "ListItem";
    }

2- then i am interested in knowing the number of users who accessed a specific discussion board item. so inside my list view i chose to do the follow 2 settings:-

  • group the item by title
  • show the count

As follow:-

enter image description here

3- so my list view will show the item title + the number of users who accessed the item, as follow:-

enter image description here

but the only issue i am facing with the above appraoch, is that when the same user access the same discussion board item, 2 items will be added inside the custom list, and the 2 items will have the same title & created by.

but i want the counter which is shown beside the title inside my list view, to NOT count any duplicate items. where duplicates in my case, is any item inside the cusotm list which have the same Created-by & title. so is this something i can achieve ?


Get this bounty!!!

#StackBounty: #2013 #javascript #sharepoint-on-prem Is it possible to progrmamatically edit a Script Editor Web Part's code from th…

Bounty: 100

Is it possible for JavaScript in a script editor web part or a similar web part to permanently edit the web part it resides in?

What I’d like to do is make a web part that when the page is opened in edit mode displays an interface for editing options for that web part.

Then when the user clicks save or in a similar action the web part would save the config choices they made to the containing web part.

Is something like this possible to make client side per web part config possible?


Get this bounty!!!

#StackBounty: #2013 #javascript #sharepoint-on-prem Is it possible to progrmamatically edit a Script Editor Web Part's code from th…

Bounty: 100

Is it possible for JavaScript in a script editor web part or a similar web part to permanently edit the web part it resides in?

What I’d like to do is make a web part that when the page is opened in edit mode displays an interface for editing options for that web part.

Then when the user clicks save or in a similar action the web part would save the config choices they made to the containing web part.

Is something like this possible to make client side per web part config possible?


Get this bounty!!!

#StackBounty: #2013 #javascript #sharepoint-on-prem Is it possible to progrmamatically edit a Script Editor Web Part's code from th…

Bounty: 100

Is it possible for JavaScript in a script editor web part or a similar web part to permanently edit the web part it resides in?

What I’d like to do is make a web part that when the page is opened in edit mode displays an interface for editing options for that web part.

Then when the user clicks save or in a similar action the web part would save the config choices they made to the containing web part.

Is something like this possible to make client side per web part config possible?


Get this bounty!!!

#StackBounty: #2013 #javascript #sharepoint-on-prem Is it possible to progrmamatically edit a Script Editor Web Part's code from th…

Bounty: 100

Is it possible for JavaScript in a script editor web part or a similar web part to permanently edit the web part it resides in?

What I’d like to do is make a web part that when the page is opened in edit mode displays an interface for editing options for that web part.

Then when the user clicks save or in a similar action the web part would save the config choices they made to the containing web part.

Is something like this possible to make client side per web part config possible?


Get this bounty!!!

#StackBounty: #2013 #javascript #sharepoint-on-prem Is it possible to progrmamatically edit a Script Editor Web Part's code from th…

Bounty: 100

Is it possible for JavaScript in a script editor web part or a similar web part to permanently edit the web part it resides in?

What I’d like to do is make a web part that when the page is opened in edit mode displays an interface for editing options for that web part.

Then when the user clicks save or in a similar action the web part would save the config choices they made to the containing web part.

Is something like this possible to make client side per web part config possible?


Get this bounty!!!

#StackBounty: #2013 #javascript #sharepoint-on-prem Is it possible to progrmamatically edit a Script Editor Web Part's code from th…

Bounty: 100

Is it possible for JavaScript in a script editor web part or a similar web part to permanently edit the web part it resides in?

What I’d like to do is make a web part that when the page is opened in edit mode displays an interface for editing options for that web part.

Then when the user clicks save or in a similar action the web part would save the config choices they made to the containing web part.

Is something like this possible to make client side per web part config possible?


Get this bounty!!!