Question

How can i get a option (as text/image) on right click in tridion at the HomePage level,Page view.

Very similar to a button in ribbon, how can i have it as an option on Right click (as text/image) so that on selection, i will have my own functionality.

Could anyone help me.

Was it helpful?

Solution

If there already is an option menu on right click of the item you need, you can simply extend that using the correct view and control in your extension configuration.

For example here is a snippet from the configuration I used to extend the context menu of the Publishing Queue (adding a Publish and Unpublish button in its own sub menu, it can be downloaded from SDL Tridion World).

<ext:contextmenus>
  <ext:add>
    <ext:extension assignid="cm_pq" insertbefore="cm_sep_0" name="PublishQueuePublishing">
      <ext:menudeclaration>
        <cmenu:ContextMenuItem id="cm_pq_sep_0" type="separator"/>
        <cmenu:ContextMenuItem id="cm_pq_pub" name="{Resources: Tridion.Web.UI.Strings, Publishing}" type="submenu">
          <cmenu:ContextMenuItem id="cm_pq_publish" command="PqPublish" name="{Resources: Tridion.Web.UI.Strings, Publish}" />
          <cmenu:ContextMenuItem id="cm_pq_unpublish" command="PqUnPublish" name="{Resources: Tridion.Web.UI.Strings, UnPublish}" />
        </cmenu:ContextMenuItem>
      </ext:menudeclaration>
      <ext:dependencies>
        <cfg:dependency>PublishFromPublishingQueue.Theme</cfg:dependency>
        <cfg:dependency>PublishFromPublishingQueue.Commands</cfg:dependency>
      </ext:dependencies>
      <ext:apply>
        <ext:view name="*">
          <ext:control id="PublishQueueContextMenu" />
        </ext:view>
      </ext:apply>
    </ext:extension>
  </ext:add>
</ext:contextmenus>

If there is no context menu, then I think you are on your own, meaning you need to create something yourself in your JavaScript code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top