Hot answers tagged

7

Weird, I had this exact same problem yesterday, with the exact same Ribbon command! You basically need to copy the position styles from corev4 into your custom CSS stylesheet, and replace "ms-rte" with whatever you put in the PrefixStyleSheet property. EDIT: Hint - take a vanilla RTE control (remove the PrefixStyleSheet attribute), add an image, position ...


4

SharePoint rich text fields support copy & paste by using an iframe dynamically inserted into the body tag. Manipulating this iframe or any of its content may cause error 800a025e thrown by SP.UI.RTE.debug.js. Searching through SP.UI.RTE.debug.js for "pasteDiv" should help you debugging this issue, as the inserted iframe contains a DIV with id ...


4

Not really but it depends on for what you want to use it. I have used in the past the Telerik RAD Editor in a large environment (>10.000 Users) http://sharepoint.telerik.com/aspnet-ajax/web-parts/Pages/Content-Editor-Web-Part-using-RadEditor.aspx This is the most popular SharePoint HTML Editor on the market. But the users where also not happy with it. The ...


3

Use a Custom Action with Location="ScriptLink" and inject jQuery/JS on the fly, which hides or uncheck the button by default


3

It is probably due to the fact that you already have a site content type in use that you want to add the column to that content type. You need to add a new content type and add it in place of the old one as described here. You also should be able to add it programmatically through C# (which can be translated to powershell) described here. SPSite ...


2

I created a little script to put focus where I wanted it on opening a publishing page in edit mode. The code is: function waitUnitStuffIsLoaded() {setTimeout(function(){refocus()},1000);} function refocus(){$("input[Title='Title']").focus();} SP.SOD.executeOrDelayUntilScriptLoaded(waitUnitStuffIsLoaded, "sp.ui.spellcheck.js"); ...


2

Sorry for replying with answer after long time. I wondered when I saw there is no answer to this question. So decided to do self-reply to this question. After lots of brain storming I get to know there was silly mistake I did in feature receiver. When I debug application I come to know that I was getting null values from site column properties. Then I placed ...


2

For SharePoint 2010 you could create a custom action to add a button to the ribbon which opens a new page to paste you source code into. Once the user closes the window some Javascript wraps the code into the pre tags and inserts it at the position of the cursor. UPDATE: You could use combination of the zoombldr.aspx page (used to edit the HTML source) and ...


2

Use another CSS selector, such as div[class*="sbgElement-Bump"]:first-of-type.


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

Used PowerShell to create my columns the way I wanted. Add-PSSnapIn "Microsoft.SharePoint.Powershell" #Get the site collection and web object $siteColl = Get-SPSite -Identity "http://sitecollectionURL.com" $rootWeb = $siteColl.RootWeb #Assign fieldXMLString variable with field XML for site column $fieldXMLString = '<Field Type="HTML" ...


2

I found a property named AllowInitialFocus on BaseFieldControl which RichHtmlField is derived from (couple of levels down). It's protected virtual and always return true according to MSDN documentation. I had to override the control to make it return false but it seems to do nothing :( Only solution I can think of is override the JavaScript setting the ...


2

How did you try to override the JavaScript? (I'm writing this because HasInitialFocus hasn't worked and is the obvious answer, although maybe could set it on another field, the first field instead as true?) I would add and try this: $('document').Ready(function() { $('#someother_element').focus(); }); This should work.. Otherwise run up Chrome, and ...


2

Apparently it was far easier than I expected... item.FieldValuesAsText[FIELD_NAME] instead of item[FIELD_NAME] So... string businessCase = item["Business_x0020_Case"] != null ? item.FieldValuesAsText["Business_x0020_Case"] : string.Empty;


1

The "PublishingWebControls:RichHtmlField" control is capable of rendering field data, not web parts -- I think this is where the confusion is coming from. In my experience, the data coming from code-behind vs. declarative have been the same.


1

This can happen if you copy and paste text into the Content Editor Web Part. I could not tell you why but sometimes when you do this it will create new web part ID's in the Source Code. I would recommend checking the Source of the content editor web part for any additional ID's added to DIV's. You should be able to remove those to stop the javascript errors. ...


1

You mentioned "date-range" - why not creating a new Custom list (either backed up by a custom Content Type or if you use in a single list, then simply create appropriate columns on the list) having multiple "DateTime" fields (which allows also selecting just Date not only Date & Time) which enable users via a Calendar to select dates. You could also use ...


1

If you simply have location as city then you can have a list for location information. If you are talking about having Latitude, Longitude coordinates then you can associate each page with those fields. Depends what you are trying to do. If you just have cities as a choice field on page then you can have a list for city specific information and you can ...


1

Instead of using PublishingWebControls:RichHtmlField, can't you use SharePoint:InputFormTextBox It is a replacement of multi-line Rich Text Box, and it doesn't require Ribbon! And I guess you should be easily able to set focus on this textbox... document.getElementById('<%= myInputFormTextBox.ClientID %>').focus(); Or if that doesn't works, you can ...


1

Insert this at the bottom of your masterpage before the </body> end tag: <script type="text/javascript"> $(document).ready(function () { $("div[RteRedirect]").each(function () { var id = $(this).attr("RteRedirect"); editSettings = $("#" + id); if (editSettings.length > 0 && ...


1

You should create bindings to your custom content type: create empty element, add bindings like this to your element file: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!--Default content type--> <ContentTypeBinding ...


1

This works fine for us: <PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" runat="server" PopupEditorMode="True"/> Allows editing and displays content.


1

So what's propably happened is that you've got the HTMLField within your EditMode Panel as below <PublishingWebControls:EditModePanel> <PublishingWebControls:RichHtmlField id="PageContent" FieldName="PublishingPageContent" runat="server" CssClass="bp-pagelayout-contenttable-maxwidth"/> ...


1

Did you create a new content type for your page layout? The "PublishingWebControls:RichHtmlField" control is always associated with a field in your related content type with a data type of PublishingHTML. You will need to get the guid of the new field and associate it with the RichHtmlField in the page layout markup before it will show the content of the ...


1

Try adding the html element works for me. <PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" runat="server" PopupEditorMode="True" html="<span><p>This will be displayed on every page you create</p></span>" />


1

You could probably first decode the string from html, then trim it and then reencode it to html, like this: var aString = yourTextBoxText; aString= SPEncode.HtmlDecode(aString); Since the texbox will always render <html><div> before the content you can not use .Trim(), instead use: aString = aString.Replace("<html> <div>", ""); ...


1

From the way I interpret those posts, the syntax you want is tr.carousel-firstrow { /* [ReplaceColor(themeColor:"Dark1")] */ background-color: #ABABAB; /* or any color, as it will be replaced */ /* [ReplaceColor(themeColor:"Accent3")] */ color: #FFFFFF; } Those articles do seem to imply that the replacements occur when you actually apply a theme, ...


1

I figured it out! The Body text had been changed from Rich HTML text field to a Plain text field. Changing this back to Rich HTML fixed the problem. I'm not entirely sure why, but I suspect it is because the Reply field and Body text are linked in some way. I cannot see if it is possible to make the Reply field plain text as well; I imagine this would ...


1

as far as I know, site columns are wysiwyg (what you see is what you get). you have to choose whatever type you need from a limited list of types, and apply the avaible customization options. the easiest way to avoid problems is to set the column as single line of text (in which case you could set the maxlength upfront or use a formula in the list ...


1

Try alert($('#linkMainImgDiv').html()) First check in you page source that even this id exist or not. If exist then try it in your debugger tool of browser. Can you share your markup or any screenshot with div.



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