Posted on 03/01/2020 13:51:07
Hi Nicolai,
Is it correct, that I cannot reference the blocks from the Masterpage, from within the Productlist?
As mentioned at the beginning of this thread, I need to move the minicart from the header to the list. Instead of recreating the code for the minicart, I thought I could remove the block from the header and attach it to the productlist instead, but I guess that is not possible?
In the Custom__Blocks.cshtml under MasterBlocks I remove it with the following command:
BlocksPage masterCustomBlocksPage = BlocksPage.GetBlockPage("Master");
masterCustomBlocksPage.RemoveBlockById("MasterDesktopActionsMenuMiniCart");
Then in the Custom__Blocks.cshtml under Productlist/Blocks I would do the following:
BlocksPage masterBlocksPage = BlocksPage.GetBlockPage("Master");
BlocksPage customBlocksPage = BlocksPage.GetBlockPage("ProductList");
Block miniCart = masterBlocksPage.GetBlockById("MasterDesktopActionsMenuMiniCart");
customBlocksPage.Add("Views", miniCart);
... but this is not possible, as the miniCart cannot be referenced from here.
--
Best regards
Kurt Moskjaer Andersen