Hot answers tagged

8

Check http://sharepoint.stackexchange.com/a/52877/35604: <script type="text/javascript"> function Custom_Submit(command) { SP.Ribbon.PageState.Handlers.showStateChangeDialog(command, SP.Ribbon.PageState.ImportedNativeData.CommandHandlers[command]); } </script> <input type="button" ...


7

There's not a huge difference for all of them. 3 out of 4 of them are server-side controls. And the SharePoint:InputFormTextBox and wssawc:InputFormTextBox are the exact same, only the prefix namespace (i.e. SharePoint, wssawc) is the difference. SharePoint/wssawc:InputFormTextBox has built-in co-operative field validation, the others don't. That's the ...


5

Add an id: <pre id="myId" .... And then hide it with jquery: addNewTest = function() { $('#myId').hide(); }); or without jquery: addNewTest = function() { document.getElementById('myId').style.display = 'none'; });


4

You wanna target the specific webpart where you wanna change the link color, otherwise every link on the page will change font color. Use F12 Developer tools to find the ID of the specific webpart you wanna change the link text for. Insert the name/ID instead of my example (#WebPartWPQ5) and then use the CSS i provided below (SP2013). <style ...


4

Find id of that WP. Something like WebPartTitleWPQ4. Edit that page and insert script editor WP and add <style> <style> #WebPartTitleWPQ4 h2 { background-color: #000; color: #fff; } </style> EDIT Find where is title. For ex. <style> #WebPartTitleWPQ4 h2 { background-color: #000; } #WebPartTitleWPQ4 h2 span { ...


4

A ductape patch is adding a negative margin-top <div style="margin-top:-200px"> YOUR CONTENT </div>


3

You are using jQuery already, so rather than use the regular onClick, can you take a different approach altogether, and use jQuery to wire up a click event handler? That way you can call your function like you do in line 649. I'm thinking a different approach like this: $("#head"+i).click(function(e) { startWorkflow(id, anbieter); ...


3

You should be able to insert your HTML code in a copy of the default master page you are already using, download it locally and and then publish it and set it as masterpage for your sites using O365 dev PnP Powershell cmdlts. As i'm not using O365 myself i haven't been able to try it out but should be doable. OfficeDevPnP.PowerShell Commands There are ...


2

I tried it now in SharePoint 2013 and with SharePoint Designer. First you have to do the steps Amit described here: show-list-fields-side-by-side Open the site which contains the list in SharePoint Designer 2013. Select the List from List and Libraries section. Select your list. Under the forms section, click on New. On the popup, provide your form name ...


2

No jQuery and easier to continue with var names=document.querySelectorAll(".ms-subtleLink"); names.forEach(function(name){ var fullname.innerHTML; //change fullname your way name.innerHTML=fullname; });


2

There is no issue with the equals sign, the issue is with the ampersand, that has to be escaped as &amp; http://stackoverflow.com/questions/1328538/how-do-i-escape-ampersands-in-xml There are 5 characters that need to be escaped in XML: " &quot; ' &apos; < &lt; > &gt; & &amp; ...


2

Use SharePoint Designer to update files. Open your uploaded files in SharePoint Designer, Update it and save. No need to manually upload it again.


2

HTML: <div id="wrapper"> <div class="float left">left WP zone here</div> <div class="float right">right WP zone here</div> </div> <div class="bottom">bottom< WP zone here/div> CSS: #wrapper {width:600px; height:300px; position:relative;} .float {background-color:black; height:300px; margin:0; ...


2

There is an WebPart called PageViewer-WebPart you can use for this purpose. Here's some reference for that: https://support.office.com/en-us/article/Display-a-Web-page-on-a-SharePoint-page-by-adding-the-Page-Viewer-Web-Part-7f61feec-9b3d-4805-a960-07636ba59527 You may have to take care of the 'SAMEORIGIN' security, but there are a lot of references on how ...


2

I would suggest to use a simple IDE to develop your code. This IDE will help you by finding simple errors. A free example for a IDE is Visual Studio Code but there are loads of IDE's for you to choose. Here's the output if I paste your code: After knowing the simple errors fixing is not the problem - at least the ones caused by bad syntax.


2

Depending on what you are using the html files for, you can try changing the extension. For example, call a file content.html.txt. One thing I store html files for is to link them to content editor web parts. In that case the extension doesn't matter.


2

You need to render the rich text. Just add STSHtmlDecode like in this example. <div id="trimmedDetailsDiv" class="newsListItemBody" style="padding-right: 0px; color:#656565; font-size:15px; padding-bottom: 25px;"> _#= STSHtmlDecode(shortDescription.value) =#_ </div> SharePoint 2013 - Working with Display Template for Content Search Web ...


2

This site allows you to create a timer, then it outputs the code for you. You can edit as needed.


2

I'm using this: <script type="text/javascript"> var loginName = ""; var userid = _spPageContextInfo.userId; GetCurrentUser(); function GetCurrentUser() { var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")"; var requestHeaders = { "accept" : "application/json;odata=verbose" }; $.ajax({ url : requestUri, ...


2

This is an XML Namespace definition. In this case, SharePoint has defined an XML Namespace with both its prefix and URN set to "ie". In the interests of not duplicating information, I've added some links from within StackExchange that provide a good understanding of what you can do with XML Namespaces: ...


2

Ok, here's what's happening: // select ALL elements that are .block .title h2 span and loop through them $(".block .title h2 span").each(function(index) { // find the length of the text of THIS PARTICULAR element var x=$(this).text().length; // if the length of THIS PARTICULAR element is > 29 if(x > 29) { // change the ...


1

The link you refer has your answer, with only a small tweak, if you are in SP2013. Your url should be as follows: https://yoursite/_layouts/15/Upload.aspx?List={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} Note that 2013 uses /_layouts/15/Upload.aspx, whereas 2010 used /_layouts/Upload.aspx. You can get your library guid by going to the list settings for the ...


1

I'm afraid there is no other way than updating all the htm files. In SharePoint relative paths does not work that way, even if index.htm resides inside the Library.. href='page1.html' would simply mean rootsite/page1.htm Not even the inner site collection will be placed, that means if you have rootsite/sites/innersite/library/page1.htm and you refer it as ...


1

Maybe you can use the BASE tag <head> <base href="[url]"> </head> http://webdesign.tutsplus.com/articles/quick-tip-set-relative-urls-with-the-base-tag--cms-21399 http://stackoverflow.com/questions/1889076/is-it-recommended-to-use-the-base-html-tag


1

Here are the sites you may want to read: CSR - Client Side Rendering The SharePoint 2013 programmers way http://www.viewmaster365.com/#/How Yes you can display HTML/Javascript without the need for CSR, in a Calculated Column How to use Today and Me in Calculated column How to display Today calculations in a View with JavaScript in Calculated Column (or ...


1

Code given in the below link demonstrates how to get the current user name by using simple CSOM, http://www.enjoysharepoint.com/Articles/Details/get-current-logged-in-username-in-sharepoint-2013-using-javascript-20982.aspx


1

I figured it out myself Title Search: <input name="Title" type="text"/> <a onclick="location.href=this.href+Title.value;return false;" href="/sites/203/qaos/bp/Lists/Process%20Tickets/AllItems.aspx?View=&amp;SortField=ID&amp;SortDir=Desc&amp;FilterField1=LinkTitle&amp;FilterValue1="> Image</a>


1

JavaScript Object Model can be very easily used to get the current user. // Getting current user detail function getCurrentUser() { try { var clientContext = new SP.ClientContext.get_current(); var tempcurrentUser = clientContext.get_web().get_currentUser(); clientContext.load(tempcurrentUser); ...


1

The Html file is being used by Design Manager, and created as when you activate Publishing Infrastructure Feature. Html file doesn't come with team sites template. Update after your comment: It is something that you should decide at top level site of a new Site Collection, whether or not the publishing feature will be needed within that Site Collection ...



Only top voted, non community-wiki answers of a minimum length are eligible