Question

I would like to add a new custom-defined DelegateControl to the bottom of my MasterPage so that I can install Google Remarketing markup to the bottom of all my pages with a Feature. I already have the feature and usercontrol deployed and activated, but it's not showing up in the DelegateControl tag that I've created. This feature also installs Google Analytics markup to the pre-existing AdditionalPageHead and is doing so correctly, so there must be some step missing in making SharePoint acknowledge my custom-defined DelegateControl.

The control is declared in my MasterPage thusly:

<SharePoint:DelegateControl ControlId="RIMS2_PageFooter" Id="RIMS2PageFooter" runat="server" AllowMultipleControls="true"/>

and the "elements.xml" file for that particular feature thusly:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Control Id="AdditionalPageHead" Sequence="90" ControlSrc="~/_ControlTemplates/RIMS2_Features_Google_Code/Google_Analytics.ascx" />
    <Control Id="RIMS2_PageFooter" Sequence="90" ControlSrc="~/_ControlTemplates/RIMS2_Features_Google_Code/Google_Remarketing.ascx" />
</Elements>
Était-ce utile?

La solution

I resolved this by changing the ControlId and Id parameters to strings that didn't include numbers like so:

   <SharePoint:DelegateControl AllowMultipleControls="true" ControlId="RIMS_PageFooter" ID="RIMSPageFooter" runat="server"/>

and setting the Id in the elements.xml file to reflect that change:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
        <Control Id="AdditionalPageHead" Sequence="90" ControlSrc="~/_ControlTemplates/RIMS2_Features_Google_Code/Google_Analytics.ascx" />
        <Control Id="RIMS_PageFooter" Sequence="90" ControlSrc="~/_ControlTemplates/RIMS2_Features_Google_Code/Google_Remarketing.ascx" />
</Elements>

I was also mistaken regarding WSS not displaying custom DelegateControls - the Google Remarketing tags are showing up correctly in the pages at the root of the WSS site, where the MasterPage has been edited to include the custom DelegateControl. It is, however, not showing up on other pages because one would need to modify the MasterPage of each subweb to contain the same DelegateControl tag (uncovering one of the hidden benefits of the Publishing Services in MOSS).

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top