Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have created a publishing layout for SP 2010 Publishing site. I have created it based off a page layout publishing content type. One of the field is the standard OOTB Date field. Using SP Designer 2010 to create layout I added the page field to the layout. SO here is the issue. When a user creates a page using this layout they select the date from the standard calendar picker. When the page is saved it displays in the format mm/dd/yy I need to have ot look like April 1, 2011. How can I achieve this?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

I had to do something like this a hwile ago.

You'll need to create a calculated column in the content type used by your page. The formula should be something like =TEXT([ArticleDate], "MMMM DD, YYYY") - call your calculated column something like "FormattedArticleDate". Set this column to update lists where it's used.

Then, in SharePoint Designer, you'll want to use EditModePanels to show the ArticleDate field when in Edit Mode, and then your Calculated Column when in Display Mode.

The calculated column will not show in Edit Forms, as it's calculated on the fly when data is added.

HTH

share|improve this answer
    
Spot on. Just thought it was worth mentioning for the benefit of people arriving here who only want to change date format locale (a common request in the UK); you can do this in Site settings->Regional Settings. –  SPDoctor Apr 1 '11 at 16:31
    
James, I am new to edit panels in Designer. I see where it is an available control. However I also see an editmodepanel that is already in layout. However it isn't wrapped around any fields. Looks like just a standard part of layout. So I guess my question is where to position the panels in relation to the layout. Also fuzzy on the syntax of the code I need. –  Paul Akerlind Apr 1 '11 at 17:38
    
You put the controls you want hidden or shown within the panel. The panel can go anywhere in the layout as long as it's within an asp:Control tag. You'll need to create two panels, one with DisplayMode="Edit" and the other with DisplayMode="Display". Simply place the two panels next to each other on the page to have them render in the same location when the page is in either mode. –  James Love Apr 1 '11 at 17:43
    
Awesome...Worked. One last point. When I add a page based on the layout and new Ctype I see a a date like this December 30, 1899. I want the page to be have no date. You can go into edit mode and select new dates and they appear on the page fine. My question is what is up with the initial date I see on the page. –  Paul Akerlind Apr 1 '11 at 18:32
    
That'll be what's returned when it's blank. Solution I think is to make the article date field compulsory. –  James Love Apr 1 '11 at 22:08
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.