Design and CSS styles
Version 6.x > Design and CSS styles > MegaMenu issue View modes: 
User avatar
Member
Member
rafik4000-hotmail - 5/9/2012 5:41:28 PM
   
MegaMenu issue
hello,

after I try to integrate the Mega Menu in my website.

I get error [CMSDataProperties.LoadTransformation]: The server block is not well formed.

I found this error coming from MegaMenuTopLevel Transformation.

I tried to found the error but no success
<li><a href="<%# GetDocumentUrl()" %> <asp:Literal ID="ltlChildClass" runat="server" Visible="false" Text='class="drop"' /> ><%# Eval("DocumentName")%></a>

<asp:Literal ID="ltlContentBeforeDivStart" runat="server" Visible="false" Text='<div class="' />
<asp:Literal ID="ltlContentBefore" runat="server" Visible="false" Text='<%# IfEmpty(Eval("DocumentMenuClass"), "dropdown_1column", Eval("DocumentMenuClass"))%>' />
<asp:Literal ID="ltlContentBeforeDivEnd" runat="server" Visible="false" Text='">' />

<cms:CMSRepeater ID="repSubItems" Path='<%# Eval("NodeAliasPath") + "/%" %>' runat="server" ClassNames="CMS.MenuItem" TransformationName="CMS.MenuItem.MegaMenuSub" OrderBy="NodeLevel, NodeOrder, NodeName" MaxRelativeLevel="1" WhereCondition="DocumentMenuItemHideInNavigation='false'" />

<asp:Literal ID="ltlContentAfter" runat="server" Visible="false" Text="</div>" />

<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
    if (repSubItems.Items.Count != 0)
    {
        ltlContentBeforeDivStart.Visible = true;
        ltlContentBefore.Visible = true;
        ltlContentBeforeDivEnd.Visible = true;
        ltlContentAfter.Visible = true;
        ltlChildClass.Visible = true;
    }
    repSubItems.ReloadData(true);
}
</script>


I hope someone can help me thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/10/2012 6:19:00 AM
   
RE:MegaMenu issue
Hi,

I guess that apostrophes are not allowed here:

WhereCondition="DocumentMenuItemHideInNavigation='false'"


You may try to replace it with:
WhereCondition="DocumentMenuItemHideInNavigation=& #39;false& #39;"

(without space between & and # characters, simply use code name of the apostrophe)

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Skip - 5/15/2012 10:58:59 AM
   
RE:MegaMenu issue
Did this work for anyone? I did not get the first error anymore, but when I try to bring up the page, I get a syntax error on the "&". I double checked to make sure I did not leave a space in the string.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/16/2012 6:51:36 AM
   
RE:MegaMenu issue
Hi,

this code worked for me (only apostrophes were replaced by its codename as described in previous post):

<asp:Literal ID="ltlContentBeforeDivStart" runat="server" Visible="false" Text='<div class="' />
<asp:Literal ID="ltlContentBefore" runat="server" Visible="false" Text='<%# IfEmpty(Eval("DocumentMenuClass"), "dropdown_1column", Eval("DocumentMenuClass"))%>' />
<asp:Literal ID="ltlContentBeforeDivEnd" runat="server" Visible="false" Text='">' />

<cms:CMSRepeater runat="server" ID="repSubItems" Path='<%# Eval("NodeAliasPath") + "/%" %>' ClassNames="CMS.MenuItem" TransformationName="CMS.MenuItem.MegaMenuSub" OrderBy="NodeLevel, NodeOrder, NodeName" MaxRelativeLevel="1" WhereCondition="DocumentMenuItemHideInNavigation='false'" />

<asp:Literal ID="ltlContentAfter" runat="server" Visible="false" Text="</div>" />

<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
if (repSubItems.Items.Count != 0)
{
ltlContentBeforeDivStart.Visible = true;
ltlContentBefore.Visible = true;
ltlContentBeforeDivEnd.Visible = true;
ltlContentAfter.Visible = true;
// ltlChildClass.Visible = true;
}
repSubItems.ReloadData(true);
}
</script>


I also create a simple transformation CMS.MenuItem.MegaMenuSub with content:
<%# Eval("NodeName")%>

Then Node names were created correctly. I also send you a text file to be sure that some characters were not encoded incorrectly.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
rafik4000-hotmail - 5/16/2012 1:30:51 PM
   
RE:MegaMenu issue
Hi,

I correct the codes in MegaMenuTopLevel and MegaMenuSub.
I don't see the transformation error but the menu dont appear
I checked Menu item CSS class of each document and the configuration of the repeater
I don't see any problem.

The code I add in MegaMenuTopLevel transformation
<asp:Literal ID="ltlContentBeforeDivStart" runat="server" Visible="false" Text='<div class="' />
<asp:Literal ID="ltlContentBefore" runat="server" Visible="false" Text='<%# IfEmpty(Eval("DocumentMenuClass"), "dropdown_1column", Eval("DocumentMenuClass"))%>' />
<asp:Literal ID="ltlContentBeforeDivEnd" runat="server" Visible="false" Text='">' />

<cms:CMSRepeater runat="server" ID="repSubItems" Path='<%# Eval("NodeAliasPath") + "/%" %>' ClassNames="CMS.MenuItem" TransformationName="CMS.MenuItem.MegaMenuSub" OrderBy="NodeLevel, NodeOrder, NodeName" MaxRelativeLevel="1" WhereCondition="DocumentMenuItemHideInNavigation='false'" />

<asp:Literal ID="ltlContentAfter" runat="server" Visible="false" Text="</div>" />

<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
if (repSubItems.Items.Count != 0)
{
ltlContentBeforeDivStart.Visible = true;
ltlContentBefore.Visible = true;
ltlContentBeforeDivEnd.Visible = true;
ltlContentAfter.Visible = true;
// ltlChildClass.Visible = true;
}
repSubItems.ReloadData(true);
}
</script>


The code I add in MegaMenuSub transformation
<div class="<%# IfEmpty(Eval("DocumentMenuClass"), "col_1", Eval("DocumentMenuClass"))%>">
<%# IfEmpty(Eval("MenuItemTeaserImage"), "", "<img src='" + GetFileUrl("MenuItemTeaserImage") + "maxsidesize=20"; style=";margin: 0 5px 0 0; float: left;"; />") %>
<a href="<%# GetDocumentUrl() %>;"><%# Eval("DocumentName") %>
</div>


sorry about that but I still don't fix the problem completely

Please help me

Thank you

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/21/2012 2:18:27 AM
   
RE:MegaMenu issue
Hi,

in the second transformation was an incorrect syntax. Please try to start with this one:


<div class="<%# IfEmpty(Eval("DocumentMenuClass"), "col_1", Eval("DocumentMenuClass"))%>">
<%# IfEmpty(Eval("MenuItemTeaserImage"), "", "<img src=\"" + GetFileUrl("MenuItemTeaserImage") + "\"/>") %>
<a href="<%# GetDocumentUrl() %>"><%# Eval("DocumentName") %> </a>
</div>


The combination of this transformation and the one I send you in previous e-mail displays the list of menu items.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
ldowdell - 6/1/2012 2:09:33 PM
   
RE:MegaMenu issue
Thanks for the scripts I was finally able to get my Mega Menu to work, however I noticed for the documents that I used the multiple column menu class ... don't appear in the breadcrumb navigation. See my site at:http://12.218.239.67/Departments/Chancery-Division.aspx

The breadcrumb should say Department >>Chancery.

User avatar
Member
Member
ldowdell - 6/1/2012 2:25:44 PM
   
RE:MegaMenu issue
Ok I figured it out...I indicated FALSE for Apply Menu Design.