-1

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.

pavan
  • 451
  • 1
  • 5
  • 16

1 Answers1

3

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

Bart Koopman
  • 4,835
  • 17
  • 30
  • Hi Bart thanks for the info. I just need to show it on right click over a Component/Page in a Publication very much similar to Preview,Copy,Refresh what we are able to see currently. Could you please specify where i need to append my text inorder to get it displayed. Thanks in Advance!! – pavan Jul 26 '12 at 15:54
  • 1
    Yoav explains how to add both menu items and toolbar buttons in this post: http://yoavniran.wordpress.com/2011/03/03/setting-up-a-tridion-gui-2011-extension-in-8-steps/. It also explains how to find the ID you're looking for. – Frank van Puffelen Jul 27 '12 at 01:08
  • @user1544948 If you edit your question to contain more detail about what you are exactly looking for I can adjust my answer to that. But as Frank indicated it is all explained in Yoav's post: http://yoavniran.wordpress.com/2011/03/03/setting-up-a-tridion-gui-2011-extension-in-8-steps/ – Bart Koopman Jul 27 '12 at 07:08