locked
Set dynamic default value for a Single line of text column type RRS feed

  • Question

  • Hi all,

    I have a Project name site column(type is Single line of Text) and need to populate it with site name. Since Site name is not known until site is created, how can I deal with this through XML.No coding should be used.And this column is also being used in Roll up process for the site.The Project Name value that is being populated in the text box should be a default value too.

    Thanks,


    Friday, April 1, 2011 6:06 AM

All replies

  • Hi Pa1 Kumar,

    when you say the column is being used in "Rollup process for the site" is the column used in the context of the site or outside of itself?

    Apart from this, I don't believe it's possible to deal with this solely in XML (and by XML, I assume you mean CAML).  Could you give some more info about the kind of site you are using and how you want to use the title?

    Friday, April 1, 2011 10:16 AM
  • Hi Steve,

    I think the column is being used in the context of Site. Means a parent site displays the value of all the sub sites based upon this column. For Eg:- Consider a site X has two sub sites Y and Z. This means that Sites Y and Z have the value as y and z respectively for the site column. These values are displayed in X's Home page as y and z are sub sites of this site. I am using Team site with Publishing features enabled for this.

    Thanks,

     

    Friday, April 1, 2011 11:16 AM
  • Hi Pa1 Kumar,

    I have to admit that I'm still not sure what you're trying to achieve.  Having re-read your question and response again, I wonder if a Table of Contents web part would do what you need as it will roll up sub-sites using the site Title property.  You may be able to customise the XSL to filter your results perhaps?  It's a little dirty, but may help.

    Friday, April 8, 2011 11:06 AM
  • Hi Steve,

    You mean to Say that I should use a Table of Content Web part instead of Content Query Web Part which is Conventionally used in roll up.For your Clarity I will repeat my requirement again. I have a Site X and it has two sub sites Y and Z. They have some lists with same content types in both parent and Children sites.Now I want to display the child sites in the home page of Parent site(viz X).I thought a content query web part will do. More over I have already told that they have lists of same content types.So in them there is a column called as Project Name which is by default the name of the sub sites.So this should be autopopulated and should be default value too. I am trying to roll up in Parent site using this column in sub sites.I understood that from your answer I should use a Table Of Contents web Part inseate dof CQWP right...?So my question here is that How can I declare using list definition the Project Name column so that it gets the default site name value when ever the site is created.

    Thanks,

    Saturday, April 9, 2011 5:37 PM
  • Hi Kumar,

    You can use TOC web part (as per your suggestion), other complex option is to use Feature Stapler-Stapling. By using Feature stapling, whenever you create a new site, it will populate the required List using SharePoint object model.

     

     


    Thanks and Regards, Avinash | avinashkt.blogspot.com
    Monday, April 18, 2011 11:43 AM
  • If you don't want to write code, an easy (though manual) way to accomplish this would be to use a list column (instead of a site column) and set the default value for each list.
    Paul Olenick SharePoint/FAST Architect , MCTS http://olenicksharepoint.wordpress.com/
    Saturday, April 23, 2011 2:00 PM