Best way to build footer and sidebar menu ? Migx or else?

I currently manually put links on footer and sidebar menus because they are not sorted out. I want to add only few selected resources links on that menu.
Suppose my main top menu is based on pdo menu and I call as it is sorted by id. Like Home about contact blog. But I want other links in footer like terms, privacy policy, faq etc.
I want to build a menu builder . something like cmp in migx where I can choose links and add them. I dont know how to make it in migx.
Anyone ?

ClientConfig can be useful here, just add footer_link1, footer_text1, footer_link2 etc. This would be easy to manage by end users, especially so if you also manage other parts of the design this way.

Selections, part of Collections, allows you to create lists of resources as well.

And certainly possible to custom build with MIGX, too. So you have options! :slight_smile:

1 Like

Maybe you can use the extra SuperBoxSelect

and then write a custom snippet to create the menu.

Something like this:

<?php
//snippet call: [[createFooterMenu? &resourceid=`107` &tvid=`20`]]

$resource_id =  (int) $modx->getOption('resourceid', $scriptProperties, $modx->resource->get('id'));
$tv_id = (int) $modx->getOption('tvid', $scriptProperties, 0);

//Query the value of the SuperBoxSelect-TV
$q = $modx->newQuery('modTemplateVarResource', array(
    'contentid' => $resource_id,
    'tmplvarid' => $tv_id,
));
$q->select('value');
$tv_val = $modx->getValue($q->prepare());

$ids = array_map('trim', explode('||', $tv_val)); //convert to an array

//Query the resources with the ids from the TV
$q = $modx->newQuery('modResource');
$q->where(array(
    'id:IN' => $ids
));
$q->sortby('FIELD(id, ' . implode(',', $ids) . ')','ASC'); //same order as in the TV

$output = '';
$resources = $modx->getCollection('modResource', $q);
//Create a link for every result
foreach($resources as $resource){
    $url = $modx->makeUrl($resource->get('id'));
    $menutitle = $resource->get('menutitle');
    if (empty($menutitle)) {
        $menutitle = $resource->get('pagetitle');
    }
    $output .= '<a href="' . $url . '">' . $menutitle . '</a>'; //or use a chunk with $modx->getChunk()
}
return $output;
1 Like

I used clientconfig recently and its awesome.
Check the footer here I made in ClientConfig
Sometimes I find its little lazy to create links and texts for each page. Sometimes I have to add more and then there I have to make mode configs. I am looking for a menu generator kind of thing and Migx seems to be a good option in this condition(my laziness).
I don’t know how to make resource selection in Migx.

Let me try this and then I will get back to you. :wink:

I don;t want to bump this but I thought someone will use this :heavy_minus_sign:
I use pdoMenu to generate links and clientConfig to set which menu Client want to set.
Here is my call :

 [[!pdoMenu?
                &parents=`0`
                &lastClass=``
                &firstClass=``
                &level=`1`
                &resources=`[[++siteFooterLink1]]`
                &outerClass=`list-unstyled`
                &tplOuter=`@INLINE <ul [[+classes]]>[[+wrapper]]</ul>`
                &rowClass=`item-list-a`
                &tpl=`@INLINE <li [[+classes]]><i class="bi bi-chevron-right"></i><a href="[[+link]]" [[+attributes]]>[[+menutitle]]</a>[[+wrapper]]</li>`
              ]]

And with clientConfig setting siteFooterLink1, client can see the resource id from the resources tree and put the id there easily. By this, we can generate client friendly menus. :slight_smile:

image
Result :
image