Neathtml UntrustedContent custom html

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/7/2009 1:07:19 PM
Gravatar
Total Posts 73

Neathtml UntrustedContent custom html

Joe, I would like to customize the html that the NeatHtml control outputs in the FeedManagerModule.ascx, yet I can not figure out how and where it does it. Any tips?

5/7/2009 1:43:14 PM
Gravatar
Total Posts 73

Re: Neathtml UntrustedContent custom html

Not the way I really wanted to do it, but this got me where I wanted to go. I added a div wrapper around the NeatHtml control within the Feed manager, and then I modified the rssmodule.css file to add the new class to it

 

<NeatHtml:UntrustedContent ID="UntrustedContent1" runat="server" TrustedImageUrlPattern='<%# allowedImageUrlRegexPattern %>'
ClientScriptUrl="~/ClientScript/NeatHtml.js" Visible='<%# ShowItemDetail %>'>
<div class="rssTextNeatHtml">
<%# RSSAggregatorUseExcerpt ? UIHelper.CreateExcerpt(DataBinder.Eval(Container, "DataItem.Description").ToString(), RSSAggregatorExcerptLength, RSSAggregatorExcerptSuffix) : DataBinder.Eval(Container, "DataItem.Description").ToString()%>
</div>
</NeatHtml:UntrustedContent>

 

Basically I wanted to force images to a certain size, regardless of what the user put into the excerpt, and to shrink up the div a bit, as neathtml was putting a empty div at the end of each feed. Here is what I added:

.rssTextNeatHtml img { height: 100px; width: 100px; } /*tim c: force the images to a set size, regardless of size in excerpt*/
.rssTextNeatHtml { margin-bottom: -12px}
 

I also did not want my changes to affect feeds that were not displaying the text.

 

5/8/2009 7:31:58 AM
Gravatar
Total Posts 18439

Re: Neathtml UntrustedContent custom html

Hi,

I think this is purely a skinning issue from what I gather it has nothing to do with NeatHtml other than the fact that the markup you want to style happens to be nested within a NeatHtml:UntrustedContent control.

As far as I know NeatHtml doesn't affect the style other than the fact that it strips out markup from the feed content that is potentially malicious.

It is already wrapped in a div with the css class rsstext, so it seems to me you can achieve the same result simply by adding/editing this in your css file(s)

.rsstext img { height: 100px; width: 100px; } /*tim c: force the images to a set size, regardless of size in excerpt*/
.rsstext { margin-bottom: -12px}

It will not affect feeds that are not displaying the text because the div wrapper is only rendered when it is showing.

<div class="rsstext" id="divFeedBody" runat="server" visible='<%# ShowItemDetail %>'>

Hope it helps,

Joe

5/8/2009 9:39:40 AM
Gravatar
Total Posts 73

Re: Neathtml UntrustedContent custom html

Oddly enough, that is what I did at 1st. I added that css markup to the rsstext class. However it shrunk feed displays that were only displaying the header making them overlap. I then tried adding a css class to the neathtml control, then a client side style attribute. Both of those caused the control to throw an exception. I did not verify, but I suspect their control is not inherited from WebControl, but more likely Control.  So then I was forced to add that inner div to the neathtml control.

I could have used the img resizing css on the rsstext class however.

You must sign in to post in the forums. This thread is closed to new posts.