Archive for the ‘Design’ Category

Sep
02
Filed Under (Design, Tips and Tricks, XSLT) by Andy Diericks on 25-04-2007

Again a little tip concerning SharePoint and XSL.

Add the following snippet in the xsl file, for example one of your custom style in the itemstyle.xsl file.

<span class="presence-status-icon">
              By: <a href="http://[MySharePoint]/sites/intranetbelgium/_layouts/userdisp.aspx?ID={$AuthorID}">
                <xsl:value-of select="concat($AuthorName,’ ‘)" />
              </a>
              <img src="/_layouts/images/blank.gif" onload="IMNRC(’{$AuthorEmail}’)" alt="" id="{concat(’MWP_pawn_’,$ClientId,’_',@ID,’type=sip’)}" /> 
  </span>

Tips: you can add "ShowOfflinePawn=1” before the add property in the img tag, this will show the offline picture of OCS if the “AuthorName” is offline. I personnally prefer to remove it, I found that cleaner.



 

The problem: Microsoft provide a way to create custom headers using the file Header.xsl but doesn’t provide the same kind of file concerning the footer. So how to create a style containing a footer and a header?

Inside your new style in the file itemstyle.xsl add the following snippet:

For a header add a test to check if there is a preceding sibling:

<xsl:if test="count(preceding-sibling::*)=0">
This is the header !
</xsl:if>

For a footer add a test to check if there is a following sibling:

<xsl:if test="count(following-sibling::*)=0">
     This is the footer !
   </xsl:if>

That’s pretty easy to do and I hope it can help.



Apr
14
Filed Under (Design, Development, Libraries and Lists) by Andy Diericks on 25-04-2007

Hi, today I will fully explain how to create a “custom action”. For it I will use “Visual studio” and WSPBuilder, you can find it on codeplex.

Our action will appear on the display page of all the items of a custom list. By clicking on it, the user will be redirected to google. A custom action has to be included in a feature, meaning, we will create a standard feature and add code in it to define that we want to create a custom action.

So now let’s get started, you will need to create a new WSPBuilder project (without workflow), when the new project is loaded, choose Add->WSPBuilder->Blank Feature. The system will ask you a name and to choose a scope, in my example the scope choosen is web (for website). If you have done a mistake about the name or the scope, that’ not a problem, you will be able to modify those directly in the XML files.

Now that you’ve created your new feature, you will have in the document explorer an hierarchy like the following picture.

image

Now you have all your structure done, here is the code to include.

The feature.xml file will contains all information about the feature (title, ID, scope,…), use the intellisense to check what is proposed. The important thing is the link to the manifest, in our case, “elements.xml”.

<?xml version="1.0" encoding="utf-8"?>
<Feature  Id="0FE81D03-6AE0-48a0-BBF7-88A1DAA9B04A"
          Title="Import UP"
          Description="Description for Import User Profiles"
          Version="12.0.0.0"
          Hidden="FALSE"
          Scope="Web"
          xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifests>
        <ElementManifest Location="elements.xml"/>
    </ElementManifests>
</Feature>

The elements.xml file define the content of the feature, in our case a custom action. To find the required fields refer to that MSDN link: CustomAction Element (Custom Action) . What is really interesting is the registrationtype, you can register to some different contents in our case the lists and the registrationID refers to the type of list (100=custom list) we want to add the action in. But you can choose a registration of type content type and give the name of it, so that action will be relevant only for that content type. An important thing is to define the location of the action, where it will appear. The URL define where the users will be redirected when clicking on it, it can be, and probably will be in the real life a custom ASPX page.

Refer to that MSDN link to find all the location and GroupID (in the comments too!):  Default Custom Action Locations and IDs

You will see the 2 first columns, location and GroupID, if the GroupID is not empty or not contains N/A, you will have to include it in your custom action element, an example is done at the end of the post.

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
        Id="CustomActionGetUerProfiles.CustomAction"
        Location="DisplayFormToolbar"
        Title="Import Users"
        RegistrationType="List"
        RegistrationId="100"
        Sequence="10"
         Description="The description" RequireSiteAdministrator="FALSE">
        <UrlAction Url="http://www.google.com"/>
    </CustomAction>
</Elements>

Now that you have your two files, your custom action is ready to be deployed, using WSPBuilder, simply choose, “Deploy”. Refresh the page and go to a custom list, if everything goes well when you will click on the view item button, on the next page, above, you will see our “Import user” action. By clicking on it you will be redirected to google.

image

image

If in the elements.xml you change the location to Location=”Microsoft.SharePoint.StandardMenu” and include GroupID=”ActionsMenu”, your action will be now on the toolbar of the list in the Action menu and the click will redirect you again to google.

image

Have a nice day !



Apr
02
Filed Under (Design, SharePoint Designer, Tips and Tricks) by Andy Diericks on 25-04-2007

No, the blog isn’t transformed into a warez board, that’s the real thing. ;-)

Since the 03/31/2009, you can freely download it directly from the microsoft site, link is below.

After the news about setting a part of the BI stack of Microsoft, PerformancePoint, for free to the enterprise CAL customers, it’s now the turn of the SPD 2007 to be free.

That will probably leverage again a bit higher the reasons to go for SharePoint for the futures customers.

LicenKeySPD2007

 

For the time being saying to  them:"Ok you’ve bought an expensive piece of software even if it’s a killer-app, now you have to buy for each of you’re developers or designers a new office 2007 licence".

The answer is rather often:"Oh, it’s not included in SharePoint or Visual Studio ?"

 

And now I’m waiting for Infopath for free ;-)

The download link:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=baa3ad86-bfc1-4bd4-9812-d9e710d44f42



Aug
03
Filed Under (Design, Tips and Tricks) by Andy Diericks on 25-04-2007

One question of my customer today was: Can I show a Flash file on a page ?

He provides me an HTML and the SWF files.

I’ve found two easy solutions:

  • The first, for somebody who don’t know HTML and has receive an HTML file and the flash animation (from a designer or somebody like that), is to upload both files in a library and display the HTML file in a “Page Viewer” webpart. It’s easy and after some clicks you have done it. It can really give a nice look and feel to your site, for internal or external communications for example.
  • The second method and the more obvious is to upload the “.swf” file in a library and add a “Content Editor” webpart on the page. After that edit in source mode and fill with a piece of html, I provided one below but you need to customize it a bit :

<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash
/swflash.cab#version=6,0,29,0″ width=”800” height=”600“>
<param name=”movie” value=”your animation.swf“>
<param name=”quality” value=”high“>
<embed src=”your animation .swf” quality=”high” pluginspage=”http://www.macromedia.com/go/getflashplayer” type=”application/x-shockwave-flash” width=”800” height=”600“></embed></object>

For me the best solution is the second, it’s faster.

Of course it will be another story if you want it on the master page, you will need to play with the “.master” page.  ;-)