Try our conversational search powered by Generative AI!

Back button not working when switching to block edit view through topic.publish

Ted
Ted
Vote:
 

I have a widget in which I want to switch to the edit view for a block.

I currently do the following in the Dojo widget:

var blockId = 123;

var requestContext = {
    uri: 'epi.cms.contentdata:///' + blockId
}

topic.publish("/epi/shell/context/request", [requestContext], {});

The UI switches to the edit view for the block just fine, but the "Back" bottom at the top is either grayed out, or simply doesn't do anything when clicked. I would like it to return the user to the page the user was editing before the context change was made.

The block in question exists in the block folder for the page, and it is added to the content area of the page, if that makes any difference.

I've tried setting the 'parentLink' property of the requestContext object explicitly, but that didn't do anything. :)

Any help is greatly appreciated!

#146794
Mar 24, 2016 10:34
Ted
Vote:
 

To clarify: I'm guessing the Back button doesn't work because the actual parent of the block is the content assets folder (judging from the resulting content context)?

However, the Back button seems to work by looking at a "_previousContent" property, but that doesn't seem to be the page edited before the topic publish was made?

Perhaps I need to get the context of the block by calling the epi.shell.context store, and then use that context for the topic publish?

Or perhaps I'm just talking out of my a$$. :)

Edit: Nevermind, it was down to a typo in my code, and possibly specifying the sender... The following makes the Back button function as expected:

dojo.publish("/epi/shell/context/request", [requestContext, {
    sender: this
}]);
#146796
Edited, Mar 24, 2016 10:40
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.