PHP code example of jorisnoo / craft-sidebar-relations

1. Go to this page and download the library: Download jorisnoo/craft-sidebar-relations library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jorisnoo / craft-sidebar-relations example snippets


return [
    'modules' => [
        'sidebar-relations' => \Noo\CraftSidebarRelations\SidebarRelations::class,
    ],
    'bootstrap' => ['sidebar-relations'],
];

use Noo\CraftSidebarRelations\config\SidebarRelationsConfig;

return SidebarRelationsConfig::create()
    ->sources([
        [
            'section' => 'articles',
            'relation' => 'categories',
        ],
        [
            'section' => 'projects',
            'relation' => 'clients',
            'where' => [
                'level' => 1,
            ],
        ],
    ]);