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


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


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

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.


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.


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

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


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

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


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

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

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

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

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

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


2

The WebPart class has properties for background color and background image URL. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart_properties


2

I'm not sure if this will help you, but you can use the RTE without the ribbon controls. We have a public facing site and didn't want to use the ribbon for general users. http://blog.mastykarz.nl/rich-text-editor-control-sharepoint-2010/


2

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


2

Using SharePoint designer you can create an HTML Button in the page and on the onClick event execute a JavaScript function that builds the URL by concatenating the site URL and the value of the dropdown menu (Get it using getElementById() and access it's value). Then you can use window.location.href = url to redirect to another page. Example: ...


1

I worked with custom javascript embedded in webparts and had the same error. Might happen if there´s code overwriting existing methods of SharePoint used Javascript. In my case, it was code adding logic to the array.indexOf, which was not working for IE, so I implemented it myself. But just that was responsible for the error. My guess is, that SharePoint ...


1

I used the following workaround which suits me. I removed the above code from mu custom default page and just left a web part zone: <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Top" Title="loc:Editable Content Top" /> To provision the page with my Content Editor I use the below code behind after my new site is created: ...


1

I actually see two scripts here. The first one is mine and should be fine. The second one seems to try and work with an iframe. This will be an issue if the content of the iframe is not in the same domain as the main page. You're saying that it works with trusted sites, my bet is that you are using Internet Explorer. You won't be so lucky with other ...


1

Here's my working code for SP 2010 for adding text to the existing CEWP. I think it must be identical to the example mentioned above: SPListItem pageItem;// Need to get page SPListItem SPLimitedWebPartManager manager = SPContext.Current.Web.GetLimitedWebPartManager(pageItem.Url, PersonalizationScope.Shared); ContentEditorWebPart contentEditor = ...


1

You can actually do it through the UI, which avoids "customizing" the page. I have an old blog post for 2007, but the process is the same in 2010. Go to your newform.aspx (ie: http://sharepoint.corp.local/lists/mylist/newform.aspx), and append "?ToolPaneView=2" to the end of the URL (ie: ...


1

Have a look at Kwizcom If you want "wikipedia" than you'll probably need to look at mediawiki. There is no direct "integration path" but you could host along side SharePoint, on the same server(s) if you were so inclined.


1

Typically in that scenario, I create custom New/Edit/DispForms for each content type if they need special formatting or display information. The default NewForm is shared by all the content types and is differentiated by query string parameters on what to show when the item is selected from the New list drop down.


1

Here is what ended up finally working: var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \ <soapenv:Body> \ <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \ <listName>Tasks</listName> \ <query> \ ...


1

I second James' suggestion to use SPServices, but I wrote it, so I'm not to be trusted. It looks like you might have "smart quotes" in your query: <FieldRef Name=’AssignedTo’> Make sure those are "straight quotes" instead.


1

You have <div class="image_reel"> But then you try to access element, as if it was id="image_reel" $("#image_reel").append(liHtml); You have to use class as in other places: $(".image_reel").append(liHtml);



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