Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Forum Transformation Images View modes: 
User avatar
Member
Member
kmiday-cuyahogalibrary - 2/12/2014 6:46:24 AM
   
Forum Transformation Images
Hello,

I have an intranet and it was requested that the images added to forum posts be displayed in the list of posts preview.

I've gotten the images to display using CMS.CMSHelper.CMSContext.ResolveDiscussionMacros (string) but this then causes all other HTML to display as plaintext one way or another within the transformation.

Code I have tested so far:
<div class="Latest">
<h4><a href="<%# ForumFunctions.GetPostURL(Eval("PostIDPath"), Eval("PostForumID")) %>"><%# ((String)Eval("PostSubject", true)).ToUpper() %></a> | <%# GetDateTime("PostTime").ToUpper() %></h4>
<div class="Summary">
<b>Eval Post Text:</b>
<%# Eval("PostText") %><br />
<b>HTML Encode Limit Post Text:</b>
<%# HTMLEncode(LimitLength(Eval("PostText"), 300, "...")) %><br />
<b>No HTML Encode:</b>
<%# LimitLength(Eval("PostText"), 300, "...") %><br />

<b>Resolve Discussion Macro:</b>
<%# CMS.CMSHelper.CMSContext.ResolveDiscussionMacros("" + Eval("PostText") + "") %><br /><br />
<b>Limit Resolve post text:</b>
<%# LimitLength(CMS.CMSHelper.CMSContext.ResolveDiscussionMacros("" + Eval("PostText") + ""), 500, "...") %><br /><br />
<%# CMS.CMSHelper.CMSContext.ResolveDiscussionMacros("" + HTMLEncode(LimitLength(Eval("PostText"), 300, "...")) + "") %><br /><br /><br />
<%# LimitLength(StripTags(RemoveDynamicControls(CMS.CMSHelper.CMSContext.ResolveDiscussionMacros("" + Eval("PostText")+ ""))), 100, "...") %>
</div>
<br class="Clear" />
</div>


Screenshot:
User image