Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Blocks are not rendering in TinyMCE Editor CMS 7.5

Vote:
 

I created a block & i drag & drop it into Tiny MCE Editor. But when i see the page it does not render. The name of block is appear. forexample "Test Block Name"

#122479
Jun 03, 2015 11:49
Vote:
 

How do you render your property?

If webforms you probably need <episerver:property propertyname="yourproperty" runat="server" />
If MVC you probably need @Html.PropertyFor(x=>x.CurrentPage.PropertyName) (depending on what model the view uses)

#122480
Jun 03, 2015 12:11
Vote:
 

I render the property like <%=CurrentBlock.Title%>. I'm working on WebForms.

#122484
Edited, Jun 03, 2015 12:21
Vote:
 
<p>Change it to &lt;episerver:property propertyname="Title" runat="server" /&gt; and see if it works. There might be some helper-method so you can render it by &lt;%= CurrentBlock.Title.ToHtmlString() %&gt; or similar.</p>
#122490
Jun 03, 2015 12:43
Vote:
 

Hi , i have a similar question...

I have a contentarea where i can place blocks (AccordeonBlock for example, which contains a contentarea for AccordeonItems and those contain a tinyMcE property and 2 string properties.)

If i add Dynamic Content in the tinyMCE (for example a oEmbedPluging instance). How can i render that from within the block..

@using EPiServer.Core
@using EPiServer.ServiceLocation;
@using EPiServer.Web.Mvc.Html
@using EPiServer.Framework.Blobs;
@using EPiServer.Editor;
@model AccordionBlock
@{
    var contentLoader = ServiceLocator.Current.GetInstance<EPiServer.IContentLoader>();    
}

@if( Model != null && Model.Area != null && Model.Area.Items.Any())
{
    <section class="block  block-accordion">
        <div class="container">
            @if(!string.IsNullOrEmpty(Model.Title))
            {
                <div class="block-header">
                    <h1>@Model.Title</h1>
                    @if (!string.IsNullOrEmpty(Model.Subtitle))
                    {
                        <span class="sub-title">@Model.Subtitle</span>
                    }
                </div>
            }            
            <div class="accordion-wrapper">
                @if(Model != null && Model.Area != null && Model.Area.Items.Any())
                {
                    foreach (var contentItem in Model.Area.Items)
                    {
                        var item = contentLoader.Get<AccordionItem>(contentItem.ContentLink);

                        <a class="toggle">@item.Title</a>
                        <div class="content block-rte">
                            @item.Body
                        </div>
                    }
                }   
            </div>                    
        </div>
    </section>
}

As you can see i render the tinyMCE as @item.Body.  The output of the plugin is then {oEmbedPlugin} .. How can i render the complete dynamic contents from within a such a block?

#122494
Edited, Jun 03, 2015 13:14
Vote:
 
<p><img src="file:///C:/Users/Administrator/Desktop/TestImage.png" alt="" />For Example,&nbsp;</p> <p>&lt;div&gt;</p> <p>&lt;b&gt;&lt;/b&gt;<br /> &lt;div class="inputcontainer"&gt;<br /> &lt;asp:TextBox ID="txt" runat="server"&gt;&lt;/asp:TextBox&gt;&amp;nbsp;<br /> &lt;asp:Button ID="btnGo" runat="server" OnClick="btnGo_Click" Text="Go" /&gt;<br /> &lt;/div&gt;<br />&lt;/div&gt;</p> <p></p> <p>but when i view the Page. Only block name shows. like, I have create block with name Test. &amp; on pgae "Test" Shows.</p>
#122497
Jun 03, 2015 13:38
Vote:
 

Shan, if you cannot use the episerver:property-tag, then you might need to do something like this: http://tedgustaf.com/sv/blogg/2009/9/parse-an-episerver-xhtml-property-with-dynamic-content/ It's and old article, but I guess it should work nowadays as well...

Vishal, I would probaly have a View for the AccordionItem and use Html.PropertyFor in that View.

#122499
Jun 03, 2015 14:01
Vote:
 
<p>Thanks Erik for your quick responce :-)</p>
#122508
Jun 03, 2015 14:26
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.