New Form Field Not Displaying on Publishing Page - SharePoint 2007 - sharepoint

I'm updating a publishing page in SP 2007 to include two hyperlink fields.
I've added the site columns and site content types, and updated the page layout with:
<SharePointWebControls:CurrencyField FieldName="ExistingField1" runat="server" />
<br />
<SharePointWebControls:UrlField FieldName="NewField1" runat="server" />
<br />
<SharePointWebControls:CurrencyField FieldName="ExistingField2" runat="server" />
<br />
<SharePointWebControls:UrlField FieldName="NewField2" runat="server" />
When I open the page in edit mode, neither of the two newly added fields are there. The page source simply displays the old fields with an addition where the new field should be.
<div align="left" class="ms-formfieldcontainer"><div class="ms-formfieldlabelcontainer" nowrap="nowrap"><span class="ms-formfieldlabel" nowrap="nowrap">Existing Field 1</span></div><div class="ms-formfieldvaluecontainer"><span dir="none">
<input name="ctl00$PlaceHolderMain$EditModePanelB$ctl49$ctl00$TextField" type="text" id="ctl00_PlaceHolderMain_EditModePanelB_ctl49_ctl00_TextField" title="Existing Field 1" class="ms-input" Size="11" style="ime-mode:inactive;" /><br>
</span></div></div>
<br />
<br />
<div align="left" class="ms-formfieldcontainer"><div class="ms-formfieldlabelcontainer" nowrap="nowrap"><span class="ms-formfieldlabel" nowrap="nowrap">Existing Field 2</span></div><div class="ms-formfieldvaluecontainer"><span dir="none">
<input name="ctl00$PlaceHolderMain$EditModePanelB$ctl51$ctl00$TextField" type="text" id="ctl00_PlaceHolderMain_EditModePanelB_ctl51_ctl00_TextField" title="Existing Field 2" class="ms-input" Size="11" style="ime-mode:inactive;" /><br>
</span></div></div>
<br />
I have checked a dozen times to make sure my Field Names are typed correctly and checked the layout in, then out, and approved the layout multiple time.
Any ideas?

I figured out what was going wrong. The new columns also have to be added to the page list in addition to the site column and content types. I should have seen that one coming from a mile away. (Forehead meets desk) =P

Related

How to pass input text value as portlet param

I have a portlet page:
<%# taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<portlet:defineObjects />
<portlet:resourceURL var="resourceUrl">
<portlet:param name="startDate" value="" />
</portlet:resourceURL>
<input id="startdateexportaging" type="text" />
<a style="font-size: 15px;" href="${resourceUrl}" >URL</a>
How to pass the content of startdateexportaging as portlet param startDate when clicking the link with resourceUrl?
You could use an onclick handler to add the content to the URL as soon the link is clicked. But that would be cumbersome, error prone and not necessary.
Instead you should add your input to a form and define the URL as action parameter:
<aui:form action="<%= resourceUrl.toString() %>" method="get">
<aui:input name="startDate" type="text" />
<aui:button value="Download" type="submit" />
</aui:form>
(if you don't use AUI - you can use simple HTML tags as well)
Another advantage of this solution: A button instead of a link makes it easier for the user to understand that the content from the text field is submitted. Compare it with the use of links and buttons here on SO - if you enter some information you have to hit a button.
And it is easier for search engines to parse the website, as those try to follow links - but ignore buttons.

Custom Links/Buttons in SharePoint Online 2010 Ribbon

I'm new to SharePoint and am looking to add some custom links or buttons to the ribbon (only want these to show on the ribbon when the advanced ribbon menu controls are not showing, if that makes sense). I'm on SharePoint Online (2010 edition, but will convert to 2013 shortly).
Here's a screenshot of where I'm looking to add links or buttons.
I think the code section in the v4.master that controls this area is this section but I'm having problems getting my links to show up in the correct area.
<div class="s4-trc-container-menu">
<div>
<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false">
</wssuc:Welcome>
<wssuc:MUISelector ID="IdMuiSelector" runat="server"/>
</div>
</div>
Any suggestions? Much appreciated!
Assuming that you are using v4.master as your master page (default), there is a control with an ID of "RibbonTabRowRight" that surrounds the code snippet you have posted.
Any links and buttons that you want to add should go within this control, and before the Welcome Menu (the snippet you have posted). Whether you use a simple anchor tag or a more complex control depends on your requirements.
Example:
<SharePoint:SPRibbonPeripheralContent
runat="server"
Location="TabRowRight"
ID="RibbonTabRowRight"
CssClass="s4-trc-container s4-notdlg">
<SharePoint:DelegateControl runat="server" ID="GlobalDelegate0" ControlId="GlobalSiteLink0" />
<div class="s4-trc-container-menu">
<a href="EXAMPLE.ASPX" />MY EXAMPLE</a>
<div>
<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false">
</wssuc:Welcome>
<wssuc:MUISelector ID="IdMuiSelector" runat="server"/>
</div>
</div>
<SharePoint:DelegateControl ControlId="GlobalSiteLink2" ID="GlobalDelegate2" Scope="Farm" runat="server" />
<span>
<span class="s4-devdashboard">
<Sharepoint:DeveloperDashboardLauncher
ID="DeveloperDashboardLauncher"
NavigateUrl="javascript:ToggleDeveloperDashboard()"
runat="server"
ImageUrl="/_layouts/images/fgimg.png"
Text="<%$Resources:wss,multipages_launchdevdashalt_text%>"
OffsetX=0
OffsetY=222
Height=16
Width=16 />
</span>
</span>
</SharePoint:SPRibbonPeripheralContent>

SharePoint 2010 - RichImageField not displaying in display mode

I am currently doing some research into SharePoint Page Layouts and building pages based on those layouts.
I currently have a page layout containing several RichImageFields and RichHtmlFields, but it seems that the first RichImageField is not displaying (doesn't even render out anything).
As far as I can see, he's the same as the others:
<div id="headerImage">
<PublishingWebControls:RichImageField id="HeaderImage" FieldName="HeaderImage1" runat="server"/>
</div>
<div id="middleContent">
<div id="left">
<div id="about">
<fieldset>
<legend>About</legend>
<PublishingWebControls:RichHtmlField ID="About" FieldName="AboutMedicInfo1" runat="server"/>
</fieldset>
</div>
<div id="items">
<h1>
<SharePointWebControls:FieldValue FieldName="ItemsTitle1" runat="server"/></h1>
<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
<SharePointWebControls:TextField runat="server" FieldName="ItemsTitle1" />
</PublishingWebControls:EditModePanel>
<div id="Item1">
<fieldset>
<legend>
<SharePointWebControls:FieldValue FieldName="Item11" runat="server"/></legend>
<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
<SharePointWebControls:TextField runat="server" FieldName="Item11" />
</PublishingWebControls:EditModePanel>
<PublishingWebControls:RichHtmlField ID="Item1" FieldName="Item1Content1" runat="server"/>
</fieldset>
</div>
<div id="Item2">
<fieldset>
<legend>
<SharePointWebControls:FieldValue FieldName="Item21" runat="server"/></legend>
<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
<SharePointWebControls:TextField runat="server" FieldName="Item21" />
</PublishingWebControls:EditModePanel>
<PublishingWebControls:RichHtmlField ID="Item2" FieldName="Item2Content1" runat="server"/>
</fieldset>
</div>
</div>
</div>
<div id="center">
<div>
<PublishingWebControls:RichImageField id="HighLight1" FieldName="HighLight11" runat="server"/></div>
<div>
<PublishingWebControls:RichImageField id="HighLight2" FieldName="HighLight22" runat="server"/></div>
<div>
<PublishingWebControls:RichImageField id="HighLight3" FieldName="HighLight32" runat="server"/></div>
</div>
<div id="right">
<div id="report">
<PublishingWebControls:RichHtmlField ID="Report" FieldName="Report" runat="server"/>
</div>
<div id="webparts">
<WebPartPages:WebPartZone runat="server" Title="Rechtsonder" ID="BottomRightControl"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone></div>
</div>
</div>
</div>
The funny thing is that I'm perfectly able to see the image when I'm in editing mode and when I'm viewing the Page Library items (after I added the specified field to the view).
Does anyone have any experience with this? Feel free to ask further questions if I might be unclear.
Okay, I should have checked before posting my initial question. It turned out that my problem was because I was using the Page content type, instead of the Article Page or Welcome Page content types. The Page CT doesn't have the field that the image was looking for.
What I find really interesting is that it still let me select the image AND it stored the value somewhere... even though there was no official field for it. I suspect that the field in the library is there, since you would need it for your other content types.
Anyway, hoping that someone else may find this useful.
Make sure that you don't miss the two properties RichText="TRUE" and RichTextMode="FullHtml" of the image field definition to be like:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field
ID="{4ea31e74-f59d-4ddf-863c-607a01735f65}"
Name="pls_H2_2_Image"
DisplayName="Titel 2 Bild"
Type="Image"
Required="FALSE"
RichText="TRUE"
RichTextMode="FullHtml"
Group="Custom">
</Field>
</Elements>
I faced this issue before and this solution did it properly.

Update Wiki pages to display SharePoint Fields and not break Site Definition

I have a requirement to display SharePoint fields as a footer on only certain pages, so this rules out a master page change, and I haven't had any success with plain-old HTML.
What I'm trying to display is the following code:
<SharePoint:DeveloperDashboard runat="server"/>
<div class="s4-notdlg" style="clear:both; background-color:orange; padding:10px">
<SharePoint:CreatedModifiedInfo ControlMode="Display" runat="server">
<CustomTemplate>
<br>Page Contact: <SharePoint:FormField FieldName="Page Contact" runat="server" ControlMode="Display" DisableInputFieldLabel="True" />
<br>Last modified on <SharePoint:FieldValue FieldName="Modified" runat="server" ControlMode="Display" DisableInputFieldLabel="True" />
by <SharePoint:FormField FieldName="Author" runat="server" ControlMode="Display" DisableInputFieldLabel="True" />
<br>Comments: <SharePoint:FormField FieldName="Check In Comment" runat="server" ControlMode="Display" DisableInputFieldLabel="True" />
</CustomTemplate>
</SharePoint:CreatedModifiedInfo>
</div>
When editing the page in Advanced Mode, no matter where I place the code, I break site definition. Is there a good place to insert this code in the page? Or does the Site Definition need to be changed.
Breaking the Site Definition may not be what you are thinking. It is just saying to you that the page is not one of the 'defaults' anymore, as a way to identify what have been customized on the site.
Every edit you make on those pages are like that, so it is OK to get that message. You may also "reset to site definition" when you want to, but this is not usually very stable on my experience.

Add a form with POST method on a SharePoint 2010 page?

The HTML I got asked to add to a page is:
<div>
<div> Click below to enter</div>
<form id="formID" method=POST action="http://www.someWebsite.com">
<input type="submit" name="do_login" value="Log in" />
<input type="hidden" name="username" value="someUsername" />
<input type="hidden" name="password" value="somePassword" />
</form>
</div>
I know I can't add a form like that because there is already on that SharePoint created, I had a look at http://www.sharepointboris.net/2008/09/making-post-and-get-forms-from-sharepoints-pages/ but when I follow the example and save SharePoint still strips out most of the code so how can I achieve what I want in another way?
Thanks in advance.
For our SharePoint 2007 installation, I created a quiz web part. Basically, it pulls questions and answers from a list, but the actual questions are presented and submitted using a form with POST variables. It's probably much more complex and in-depth than you're looking to go, but I made a custom web part to present the form, read the post variables, and execute associated functions. The big plus to using a custom web part is that you're able to put in nearly any content you want, since you're coding it in ASP.NET.
What I did was to create a custom .aspx page (not through the sharepoint gui) with the code I posted in my question, uploaded the page to a library and then linked to it via a page viewer web part
You can get the form to work as normal if you remove the tags and place the form control inside a div like so:
<div>
<div> Click below to enter</div>
<div id="formID" method=POST action="http://www.someWebsite.com">
<input type="submit" name="do_login" value="Log in" />
<input type="hidden" name="username" value="someUsername" />
<input type="hidden" name="password" value="somePassword" />
</div>
</div>
This way sharepoint will accept everything inside the div tags. In a asp.net when you create a page in sharepoint, the whole page is containied withing a form that why sharepoint does not allow you to use another form within it.
Hope this helps

Resources