I am working at combining a bunch of different lists with rich data into a single list that can be filtered. It’s possible that I simply need to configure this differently but I’m trying to get one ‘nest-source’ collection list to be nested in three different collections (the ones that will be combined using API callback).
Essentially I have a ‘topics’ collection that I want to be applied to different resources/collections. One topic can be applied to different media types for which I have various collections (article, video, photo-essay etc…)
Hey @Shane1! I am not sure if we can make it work in this setup. Could you share a read-only? I see some of the setup missing for the photo essay items.
What I’d like to try is to combine all the lists first, and then initialize CMS Nest. This way, all the nest-target are inside a single collection.
If this does not work I’m afraid we will need to use the same collection several times with different ID
Thanks @Support-Luis ! What you’re suggesting makes sense. I’m going to give it a go. I’m working on getting the read only link now. (Apparently you can’t do that as an agency/guest role ).
Yes, I probably missed something on photo essay collection as I’m just trying to get it working once and then I have a number of more collections to add to the mix.
What I’ve done, doesn’t seem to have done the trick. Here is how I have the code arranged (the jQuery at the bottom is just what I’m doing to show/hide loading elements):
<script>
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([
'cmsload',
(listInstances) => {
window.fsAttributes.cmscombine.init();
},
]);
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([
'cmscombine',
(combineInstances) => {
console.log('cmscombine Successfully loaded!');
window.fsAttributes.cmsnest.init();
},
]);
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([
'cmsnest',
(listInstances) => {
console.log('cmsnest Successfully loaded!');
window.fsAttributes.cmsfilter.init();
},
]);
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([
'cmsfilter',
(filterInstances) => {
console.log('cmsfilter Successfully loaded!');
$('.search_tag-loader').unwrap().remove();
$('[search="is-loading"]').hide();
$('[search="is-loaded"]').show();
$('.search_results-wrapper').css('filter', 'blur(0)'); // Set blur to 0
$('.search_results-wrapper').css('cursor', 'auto'); // Set cursor to auto
$('.search_results-wrapper').css('pointer-events', 'auto');
setTimeout(function() {
$('.search_results-wrapper').css('opacity', '100%');
}, 200); // Set opacity to 100%
$('.section_search-background_loading-wrap').css('opacity', '0%');
// The callback passes a `filterInstances` array with all the `CMSFilters` instances on the page.
const [filterInstance] = filterInstances;
// The `renderitems` event runs whenever the list renders items after filtering.
filterInstance.listInstance.on('renderitems', (renderedItems) => {
$('.search_tag-loader').unwrap().remove();
console.log(renderedItems);
});
},
]);
</script>```
@Support-Luis any advice you can give on how to structure this to get multiple instances of Nest to work is much appreciated I wandered into other fruitless solutions but don’t love the prospect of going outside of an attributes solution
Hey just keeping you updated on this I got multiple nests to work. On my second instance of it, I didn’t have a link to the child template on the parent template-reference page.
I would still love to be able to simplify this implementation a bit as it is both a bit complicated and slow-loading BUT… I think I have something that will work. And I am grateful
Hey @Shane1! Sorry for the slow reply! I am glad you got this working. I know this is a tedious workaround, but I’ve opened a feature request for this feature
No worries. I’m also opting to use the second nest option that uses a plain text field as the reference page route is taking a pretty big hit to the page loading speeds. Thankfully the API Callbacks have allowed me to inject some custom code to help really control the loading experience.