-
Sharepoint Designer HTML Emails
Posted on April 22nd, 2009 4 commentsBeen working on a lot of tweaks to a registration site we are creating. I’ve been working through all of the notifications that are being sent out by the system. Plain Text is ok, but HTML is better. If you plan to use HTML in the work flow emails, there’s one tip I can give you, remove all spacing and avoid an indented structure.
I think Exchange does not like the way the HTML emails come over and interprets extra spaces as line breaks.
What I did was to create a well formed HTML page in Dreamweaver so I could sort it all out properly. After it was completed, backspace was my friend and the resulting code I pasted into my email step was:
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><p style="font-family:Georgia, 'Times New Roman', Times, serif">Dear '',</p><p style="font-family:Georgia, 'Times New Roman', Times, serif">This is a confirmation that you are scheduled to teach ' ' on ' ' located at ' '.</p><p style="font-family:Georgia, 'Times New Roman', Times, serif">Click <a href="https://mydomain/sites/CFERegistration">here</a> to view the CFE Workshop Registration site.</p><p style="font-family:Georgia, 'Times New Roman', Times, serif">Sincerely,<br /><a href="http://www.mydomain/cfe">Center for Faculty Excellence</a><br />Questions or comments, <a href="mailto:CFE@mydomain?subject=CFE Workshop Registration">email us</a>!</p></body></html>
I then went in and added all the Sharepoint lookups into my email where I wanted them and it started firing off emails as I wanted them.
In short, compact that HTML and remove all the structure you may be used to.
Plurk This Post
Buzz This Post
Delicious
Digg This Post Stumble This Post -
Minor Oversight in Ten Themes for Sharepoint
Posted on April 16th, 2009 No commentsThe 10 new Sharepoint themes that were released in March are absolutely great. They really give Sharepoint sites a different feel. However they have been released with a minor flaw. There is no styling for the Calendar! I don’t know if this was an oversight or what but the calendars still have the default blue coloring.
I suggest grabbing Heather Solomon’s Calendar CSS and include in any site where you plan to use these themes.
Plurk This Post
Buzz This Post
Delicious
Digg This Post Stumble This Post -
Sharepoint Saturday DC
Posted on April 14th, 2009 No commentsSharepoint Saturday in Washington DC is rapidly approaching and I can’t wait! I just saw on Twitter today that Paul Galvin is going to be presenting. I’m also looking forward to meeting Mark Miller, founder and editor of EndUserSharepoint.com. I’ve had a guest article posted there and have been helping on the Stump the Panel forums, which is a great resource for end users.
Registration for Sharepoint Saturday opens April 16th. You can see all the details at Sharepoint Saturday. I look forward to seeing everyone there and the Sharepint session!
P.S. I’m staying at the Regency.
Plurk This Post
Buzz This Post
Delicious
Digg This Post Stumble This Post -
Modifying Employee Training template
Posted on April 8th, 2009 2 commentsIn my last blog post, I mentioned I was starting to dislike the fab 40 templates. This post describes how we (myself and my colleague Tony Miller) fixed an inherent issue with one of these templates. This post goes into steps done after following these three blog posts:
- Employee Training and Scheduling Template – a couple fixes Part 1
- Employee Training and Scheduling Template – a couple fixes Part 2
- Employee Training and Scheduling Template – a couple fixes Part 3
Here is some background on the template if you aren’t familiar. The site is designed so that an instructor can add courses they wish to teach to a list. Users come into the site and see the courses available and click a link to go to the Dispform to register. However there is a glaring security issue here. The navigational bar is present for users to delete a course! If a permission level is created to stop them from deleting items, then they can’t unregister for a course. This bar also contains a function to export the item to Outlook.
So what do we do to fix it? I hope that’s why you’re reading.
The first thing I did was to create a calculated column in the course list that creates an iCal hyperlink. I created the function as =CONCATENATE(”https://MyDomain/sites/cferegistration/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List=%7B242652E5%2D0492%2D4C2F%2D8B37%2D06C9A59B0020%7D&CacheControl=1&ID=”,ID,”&Using=event.ics”). Easy enough. I then used a little of Paul Grenier’s jQuery magic to clean that up. Functionality restored for the users. Now to get it on the Dispform.
Here I opened Sharepoint Designer and opened the Dispform associated with the Courses list. I added @iCal, iCal to the XSL data fields at the top of the transform. Then I added
<tr style="display: none"> <td width="190px" valign="top" class="ms-formlabel"> <H3 class="ms-standardheader"> <nobr>Export to Outlook</nobr> </H3> </td> <td width="400px" valign="top" class="ms-formbody"> <xsl:value-of select="@iCal/> </td> </tr>
an thought I’d be golden. well, I was wrong. It created a nightmare of a URL and needed a way to make a nice hyperlink so users could just click it and save the item. After about an hour of trying all sorts of things, Tony realized that Sharepoint was using XSL version 1.0. With this in hand we were able to utilize a replacement function to clean out the amp; values and create a nice hyperlink.
We added
<xsl:template name="replace-substring"> <xsl:param name="original"/> <xsl:param name="substring"/> <xsl:param name="replacement" select="''"/> <xsl:variable name="first"> <xsl:choose> <xsl:when test="contains($original, $substring)"> <xsl:value-of select="substring-before($original, $substring)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$original"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="middle"> <xsl:choose> <xsl:when test="contains($original, $substring)"> <xsl:value-of select="$replacement"/> </xsl:when> <xsl:otherwise> <xsl:text></xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="last"> <xsl:choose> <xsl:when test="contains($original, $substring)"> <xsl:choose> <xsl:when test="contains(substring-after($original, $substring), $substring)"> <xsl:call-template name="replace-substring"> <xsl:with-param name="original"> <xsl:value-of select="substring-after($original, $substring)"/> </xsl:with-param> <xsl:with-param name="substring"> <xsl:value-of select="$substring"/> </xsl:with-param> <xsl:with-param name="replacement"> <xsl:value-of select="$replacement"/> </xsl:with-param> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="substring-after($original, $substring)"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:text></xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="concat($first, $middle, $last)"/> </xsl:template>to the top of the transform after the following code.
<xsl:variable name="dvt_1_automode">0</xsl:variable>
Then we changed the values being displayed by altering the output code to:
<tr> <td width="190px" valign="top" class="ms-formlabel"> <H3 class="ms-standardheader"> <nobr>Export to iCal</nobr> </H3> </td> <td width="400px" valign="top" class="ms-formbody"> <xsl:variable name="iCalLink"> <xsl:call-template name="replace-substring"> <xsl:with-param name="original" select="@iCal"/> <xsl:with-param name="substring" select="string('amp;')"/> <xsl:with-param name="replacement" select="string('')"/> </xsl:call-template> </xsl:variable> <a href="{$iCalLink}">Export to iCal</a> </td> </tr>Now we had a working hyperlink in our item details.
Whew, almost done! Last cleanup item is to remove the toolbar so users cannot delete items. We cranked up Firefox and Firebug and found the toolbar easily enough. A few console trial and errors and we had removed it. Instead of putting it into a CEWP like I normally would, I just added it to the page head on the dispform. That code is:
<script type="text/javascript"> $(function() { $('table[@id$=toolBarTbl].ms-toolbar').remove(); }); </script>
Save, refresh and viola! the dispform now looks like the below image. This might not have been the easiest method to do this, and I’d be happy to hear other ways of doing it.
Plurk This Post
Buzz This Post
Delicious
Digg This Post Stumble This Post -
Fab 40 templates and why I’m starting to dislike them
Posted on April 7th, 2009 No commentsSo in theory the Fab 40 pack of Sharepoint templates seem pretty nice. They provide predefined templates to help resolve business processes. Great, well not so much. I thought these would be great for our environment to help end users solve some basic needs. Before I rant, I just want to say that I appreciate the efforts of those that made these templates and thank them for making them available for free to WSS and MOSS users.
One of the first templates to get deployed was the Employee Training template to help resolve a complex registration system for faculty seminars. After some major rework, this will be great. The template deploys with a few bugs as detailed by Paul Galvin and several other outlets. These are fixes on top of other customizations that need to be done.
The next template to be deployed was the case management template. It’s ok, no bugs, just a lot customizations and some bad design choices. Case in point, the Department for a new case. This should have been defined as a look up column instead of a single line of text. This structure allows users to specify different iterations of the same department on how they choose to enter the data. Enforcing uniform data by using a choice column type or preferably a look up list would allow for uniform data input.
The time spend going through and redesigning the structure, template calls and customizations is not worth the effort I am seeing. The best approach is to use these templates as a baseline for end users. If a user likes the Lending Library template, open it up analyze what it does and build a new site collection from scratch employing good design practices. In the long run, it’ll take less time getting the site up from scratch instead of reworking someone else’s vision of how your business practice will work.
What I’d like to see out of this is the templates brought down, redesigned/fixed and redeployed so that that are more usable out of the box.
Plurk This Post
Buzz This Post
Delicious
Digg This Post Stumble This Post -
Great no code solutions
Posted on April 3rd, 2009 No commentsThis week Laura Rodgers and Woody Windischman published a couple great blog articles for no code solutions for Sharepoint. These are basic yet highly usable solutions for a drop box for users to upload files that others can’t get access to and a great way to expose libraries (or lists) using the Sharepoint web services. I’ve gone through both of these articles in my test site and all I can say is WOW!
I love seeing solutions like this because I am a horrible code writer. So Laura and Woody, keep these great ideas coming for all the non-developers out there. We appreciate and thank you for your efforts.
I Love the SiteData.asmx Web Service
Using legacy FrontPage functionality in SharePoint and SharePoint Designer to create a file “drop box”
Plurk This Post
Buzz This Post
Delicious
Digg This Post Stumble This Post



