November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi Steve,
Yes, the TinyMCE editor supports rendering of blocks. It will call the partial renderer of the block to render it. What type of issues are you running in to?
/T
Hi Toni,
Thanks for the swift response :)
That's great to hear. I was initially having issues with the internal links not resolving correctly (as described here: http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=116262&epslanguage=en), so I put in a workaround to fix that, but subsequently seems to have broken the block rendering.
Thanks
Steve
What was the workaround? I looked at the other link and you are using something I haven't seen before to render the property:
<Web:BoundProperty ID="MainContentBoundProperty" runat="server" />
Why not use the default EPiServer:Property user control to render your properties?
/T
Hi,
Happens with either property control, the workaround i used was
/// <summary>
/// To the HTML string fixed.
/// </summary>
/// <param name="instance">The instance.</param>
/// <returns></returns>
public static string ToHtmlStringFixed(this XhtmlString instance)
{
if (null == instance)
return null;
if (instance.IsEmpty)
return String.Empty;
StringBuilder stringBuilder = new StringBuilder();
foreach (IStringFragment stringFragment in instance.Fragments)
{
UrlFragment urlFragment = stringFragment as UrlFragment;
if (null != urlFragment)
{
Uri externalUrl;
if (TryGetExternalUrl(urlFragment.InternalFormat, out externalUrl))
{
stringBuilder.Append(externalUrl);
continue;
}
}
stringBuilder.Append(stringFragment.GetViewFormat());
}
return stringBuilder.ToString();
}
/// <summary>
/// Tries the get external URL.
/// </summary>
/// <param name="internalFormat">The internal format.</param>
/// <param name="externalUrl">The external URL.</param>
/// <returns></returns>
private static bool TryGetExternalUrl(string internalFormat, out Uri externalUrl)
{
try
{
//The call to GetExternal URL here is a wrapper around a call to EPiServer.Global.UrlRewriteProvider.ConvertToExternal.
var builder = new UrlBuilder(internalFormat);
Global.UrlRewriteProvider.ConvertToExternal(builder, null, Encoding.ASCII);
externalUrl = builder.Uri;
}
catch (Exception)
{
externalUrl = null;
}
return null != externalUrl;
}
Hi,
A general question really - the tinyMCE editor allows the drag and dropping of any block within the EpiServer UI, but sometimes I run into issues with certain blocks being rendered. My question is "Is the EpiServer TinyMCE built for this purpose as it initially has no "insert block" button/function or should all blocks sit outside by default and custom buttons created for the insertion of blocks?
Thanks
Steve