Tuesday, 28 February 2012

Sharepoint Custom Announcements View

Have you ever Created an Announcement list and seen how badly the Announcements view?


In this Blog post I'll take you through how to create a new DisplayForm for the Announcements page but also how to apply it as the default.


This blog is assuming that you are using Sharepoint Designer 2007 and MOSS 2007



After:








Step 1 )

Load up Sharepoint Designer and Navigate to the Site Collection that your Announcements list resides.
e.g http://yoursite/


Create a New aspx page: 


File > New > Aspx


Step 2)


Click Insert > SharePoint Controls > Custom List Form

Once you have selected the Custom List Form you will be presented with a few options:




Choose Announcements List and their should only be one Content type available which will be 'Announcement'


Select Display item form (used to view list items) as we want to display existing forms & uncheck 'Show standard toolbar'


Once this is completed a new display form is created which you can edit the page to your requirements - I won't be going through this today but will in a later blog post.


Step 3)

Save your Form into the Announcements list folder

e.g yoursite > Lists > Announcements and Save the form as newdispform.aspx


Step 4)

To actually be able to use this new display form you have created you will need to make it the new display default for the list.

To do this step go to the following :

Yoursite> Lists - this will display all the existing lists in your site that is open


Right click on the Announcements List and Click properties this will bring up the List Properties Window

Step 5)

Once the List Properties window is open click the Supporting Files Tab and you will see the following options:



Step 6)
Navigate down to the Display item form option and select browse this will allow you to set the default display form.

Navigate to the newdispform.apx page we created Click OK and were done!



Before:

Thursday, 26 January 2012

Sharepoint 2007 - showing things per permission level

In Sharepoint 2007 it's common to find a scenario where you need all your users to have read access to the page but then want to display a certain object to users with a different level of permission.

Example:

In my Sharepoint 2007 Environment everyone can view an Announcement but had a requirement to make it easy for content owners to edit an Announcement from the same page.

My Solution was to add an Edit Icon that only users with Contribute level of access for this list can access.

Yes if you add a web part and use 'Audience Targeting' it will essentialy do the same thing but the thing with Audience Targeting is you will most likely have to create a seperate group for this and the web part will have it's limitations.

So How do we do it?
the IfHasRights function is the key, add this code infront of what you are wanting to show to users with a certain permission and it will


 <xsl:if test="ddwrt:IfHasRights(2)">
                yourcodehere


       </xsl:if>

Add the number in the code to what level of permission they require to see the object

ViewListItems - 1
AddListItems - 2
EditListItems - 4
DeleteListItems - 8
ApproveItems - 16
OpenItems - 32
ViewVersions - 64
DeleteVersions - 128
CancelCheckout - 256
PersonalViews - 512
ManageLists - 2048
ViewFormPages - 4096
Open - 65536
ViewPages - 131072
AddAndCustomizePages - 262144
ApplyThemeAndBorder - 524288
ApplyStyleSheets - 1048576
ViewUsageData - 2097152
CreateSSCSite - 4194314
ManageSubwebs - 8388608
CreateGroups - 16777216
ManagePermissions - 33554432
BrowseDirectories - 67108864
BrowseUserInfo - 134217728
AddDelPrivateWebParts - 268435456
UpdatePersonalWebParts - 536870912
ManageWeb - 1073741824
UseRemoteAPIs - 137438953472
ManageAlerts - 274877906944
CreateAlerts - 549755813888
EditMyUserInfo - 1099511627776
EnumeratePermissions - 4611686018427387904
FullMask - 9223372036854775807

Tuesday, 4 October 2011

MOSS 2007 Search Results no longer showing icons

In an attempt to Add PDF icon to the search results I had to edit the DOCICON.xml file which is located at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML

If you make any errors or do not close your mapping keys off properly your search results will be corrupt and no longer show any search result icons.

TIP - If you have just added the PDF document to the DOCICON.XML make sure there isn't already the same entry as this will also cause the file to corrupt.