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


7

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

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

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


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


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

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

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

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

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


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

In order to pull that off in a CEWP, you are going to have to use some combination of AJAX and/or jQuery with the SharePoint Web Services. It's a lot of work. A couple of references related to the search web service: http://msdn.microsoft.com/en-us/library/ms543175(v=office.12).aspx http://www.mosssearch.com/searchwebservice.html


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

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


2

I suspect that you don't see any content because you never show() the slideshowContentArea div (it's hidden by your inline CSS). Add the following at the very end of the processQueryResults method: $('#slideshowContentArea').show();


2

If the code you show in the link is what you've put into your CEWP, I'd expect problems. What you show is a full HTML page, including a BODY tag. You should only include the markup you want. I think that will probably solve the issue. So remove: 2. <!DOCTYPE html> 3. <html lang="en"> 4. <head> 5. <meta ...


2

As, this site is part of the SharePoint portal it is not possible for me to port to a different tool. And, my solution requires to add content types and webparts on the wiki pages. Now, I am following the approach mentioned by Pavan to add a seperate wiki file for your customization ...


2

The Easy Tabs script needs to know which Web Part zone the tabed interface should be applied to. When you drop it in a CEWP, the code assumes that the tabs will be created in the current zone. It also assumes that it runs from within a Web Part (CEWP or other). Its first step is to crawl up the hierarchy to find the Web Part zone. In order to make it work ...


2

From what i can gather, seems like the CEWP has undergone some "improvement" in its 2010 incarnation. One of this "improvement" is that the web part now perform some sort of "screening" on the html source code that a developer may try to insert, often resulting in invalid code without (almost) no warning. Don't know if you are affect by the same issue, but ...


2

This is a really interesting question and I would really enjoy writing up a script for you but this would take me a pretty long time. So I will have to stick to giving you some general advice on how to do it. Using PowerShell List item Check out the page. Download the page to the local FS. Using Get-Content or similar scrape the page for URLs inside the ...


2

Yes, you do need to add a reference to SP.js <script type="text/javascript"> window.onload = function(){ ExecuteOrDelayUntilScriptLoaded(ViewItem, "sp.js"); }; </script>



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