We need to add a custom button to the context menu for feature layers. In the past we used esri_mapping_layerContextMenu and esri_mapping_standaloneTableContextMenu.
We define the state as insert conditions for layers and standalone tables by using:
With ArcGIS Pro 2.7 and 2.8 esri_mapping_layerContextMenu seems not to work for any shapefile related layers, any help would be appropriated.
Solved! Go to Solution.
We finally figured it out, also we have to use singleLayerSelectedCondition instead of singleFeatureLayerSelectedCondition for enabling it.
<conditions>
<insertCondition id="esri_mapping_single_layer_selected">
<and>
<state id="esri_mapping_singleLayerSelectedCondition"/>
</and>
</insertCondition>
<insertCondition id="esri_mapping_single_standalonetable_selected">
<and>
<state id="esri_mapping_singleStandaloneTableSelectedCondition"/>
</and>
</insertCondition>
</conditions>
<updateModule refID="esri_mapping">
<menus>
<updateMenu refID="esri_mapping_layerContextMenu">
<insertButton refID="SDA_Pro_Module_Create_Sda_From_FeatureTable_Button" separator="false" placeWith="esri_editing_table_openTablePaneButton" insert="after" />
</updateMenu>
<updateMenu refID="esri_mapping_unregisteredLayerContextMenu">
<insertButton refID="SDA_Pro_Module_Create_Sda_From_FeatureTable_Button" separator="false" placeWith="esri_editing_table_openTablePaneButton" insert="after" />
</updateMenu>
<updateMenu refID="esri_mapping_standaloneTableContextMenu">
<insertButton refID="SDA_Pro_Module_Create_Sda_From_StandaloneTable_Button" separator="false" placeWith="esri_editing_table_openStandaloneTablePaneButton" insert="after" />
</updateMenu>
<updateMenu refID="esri_mapping_unregisteredStandaloneTableContextMenu">
<insertButton refID="SDA_Pro_Module_Create_Sda_From_StandaloneTable_Button" separator="false" placeWith="esri_editing_table_openStandaloneTablePaneButton" insert="after" />
</updateMenu>
</menus>
</updateModule>
Using unregistered context menu did the trick. See Solved: Buttons built by ArcGIS Pro SDK cannot be added to... - Esri Community
We finally figured it out, also we have to use singleLayerSelectedCondition instead of singleFeatureLayerSelectedCondition for enabling it.
<conditions>
<insertCondition id="esri_mapping_single_layer_selected">
<and>
<state id="esri_mapping_singleLayerSelectedCondition"/>
</and>
</insertCondition>
<insertCondition id="esri_mapping_single_standalonetable_selected">
<and>
<state id="esri_mapping_singleStandaloneTableSelectedCondition"/>
</and>
</insertCondition>
</conditions>
<updateModule refID="esri_mapping">
<menus>
<updateMenu refID="esri_mapping_layerContextMenu">
<insertButton refID="SDA_Pro_Module_Create_Sda_From_FeatureTable_Button" separator="false" placeWith="esri_editing_table_openTablePaneButton" insert="after" />
</updateMenu>
<updateMenu refID="esri_mapping_unregisteredLayerContextMenu">
<insertButton refID="SDA_Pro_Module_Create_Sda_From_FeatureTable_Button" separator="false" placeWith="esri_editing_table_openTablePaneButton" insert="after" />
</updateMenu>
<updateMenu refID="esri_mapping_standaloneTableContextMenu">
<insertButton refID="SDA_Pro_Module_Create_Sda_From_StandaloneTable_Button" separator="false" placeWith="esri_editing_table_openStandaloneTablePaneButton" insert="after" />
</updateMenu>
<updateMenu refID="esri_mapping_unregisteredStandaloneTableContextMenu">
<insertButton refID="SDA_Pro_Module_Create_Sda_From_StandaloneTable_Button" separator="false" placeWith="esri_editing_table_openStandaloneTablePaneButton" insert="after" />
</updateMenu>
</menus>
</updateModule>
Using unregistered context menu did the trick. See Solved: Buttons built by ArcGIS Pro SDK cannot be added to... - Esri Community