Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Help with Schema.xml File

  Asked By: Amos    Date: May 02    Category: Sharepoint    Views: 2980

I am trying to make a change to the definition of a links list. Specifically, I
would like to have one of the options in my view be to display the URL in a new
window. I am very close, but I need someone to hopefully get me to that last
step.

What I have done is add a Field section to the Fields portion of the Metadata
section.

<Field ReadOnly="TRUE" Filterable="FALSE" Type="Computed"
Name="URLinNewWindow"
DisplayName="URL" DisplayNameSrcField="URL"
AuthoringInfo="(URL in New Window)" >
<FieldRefs>
<FieldRef Name="URL"/>
</FieldRefs>
<DisplayPattern>
<HTML><![CDATA[<A target=new HREF="]]></HTML>

<!-- The line below needs to change -->
<Column2 Name="URL" HTMLEncode="TRUE"/>


<HTML><![CDATA[">]]></HTML>
<Column2 Name="URL" HTMLEncode="TRUE"/>
<HTML><![CDATA[</a>]]></HTML>
</DisplayPattern>
</Field>

I have figured out that the piece of code above will add a new option to the
columns list when I create a new view or edit an existing one. However, the
display pattern I have defined renders the HTML as follows (using Yahoo.com as
an example).

<a target=new href="Yahoo Home Page">Yahoo Home Page</a>

When instead it should display as
<a target=new href="http://www.yahoo.com">Yahoo Home Page</a>

How do I get the line that I identified to render the actual URL portion of the
field, and not the URL description?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Daron Oneill     Answered On: May 02

This isn't a direct answer (sorry) but check out Andrew Connell's article on
doing the same thing:
andrewconnell.com/.../...sListOpenInNewWindow.aspx

 
Answer #2    Answered By: M Juarez     Answered On: May 02

That article was very useful. I figured out that what I needed to change  was in
fact the line  I identified, with the change going from
<Column2 Name="URL" HTMLEncode="TRUE"/>

to
<Column Name="URL" HTMLEncode="TRUE"/>

As "Column" refers to the first part of the URL field  (the hyperlink itself) and
that "Column2" refers to the second part (the description  portion).

 
Didn't find what you were looking for? Find more on Help with Schema.xml File Or get search suggestion and latest updates.




Tagged: