Tag Info

Hot answers tagged

4

You can't change the .master file when it's bound like this, you can only edit the .html file. It will re-generate the .master when you save the .html. This is due to the Design Manager packet in SP2013. Here's the MSDN article on this feature set: http://msdn.microsoft.com/en-us/library/office/jj822363(v=office.15).aspx


3

1)Register ngSanitize module: Add reference to angular-sanitize.js resource, for example: <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-sanitize.js"></script> Include ngSanitize module, for example: var app = angular.module('SmartphoneOSList', ['ngSanitize']); 2) Replace the line: ...


3

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


2

you can use the below css code for background image: background-image: url("Image.jpg"); background-repeat:no-repeat; background-position:top; background-size:cover;


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

try using the below script in CEWP: <a onclick="modalcall()" href="#">Add New Item</a><script type="text/javascript"> function modalcall() { SP.UI.ModalDialog.showModalDialog({ url: "NewForm.aspx", title: "New Item", //allowMaximize: true, //showClose: true, dialogReturnValueCallback: ...


2

You can do it as <img src='<SharePoint:EncodedLiteral runat="server" text="<%$SPUrl:~site/Shared%20Documents/enddate.png%>" EncodeMethod="HtmlEncode"/>' alt="" />


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

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 ...


2

Here's the "oldschool" way of doing it, which hopefully works accross all browsers. In theory you would use setAttribute unfortunately IE6 doesn't support it consistently var cssId = 'myCss'; // you could encode the css path itself to generate id.. if (!document.getElementById(cssId)) { var head = document.getElementsByTagName('head')[0]; var link ...


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.


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 ...


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

This is the jQuery expando attribute, it's a bit random because it's generated on page load, it's "jQuery" + (new Date()).getTime() (to avoid possible naming conflicts) but you'll notice the attribute is the same for all elements. This is they key in $.cache for the element's events and data...it's stored this way for a few reasons, the main is to avoid ...


1

HTML text is coming because the fields are HTML enabled. You can use below code to strip html tags answer.InnerText = Regex.Replace(answers[index]["Answer"].ToString(), @"<[^>]+>|&nbsp;", "").Trim(); Do the same for questions


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

This is expected when you create a custom editform, and changes to the underlying list structure like fields being created manually or via a content type do not show up. They must be added manually in the custom form. Sharepoint has behaved this way since 2007 that I know of, and presumably in 2003 and 2001. You are essentially breaking the dynamic ...


1

I have modified the function and split it into 3 functions. I have not tested this code, but based on my past similar experience this can be the solution. 1. Create a table structure with tr inside it. //Create a table structure with rows having id = version id of an item function createVersionTable() { var tr = []; for (var i = 0; i < ...


1

Try below. I have used the $.when(Deferred).done(whatever here); function YourFunctionName(){ var tblBody = ''; var Callback = function(){ for (var i = 0; i < xArr.length; i++) { tblBody += "<tr>"; var xDiv = $("<div>"); xDiv.load(xAppWebUrl +"/Lists/dlWerkinstructies/Forms/DispForm.aspx?ID=" + xItemId + ...


1

SP.UI lives on another file, that is sp.ui.dialog.js You need to add it to the script references <script type="text/javascript" src="_layouts/15/sp.ui.dialog.js"></script>


1

You can use the Design Manager. Import the html file as a page layout. Choose the page layout to be of type Welcome Page. Now you can create a new Page in SharePoint and set it as the home page.


1

You may put your HTML file and its resources in a basic document Library. In SharePoint, any file can be stored in a doc lib, event HTML code, like HTML pages, CSS files or JavaScript code. SharePoint itself stores (some of) its own aspx, CSS files, etc, in document libraries. Once your files are all in the doc lib, clicking on the HTML file would simply ...


1

Use Iframe and reference the -tag to a url in a document library that contains your files yourhtml.aspx, yourjs.js, yourrcss.css. Get your references to scripts and css correct in yourhtml.aspx. Then just: <iframe src="https://yoursharepointurl.com/documents/yourhtml.aspx"></iframe> Use script editor web part, or content editor pointing to a ...


1

You can use script Web part and insert a tag style .ms-headerSortArrowLink{visibility:visibility !important; } The important should override the in line style


1

You can use SPServices jQuery Library and CAML query to get data from a SharePoint List and display that retrieved data in Content Editor Web Part where you would write your html table code. To learn more about SPServices refer this: SPServices CodePlex Before writing the below code in Content Editor Web Part make sure you download jquery-1.4.2.min.js from ...


1

If you can grab the offending NOBR element via JavaScript, you can then hide it and insert a less offensive element adjacent to it with the same (or modified) HTML content. // 1. grab the NOBR tag via CSS selector var nobr = document.querySelector(".ms-standardheader.ms-WPTitle nobr"); // NOTE: Replace above CSS Selector with one that grabs the title of ...


1

you could use PACE indicator to have the progress of the web page rendering which is nothing but a js which is used to present the rendering of pages but the disadvantage is that it will not work with older android OS. There are various types like loading,center fold etc.


1

It cannot be done in workflow alone AFAIK since WF 2013 doesn't allow you to have custom code in it. Actually, this is not entirely true because you can create custom activities, but this is not preferred way. You should create web service which implements the conversion (http://stackoverflow.com/questions/286813/how-do-you-convert-html-to-plain-text) and ...



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