Tag Info

Hot answers tagged

8

Yes you can. The contents of a Content Editor Web Part (CEWP) are stored like any other web part - in the web part properties. You can see this if you Export the web parts .dwp file and open in a text editor, you will get something like <?xml version="1.0" encoding="utf-8"?> <WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...


8

For testing purposes, try putting your html file in a document library in your portal and reference it in the CEWP from there. Eg: http://my.portal.org/Shared Documents/myfile.html If this works, then I am guessing it is an authentication issue. Try replicating the issue in Firefox. If it is indeed an authentication issue, you will be prompted for ...


5

I found Amal Hashim's blog post: Javascript Detect SharePoint Page In Edit Mode There are different approaches for pages, wikis and publishing pages. I combined them into one helper function: function isEditMode() { var publishingEdit = window.g_disableCheckoutInEditMode, form = document.forms[MSOWebPartPageFormName], input = ...


5

Customisations to the Data Sheet View are not supported, as this is generated using the Microsoft Office Access Web Datasheet Component, which renders the grid using the same base engine as the data sheet view that Microsoft Access uses.


4

As Eric mentions, your requirements may drive you in different directions, but you could also use some script in the CEWP to determine whether it should show itself or parts of itself. The security vs. obscurity question will determine whether script is an acceptable approach.


4

Like you mentioned, audience targetting would be the route I would take. Instead of using a content editor web part though, I'd probably use a link list with the items being either audience targetted, or have item level permissions applied. The choice is yours depending on if you just need targetting or actual security.


4

Basically, it can be done with css with header and table changing: .s4-wpTopTable { background: #FEE; } .ms-WPHeader { background: #FEE; } If you want to apply this to particular web-part, you can add additional css-marker class on you web-part render methods to find you web part instance later or use js/jQuery-client bases techniques to apply/change ...


4

For this you can use the Chart.js At first create a canvas Element: <canvas id="myChart" width="400" height="400"></canvas> Then parse your list for example with REST with jQuery: var urlQuery = "https://www.url.i/site/_vti_bin/ListData.svc/ListA"; var teamA = 0; var teamB = 0; var teamC = 0; $.getJSON(urlQuery,function(data) { ...


4

In addition to Milind's answer: it is not good practice to put html directly into the CEWP just because you can. For one, it will only work on some kinds of pages. Web part pages are fine, wiki pages will chew the html. Secondly, it will be hard to maintain, since you will need to edit the web part itself every time you want to make a change. As an ...


4

Edit the page in Advanced Mode (from Sharepoint Designer). If the button "Advance Mode" is grayed, you need to enable "Enable Detaching Pages from the Site Definition". You can find this setting on the site in the section "SharePoint Designer Settings" (http://site-name/_layouts/15/SharePointDesignerSettings.aspx)


4

Like Amal said, it's not easy with CSS, because FontAwesome already uses :before and :after. One possibility is to solve this with JavaScript on runtime. Try something like this: function AppendMenuFontAwesomeIcons() { var elements = document.querySelectorAll('ul[id^=zz][id$=_RootAspMenu] li span.menu-item-text'); for (var i = 0; i < ...


3

I'm sorry if I'm stating the obvious here... but you are clicking the Source Editor button and not the Rich Text Editor button when editing the Web part aren't you? For SP2010, see: http://sptwentyten.wordpress.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp


3

I would use a CEWP with a custom jQuery script. your jQuery script registers onclick event handlers on each item in the LVWP. onclick, you can then insert a youtube video inside a placeholder in your CEWP using parameters from the item you clicked.


3

I think the warning displays universally -- just to let you know that something may have changed whether you actually changed the content or not. It even displays when you simply click ok after opening the form. When it actually changes the source is when you use something that it doesn't like. For example, if you put the bold tag around content, it will ...


3

I would go with either a .png or a .jpg for the image. To be honest, I'm a little surprised the .pdf worked at all when using it as an image. I think exporting it to one of the other formats (png/jpg) would get you better results.


3

Why are you combining jQuery and old-fashioned IE-only DOM code? Try this: <script type="text/javascript" language="javascript"> function CurrentReport() { var link = $(".ms-vb-icon:first a").attr("href"); return "https://intra.sse.gov.on.ca" + link; } $(document).ready(function(){ $("#EPMReport").attr("src",CurrentReport()); ...


3

Why not put an HTML element into your CEWP: <div id="myDiv" /> and instead of document.write(), use something like: document.getElementById("myDiv").innerText = "my message"; Note that this might have problems with multiple instances of the web part on one page (i.e. multiple elements with id 'myDiv')


3

You would need to store that content in a Document Library somewhere and simply use the Content Link to point to that .js file from the Document library. It is some kind of security measure introduced in the SharePoint 2010


3

Note that height 100% means take up 100% of the height of the parent element which may have a static height set and not use the whole page. You can use F12 on IE to bring up the developer toolbar to track down which parent element is limiting the height. Then create a script and/or CSS style to override the specified height like what was done here Setting ...


3

The options at your disposal depend on if you are running the Enterprise SKU or one of the supported O365 plans. Generally speaking - if you are using Page layouts you already have Publishing Features Enabled (however since we may also be talking about web part pages I'll cover both) You have the option to use the Design Manager functions for publishing ...


3

If you are using the enterprise version and using the publishing features, there is a list that gets created automatically called Reusable Content. This allows you to create text/html snippets that can be used in any publishing html rich text fields or added via web part.


3

Assuming you mean the metro style icons then you can override the default CSS to make them a different colour. <style type='text/css'> div.ms-tileview-tile-content { background-color: red; } </style> Add a CEWP to a page and edit the source. Paste in the above and set the colour as you want it. I would also suggest you hide the CEWP.


3

You can add script in Content Editor WP, to open the page as dialog, Load first SP.js and add following script ExecuteOrDelayUntilScriptLoaded(function () { var dialogurl = "your url"; var options = { url: dialogurl, width: 700, height: 700, dialogReturnValueCallback: OnDialogClose }; ...


3

I don't know about you guys but on my CEWP if I do the following, I can enter an HR tag without moving to the html view: Type some dummy text Click the area where we want the line In the ribbon, pick Editing Tools > Format Text > Markup Styles > Horizontal Rule We can even customize the look and feel of the line with CSS using hr.ms-rteElement-Hr


3

As Pradip has already told the reason for this behaviour I won't repeat it here again. But there are a couple of things you can try. Have a look at this article, Inconvenient Content Query Web Part and server-relative URLs, which suggests - Another way to get around this issue is to use a Feature Receiver. After activating the Feature that provisions ...


3

You can access the Site's Property Bag using the JavaScript Client Object Model. Here's a walkthrough: http://www.jeremythake.com/2013/10/using-the-sharepoint-csom-api-to-get-a-property-bag-value/


2

Although this post is quite old, this answer might help the ones who are searching for this functionality. In a list view grouped by Status column, where Active status should be expanded and Closes Status should be collapsed: Using IE developer tools or Mozilla Firebug, locate the (html element) image ID for the collapse-expand image (the '-' image). You'll ...


2

This happened again recently when trying to use the CEWP for some inline style code to hide the QuickLaunch. It changed the code so horribly that it wouldn't execute. This article helped me immensely: http://sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=676af157-7d96-4e15-a987-54b8a3e4d948&ID=64


2

Theres some security issues here to consider as well. Say we had the option to insert (and hence upload) images using copy/paste, where would these pictures reside? The fine grained security model of SharePoint give administrators the possibility to delegate security related tasks, such as being responsible for uploading corporate approved images. In other ...


2

There is probably an error in the code which the CEWP is unable to save. You could save the JavaScript functions in another file and reference that file instead of placing all the code in the web part. You'll still need to debug it, but at least you'll be able to save the web part with just the script references and the call to the function. Another option ...



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