Minor SPD Bug to watch out for

 If you fancy re-creating a Sharepoint Designer (SP1) bug, read on.

Removing a column from your site and then re-adding one of the same name seems to cause problems with field controls. But there is a simple workaround;

(MOSS Publishing Site Version 12.0.0.6020)

Site Settings > Site Content Type Gallery > Site Content Type

Add new column to content type. ('Add from new site column' link)

Make it of type; 'Full HTML content with formatting and constraints for publishing'


Whoops, that was the wrong type.

Remove column from content type

Delete column from your Sharepoint Site

Create new column of same name and type; 'Hyperlink with formatting and constraints for publishing'

Add to your Content Type

Open site in Sharepoint Designer, and edit or create a page layout based on this content type.

Drag a field control onto a Page Layout via SPD

You get a control reference in the markup like this;
PublishingWebControls:RichLinkField FieldName="Relevant_x0020_Guidance_x0020_2"

Publish and approve the page layout and create a page with it.

New column (and it's field control) is never displayed either in Edit mode or display mode in your portal page, but can be seen in page layout markup via SPD.


In the content database tp_Fields column of AllLists table has this info;

New Column
<Field Type="Link" DisplayName="Relevant Guidance 2" RichText="TRUE" RichTextMode="FullHtml" Required="FALSE" Group="Custom Columns" ID="{7bcfe664-7002-48f7-ba92-0d3a1021af65}" SourceID="{e93d9889-cf3e-4f4f-aecb- 6e3c7ad8cba5}" StaticName="Relevant_x0020_Guidance_x0020_2" Name="Relevant_x0020_Guidance_x0020_20" ColName="ntext20" RowOrdinal="0" />

 

Old Column
<Field Type="HTML" DisplayName="Relevant Guidance 2" RichText="TRUE" RichTextMode="FullHtml" Required="FALSE" Group="Custom Columns" ID="{5afb271f-2eb1-4e47-ac01-267057e42cb0}" SourceID="{e93d9889-cf3e-4f4f-aecb- 6e3c7ad8cba5}" StaticName="Relevant_x0020_Guidance_x0020_2" Name="Relevant_x0020_Guidance_x0020_2" ColName="ntext17" RowOrdinal="0" />


'Static Name' is the same, but 'Name' differs, which may have something to do with it.

Workaround;

Hand edit the page layout markup in SPD so that the FieldName="Relevant_x0020_Guidance_x0020_20" (i.e. make FieldName equal to Name, not StaticName), and now it works OK.

Very hard to prove definitively but this seems like a Sharepoint Designer bug to me.

Disclaimer: The software, source code and guidance on this website is provided "AS IS"
with no warranties of any kind. The entire risk arising out of the use or
performance of the software and source code is with you.

Any views expressed in this blog are those of the individual and may not necessarily reflect the views of any organization the individual may be affiliated with.