Addon / Menu Templates.? + php Question

Hi All,



CS Cart v3

I have been customizing the following file using hooks to test my menu design;

/skins/basic/customer/blocks/topmenu_dropdown.tpl



I now can a working design for my second menu bar however I now have the problem that I would actually like to use the default menu as well.



So the question in my_changes how can I add extra menu templates like the ones that are in the default directories;

skins/basic/customer/blocks/menu

/skins/basic/customer/blocks/topmenu_dropdown.tpl



Without just adding my own files to the core files i tried adding my files to but I had no luck.

skins/basic/customer/addons/my_changes/blocks/modded_topmenu_dropdown.tpl

skins/basic/customer/addons/my_changes/blocks/menu/modded_dropdown_horizontal.tpl



So basically Is the above possible with my_changes?

If so how do I include some extra menu templates without using hooks or editing the core?



Secondly Is it posible to use my own php code from within the my_changes addon so that my variables/arrays can be used from both category and the pages controller??

A little confused in reading your post.

Is 'my_addons' the same as 'my_changes'? Or did you create a new addon called 'my_addons'?



You can add all the PHP code you want using controllers specific to the page(s) you are displaying. You can also add your own filing types to the blocks. And yes, you can create your own blocks, but you will need to setup a schemas/block_manager/blocks.php file in the addon that references them.



You'll have to dig through other addons on the distribution to get the details. But basically yes, you can do what you want to do.

Hey tbirnseth,



I edited my post which should clear up and confusion. I actually meant my_changes the default one that comes with CS Cart & have modified the original post accordingly. I have also formatted it a little better into actual questions. lol + I have some more relating to your responce.



Also how do I go about making my own schemas/block_manager/blocks.php in my_changes


  1. Do I use add the file like this; /addons/my_changes/schemas/block_manager/blocks.post.php, Can I tag extra code on into the blocks.php file or will it break the existing $schema array?


  2. Where do I put my new template (path?)


  3. This is original menu section of blocks.php, what do I have to change/add to include my own menu template into the block manager…without breaking the array.



$schema = array (
'menu' => array (
'templates' => 'blocks/menu',
'content' => array (
'items' => array (
'type' => 'function',
'function' => array('fn_get_menu_items')
),
'menu' => array(
'type' => 'template',
'template' => 'views/menus/components/block_settings.tpl',
'hide_label' => true,
'data_function' => 'fn_get_menus'
),
),
'wrappers' => 'blocks/wrappers',
),

-----etc----

);

Look at a different addon that utilizes block (maybe News and Emails). You can dig out all the nuances there.

Sorry, but way to much detail to try and describe in the forums.