Anonymous access and 401 Unauthorized – Sign out first

I have just been attempting to configure anonymous access on a MOSS publishing site, and was getting quite frustrated when I continued to receive ‘401 Unauthorized’ error messages. In Central admin – I extended site to extranet and configured anonymous access on the Extranet site.

  1. Opened the extranet site, set anonymous access to ‘Entire site’ in the advanced permissions for the site
  2. Turned off ‘integrated windows authentication’ in Extranet site (in Central admin) to test as an anonymous user
  3. refresh the extranet site again and bam – 401 error

After thinking about it for a while I realised it may still be trying to access authenticated components. So if you experience the same problem, try this simple answer. Before you do step 3 above, make sure you log out of your session on your extended extranet or internet site first, and then turn off integrated windows authentication on the Extranet site in Central Admin. When you return to the extranet site and refresh, it won’t try refresh the authenticated version of the site. 



SP1 Publishing Additions

The other day I stumbled across some new additions to the properties of publishing pages that MOSS Service Pack 1 has given us.

If you view the properties of a Publishing page, you can now see that the Schedule End Date has some extra email review options.

Never – send a content review. This can be used if you don’t want the page to actually expire and disappear on a certain date, but you can now send a regular email to authors reminding them to update their content. Before SP1 you had to write some code to achieve this.

On the following date – Notify Page Contact prior to end date. Now with SP1 you can set this option to send an email before the page expires. Very handy for easy setting of automatic reminders.

Page Contact – With SP1 you can now add a contact picture if you manually add a contact rather than picking a SP user.



Pre-SP1 publishing screen


Custom Alerts

In SharePoint 2007 we have a great feature called Alerts, basically it sends an email when something in a list or library (or view) is changed. I’m sure I don’t need to tell anyone about them, but when it comes to actually applying them, it would be ideal to be able to customise the alerts for your own application.

So not only might you want to change the presentation of the email that you send as an alert, but you may also want set certain custom conditions for when an alert is triggered.

The alert template xml file is located in the 12 Hive at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\alerttemplates.xml, if you open the file you will see all the different alerts for each type of list/library. Read the rest of this entry »

Using a word 2003 XML template with SharePoint List data

So how do you generate a word formatted document from a template doc, that substitutes placeholders with SharePoint list data?

Say for example you have a standard agreement or contract style document that you want to generate for new clients. You have your standard word 2003 template (doc) where you’d like to automatically populate data such as clients name, address, phone number etc. from your data already contained inside a SharePoint list.

Well there are a couple of approaches you could take:

1.       Use InfoPath – this is easy to connect to SharePoint data, however not as flexible to modify text etc if the contract wording changes

2.       Use Word 2007 – there is automatic ‘Document Property’ fields which you can add as placeholders, and if your template is uploaded to a library on your SharePoint site you can connect these fields to your library or content type fields.

3.       Or, if you want to save your output file as .doc and not .docx for compatibility reasons, you can use word 2003 and save it as a word xml file. This is what I’ll be looking at… Read the rest of this entry »

Posted in MOSS. 1 Comment »

Customise List View page

See previous post for basic steps regarding setting up a DataView.

Open SharePoint Designer (SPD) and edit the dispForm.aspx page of your list. Set up a DataView object on this page that joins your lists, as seen in the previous post.dataviews2_1.jpg

You can modify the layout and text of the Dataview through the ‘Design’ view in SPD, however for more advanced customisations open the ‘Code’ view and start hacking the XSL! Inside the DataFormWebPart (DataView that SPD creates) there is an <XSL > tag where you can modify the html around the data elements, or change the data elements/parameters etc yourself. Read the rest of this entry »

Using XSL to render SharePoint webparts

Certain SharePoint web parts such as the Content by Query web part, Table of Contents web part, and the Summary Links web part have a property that allows you to select the XSL stylesheet that controls the HTML output of the webpart.

This allows us to override the default Microsoft html layout for each of the webparts. Which is fantastic as much of the default html output of web parts is rubbish html code, horrible for accessibility, and also full of sizable and unnecessary html.

For example a html list, such as the Summary Links web part, you would expect to be rendered in a <ul> <li> list tags, but by Microsoft default is rendered as nested tables. Not good…

By default, you can select the type of Item Style you want from the web part properties in the ‘Modify Web Part’ menu option, giving you a list of styles to choose from. The list of these styles corresponds to the xsl templates in the XSL stylesheet.contentqueryxsl1.jpg

So… how to change this or add your own style? Read the rest of this entry »

Replace GUID with List Name in a SharePoint DataView

Recently I was experimenting with DataViews using SharePoint Designer (SPD). Basically the SPD  interface allows you to joins two lists so you can produce a view with merged data, kind of like what you would do with a SQL JOIN query.

Well it works fine for basic queries on a live site, but there are drawbacks for planned development, such as it uses GUIDs of lists rather than a name of the list. As lists have different GUIDs across environments (even if you create a feature/code etc to deploy lists) the DataView will not deploy properly across environments as the GUID will be different.

This can be easily overcome if you open the code view of the SPD page to the Query section. The list ID will be the default GUID of the lists, just change the ListName property of the SPDataView to the Name of the list! Read the rest of this entry »