3

I need to get child publications of a publication. I am using the following approach: get "where used" for the publication. Until now my code looks like this:

var id = publicationParent5TcmId;
var filter = new Tridion.ContentManager.ListFilter({columns: const.ColumnFilter.DEFAULT |$const.ColumnFilter.ALLOWED_ACTIONS |  $const.ColumnFilter.VERSIONS,    conditions:{InclLocalCopies: true}});

    var brothersPublications;
    var onSuccess = function () {
        if (brothersPublications) {
            $log.debug("WhereUsed.GetListUsingItems success: found " + brothersPublications.length + " brothers publications");
        }
        else {
            $log.debug("WhereUsed.GetListUsingItems success");
        }
    };

    var onFailed = function () {
        $log.debug("WhereUsed.GetListUsingItems failed");
    };

    brothersPublications = tridion.Web.UI.ContentManager.WhereUsed.GetListUsingItems(id, filter.conditions, filter.columns, onSuccess, onFailed);

It enters in onSuccess function, but brothersPublications is undefined.

2

1 Answer 1

2

You could try to get your publication and then the child publications this way:

var parent_pub = $models.getItem("tcm:0-2-1");
var list = parent_pub.getListChildPublications();

Then iterate the resulting list to do something to every publication objects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.