Blog

  • Sync Proton Mail Contacts and Google Contacts

    I’ve built a macOS app that syncs Proton Mail contacts and Google Contacts 1:1. After setup, it runs as a background process once every 30 minutes. It supports Proton Mail groups to Google Contacts labels mapping. If you or anyone you know needs this software or something like it, I’d love to hear from you.

  • Add Administration Panel Menu Items in CS-Cart

    I wrote this tutorial using CS-Cart v4.18.4.

    Template to Override

    Copy this file from its location in core.

    design/backend/templates/components/menu/get_primary_items.tpl

    Override Location

    Use a “my_changes” add-on as described in CS-Cart documentation to provide a custom version of the template.

    design/backend/templates/addons/my_changes/overrides/components/menu/get_primary_items.tpl

    Sample Code

    This template file creates the screenshot above.

    {capture name="get_items"}
        {$additional_items = [
    		upload => [
    			title => "Get Breakfast",
    			position => 100,
    			icon => 'icon-inbox',
    			href => "https://breakfastco.xyz/",
    			id_path => "upload",
    			active => true
    		]
    	]}
        {* Create main menu *}
        {$navigation_home = [
            home => [
                title => __("home"),
                position => 10,
                icon => "icon-home",
                href => "index.index",
                id_path => "home",
                active => ($runtime.controller === "index" && $runtime.mode === "index")
            ]
        ]}
    
        {* Get additional menu items: $additional_items *}
        {include file="components/menu/get_additional_items.tpl"}
    
        {if $smarty.const.BLOCK_MANAGER_MODE}
            {$items = $navigation.static.central}
        {else}
            {$items = $navigation_home|array_merge:
                ($navigation.static.central|default:[])|array_merge:
                $additional_items
            }
        {/if}
    
        {* Get block manager data for $items and $attrs_wrapper *}
        {include file="components/menu/get_block_manager_data.tpl"}
    
        {$primary_items = $items scope=parent}
        {$attrs_wrapper = $attrs_wrapper scope=parent}
        {$show_collapse_default = $show_collapse_default scope=parent}
        {$main_menu_primary_class = $main_menu_primary_class scope=parent}
    {/capture}