Content Lib - getParent

In my current project I many times need the parent content. But there is no standard function for this.

So a function to get parent content would be nice in Content Lib

var result = contentLib.getParent({
    key: '/path/to/mycontent'
});

Hi,

This sounds like something the lib-util could handle. All these types of simplifying functionality is not best suitable for core, but would fit perfect in lib-util, that is built for this purpose.

5 Likes

A pull request for lib-util would be nice @rbrastad :slight_smile:

1 Like

I made some code a year ago which was never merged https://github.com/enonic/lib-util/compare/content.getAncestors#diff-946c6bbb2308deb87f33b74dfb79287fR83

2 Likes

I guess I forgot all about it and did not make a pull request.

1 Like