2010 08 12: My current client has a need for clearly indicating content-expiration-related information on every page. Discussion eventually led to having this print out in the footer of every page. There are already people out there who have blogged (and nicely) on how to modify the SP2010 V4.master page to create a footer with static content, but how to include the following dynamic (read “changes for every page”) information?
– Content Owner (a person);
– Content Expiration Date;
– Content Department
– Content Department Head
This became a trickier question, as web pages in SharePoint are – at least from a metadata standpoint – merely SPListItems, and I was convinced there HAD to be a simpler solution than coding up 4 custom SharePoint Server Controls (all deriving from ASP:Label or the like).
Well, it turns out there IS a VERY easy & elegant solution… the already-made SharePoint:ListItemProperty server control !
You’re going to be using our beloved SharePoint Designer 2010 to edit your V4.master page, so here are the steps:
__ LAUNCH SPD2010 and connect to your website.
__ NAVIGATE to the master pages folder
__ CREATE A BACKUP COPY of your V4.master
__ CHECK-OUT and EDIT your V4.master file in “Split” coding/display mode:
__ LOCATE the SharePoint:DeveloperDashboard tag near the bottom of the file (popular place recommended by other bloggers for creating footers)
__ INSERT a set of DIV tags
__ INSERT a simple HTML table (mine is a 3×1) into the DIV tag
__ SET your cursor (this is IMPORTANT) in the TD cell of the table (to place it anywhere else potentially changes the CONTEXT of the cursor, and could limit WHAT you can insert from the SPD2010 Tool Ribbon).
__ INSERT a SharePoint:ListItemProperty server control into the TD cell, and configure it for your desire property.
This is actually the COOL part, as the control is SO dumb (or SO elegant – take your pick) that it ONLY understands the context of the current page.. which is PRECISELY what I NEEDED it to do:
__ INSERT the rest of the SharePoint:ListItemProperty server controls until you have what you need.
__ FORMAT the footer HTML table until it pleases your client.
Here’s what you’ll be left with – a pretty cool dynamic footer with truly useful Content Expiration info: