Developer forum

Forum » Rapido » Helper blocks cannot be nested within each other

Helper blocks cannot be nested within each other

Mafalda Correa
Mafalda Correa
Reply

Hello,

I was trying to use the new Custom Blocks for Dynamic Articles, but when I try to use a helper I get this error: "Helper blocks cannot be nested within each other".

Here's my code:

@{
    var backgroundTitle = new Block()
    {
        Id = "BackgroundTitle",
        SortId = 10,
        Template = RenderBackgroundTitle()
    };
    
    articleListPageCustomBlocksPage.Add("ArticleListPageHeaderRow", block);
    
}

@helper RenderBackgroundTitle()
{
    <div class="u-title--giant u-uppercase u-color-light article__paragraph-sticker-title dw-mod">
        Lifestyle
    </div>
}

Replies

 
Konstantin Landyshev
Reply

Hi

I insert your code in custom blocks file in folder DynamicArticleListPage and I can't reproduce your bug. The only incorrect thing in your example is 

 articleListPageCustomBlocksPage.Add("ArticleListPageHeaderRow", block);

Because you should use backgroundTitle variable.

I have next result on article list page: (Lifestyle have white color, so I didn't notice this at start)

example.png
 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply

Hi 

I may have some additional info regarding this. We actually had this error in previous releases, but made a fix in Rapido 3.2 

If you need the fix in the pre-release, take a look in the bottom of the Master template in the final release.

 

Best regards 
Karsten Thuen

 
Mafalda Correa
Mafalda Correa
Reply
Original message by Konstantin Landyshev posted on 08/10/2019 07:52:48:

Hi

I insert your code in custom blocks file in folder DynamicArticleListPage and I can't reproduce your bug. The only incorrect thing in your example is 

 articleListPageCustomBlocksPage.Add("ArticleListPageHeaderRow", block);

Because you should use backgroundTitle variable.

I have next result on article list page: (Lifestyle have white color, so I didn't notice this at start)

 

That was actually right in the code, I just changed the variable when I posted it here to make it more comprehensible of what I was doing and then forgot to change it in that place.

 

Original message by Karsten Thuen posted on 08/10/2019 09:42:44:

Hi 

I may have some additional info regarding this. We actually had this error in previous releases, but made a fix in Rapido 3.2 

If you need the fix in the pre-release, take a look in the bottom of the Master template in the final release.

 

Best regards 
Karsten Thuen

I pulled the new templates from the 3.2 release, but I'm pretty sure I didn't get the new Master template yet, so that's probably why. I'll check again if this works when I upgrade fully Thanks for the reply.

 

You must be logged in to post in the forum