Jason Chan

I want to add an additional to the default Links list template.

I added following piece of code in the schema.xml


Code Snippet
<Field Type="Boolean" Name="OpenInNewWindow" DisplayName="Open in New Window" Required="TRUE" CanToggleHidden="TRUE" Hidden="FALSE" AllowDeletion="FALSE" ShowInDisplayForm="TRUE" ShowInEditForm="TRUE" ShowInNewForm="TRUE" ShowInViewForms="TRUE" Viewable="TRUE" ></Field>

However the field doesn't show up in new or edit form.

I saw the column is created, I can even edit it if I switch to Datasheet mode.

Anyone could help

Thanks.

Jason



Re: SharePoint - Design and Customization Additional field doesn't show up in New/Edit form

Curtis Ruppe (MicroStaff IT)

Temporarily enable Management of Content Types, then add this new column into your content type, then disable management of content types. This should get your column to display in your New / Edit / Display forms.



Re: SharePoint - Design and Customization Additional field doesn't show up in New/Edit form

Jason Chan

As I know, changing the Content Type is affect within the same site collection only. I want to apply the changes to all site collections.

Finally I solved this by modified the \FEATURES\ctypes\ctypewss.xml

In the Content Type of Link Link (ID = 0x0105), I added

Where {47F68C3B-8930-406f-BDE2-4A8C669EE87C} is the ID of a built-in boolean field.

Then In the \FEATURES\LinksLink\Links\schema.xml

I added

Code Snippet


<Field ID="{47F68C3B-8930-406f-BDE2-4A8C669EE87C}" BaseType="Boolean" Type="Boolean" Name="OpenInNewWindow" DisplayName="Open in New Window" Required="TRUE" CanToggleHidden="TRUE" Hidden="FALSE" AllowDeletion="FALSE" ShowInDisplayForm="TRUE" ShowInEditForm="TRUE" ShowInNewForm="TRUE" ShowInViewForms="TRUE" Viewable="TRUE" >
</Field>

Now the check box of "Open in New Window" appear in all existing Links list as well as newly created Links list.

Why I do so because I want to add a "Open in New Window" option of the link. I post my code for those who interested.

In the Links\schema.xml

Code Snippet

<Field ID="{2a9ab6d3-268a-4c1c-9897-e5f018f87e64}" ... Name=URLwMenu">

<FieldRefs>

....

<FieldRef Name="OpenInNewWindow" /> <!-- add this -->

</FieldRefs>
<DisplayPattern>

..........
<Default><HTML><![CDATA[<A onfocus="OnLink(this)" ]]></HTML>
<IfEqual>
<Expr1>
<Column Name="OpenInNewWindow" />
</Expr1>
<Expr2>1</Expr2>
<Then>
<HTML><![CDATA[ target="_blank" ]]></HTML>
</Then>
<ELSE>
</ELSE>
</IfEqual>
<HTML><![CDATA[ HREF="]]></HTML>

...

</DisplayPattern>

Doing similar code for the Field "URLNoMenu"




Re: SharePoint - Design and Customization Additional field doesn't show up in New/Edit form

Curtis Ruppe (MicroStaff IT)

Good call. Just know this isn't a best practice. Microsoft recommends never changing their default schemas / XML files. Instead create a new list defintion feature with your implementation.





Re: SharePoint - Design and Customization Additional field doesn't show up in New/Edit form

radofan

Curtis Ruppe (MicroStaff IT) wrote:
Temporarily enable Management of Content Types, then add this new column into your content type, then disable management of content types. This should get your column to display in your New / Edit / Display forms.
how do I enable Management of Content Types
thanks