BC Default Menu (with Images) Migration Fixes

So I have a very unwilling client who we just migrated their non mobile compat site that uses images in the menu. (I know…super gross)

I spent a couple of hours today fixing some issues with the migrated code that the migration app generates.

This might help others in the future if they have to do this. ( I pray to god you do not). And hopefully the devs that created the code can use this to help fix the issues

FOR THE “Default BC Layout” MENU LAYOUT IN TREEPL:

menu.layout

  • The CSS in the “on page” style tag migrated across broken. The styles were missing a bunch of values.
    Note for future users, just copy and paste what was on the old site to the new. Will save you a bunch of time.

  • Width attribute was missing from the table calls. IE
    <table id="cat_493540" cellpadding="0" cellspacing="0" class="catmain493540">
    need to have the width(in our case 462) added:
    <table id="cat_493540" width="462" cellpadding="0" cellspacing="0" class="catmain493540">

item.layout

  • onclick="window.open('{{item.itemUrl}}');"
    needs to be changed to
    onclick="window.open('{{item.itemUrl}}', '_self');"
    so that they urls open in the same tab.
    Note: You will find the above in 2 places.

  • So that the menu item image / hover image actually use the repeat /no-repeat option as it was set in bc:

if(customAttribute{{item.itemId}}.repeatImage)
    {
        repeat = 'repeat';
    } 

Add in the below:

if(customAttribute{{item.itemId}}.repeatImage)
    {
        repeat = 'repeat';
    } else {
	    repeat = 'no-repeat';
    }

sub_item.layout

  • Not sure if this was just out site, but we had to force the top position on the sub menu div. I’m not sure if this was because the old BC modulestylesheet.css file is not used… or something messed with the JS calculation, but we needed to add the following to the top of the layout:

<style>.catdiv493540{top: 149px!important}</style>
Obviously you will need to change the class name and height relevent to match your site needs.

I think this was everything for now. Ill add onto it if there was anything else.
Good Luck