SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a page layout, and this is what I have ...

<!-- Title -->
<SharePointWebControls:TextField FieldName="Title" runat="server" ID="Title" CssClass="emedia-spwc-global"></SharePointWebControls:TextField>

The field displays and edits no problem. But it is just a text field. How do I tell the control I want it to be displayed with in H1 tags with out wrapping the entire control in H1 tags.

Thanks

Mike

share|improve this question
up vote 5 down vote accepted

Use an EditModePanel to display two different controls when editing and displaying:

<PublishingWebControls:EditModePanel runat=server PageDisplayMode="Edit">
    <SharePointWebControls:TextField FieldName="Title" CssClass="emedia-spwc-global" runat="server" />
</PublishingWebControls:EditModePanel>

<PublishingWebControls:EditModePanel runat=server PageDisplayMode="Display">
    <h1>
        <SharePointWebControls:FieldValue FieldName="Title" CssClass="emedia-spwc-global" runat="server" />
    </h1>
</PublishingWebControls:EditModePanel>
share|improve this answer
    
Wow again Whitelaw! That was perfect! Thanks ... again – mdumka Nov 10 '12 at 4:44

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.