Archive for Customizations

Make Title column a link

It has been driving me nuts that you have to have a Name column, so you have a link to the files, as well as a Title column, so you know what you are actually clicking on. I found a tutorial for changing a column into a link but it also changed the text of my Title into the link text. So… I copied the code that was generated by that little experiment, grabbed the url that it wrapped, and then added that url around the Title code. Success!

Step By Step:

  1. Create a webpart page and insert your library
  2. Open page in SharePoint Designer
  3. Right-click on the library and select “Convert to XSLT”
  4. Find a Title in the code and wrap it with this url:
  5. titlelink

  6. Now you can delete the Name column: Common DataView tasks > Edit Columns.
  7. Save and preview-Title is now a link and no Name column!

Comments (1)

Creating Teaser Intros for Blog Posts

One thing I have been wanting to do with blog posts is create teaser intros, show x amt of characters of the post followed by a link to read the rest of the post. Sadly, SP does not provide this functionality out of the box. So I Googled the problem and found a site with the solution. The problem is the solution is hard to understand and my eyes glazed over trying to understand what the author was asking me specifically to do. I eventually got the fix to work, and decided that I probably wasn’t the only person who didn’t speak code who might need this solution, so I decided to paraphrase the authors fix in designer-ese… I take ZERO credit for the fix, please visit the author below for the original post:

Original fix/code: http://zabistop.blogspot.com/2009/02/customizing-sharepoint-blog-posts-web.html

Step 1: Open SP Designer
Step 2: Open Blog site in Designer
Step 3: Open default.aspx
Step 4: Click at the very top of the List View Web Part for the posts and then right-click. Select Convert to XSLT Data View:

Step 5: Go into code view and do a find for: ms-postbody. It should bring you to the area of code that you need to swap out. Below is the code that needs to be replaced:

Replace this code...

Replace this code...

Replace with this:

with this code...

with this code...

(aside: I am trying in vain to upload a file that allows you to copy and paste the code, but the crappy WordPress interface wont do it! Can’t add code to the page or the stupid thing tries to execute it, even in code tags! Stupid app!)

The 250 in the last xsl: value snippet is the number of characters of text that is displayed-this number can be whatever you want. You can also change what the “more” link says, maybe to “Read Post” or whatever.

Step 6: Add new xsl template. Add the code below to the top of the page under an existing xsl:template snippet:
blog4

Now save and open the page in your browser.

Leave a Comment