Thursday, September 26, 2013

How to Embed A PDF into A Webpage

This post will be relatively quick, since the ability to present a PDF file in a webpage within SharePoint is easy!

Materials Needed:

1.    A Text File .txt

2.    Content Editor Web part

3.    A SharePoint Page

The first step to showing the PDF within a webpage is to store the PDF on your SharePoint site where users will be able to access it.  Once you have uploaded your PDF copy the URL for the newly uploaded PDF file.

After you have uploaded the file, create a new text .txt document in Notepad.  Insert the below code into your text file, but replace the “Your URL HERE” with the URL of your PDF File.  Make sure to leave the “  “at each end since that is needed.


<embed src="YOUR PDF URL HERE.pdf" style="width: 100%!important; height: 1000px!important;style="z-index:-5;" scrolling="no" frameborder="no" allowtransparency="true">


Now that the file has been created, store the text file somewhere on your SharePoint site so we can link a content editor Web Part to it.

 

Place the content editor Web Part on your page and link it to the text file that you just uploaded, apply the changes, and save the page.  You should now your PDF within the browser!


 
Cheers!

Dan

Wednesday, September 25, 2013

Pop Up Form For Content Types And Custom Forms

I had a blog post earlier about how to link directly to the new form page for multiple content types, but how do we get that nice SharePoint pop up window that our users are used to seeing?  In my scenario I had created custom InfoPath 2010 forms for each of my content types in my SharePoint 2010 list.  This tutorial provides the syntax to make your links POP!  This is very simple, but is extremely handy if you want to keep the user on the same page and not have to redirect your user to the actual newform.aspx page.

Code Needed:

Javascript:OpenPopUpPage(‘Your URL For The New Form’)

Example

javascript:OpenPopUpPage('/sites/SiteName/Lists/ListName/newform.aspx?ContentTypeID=0x01002069B8F8E3CC074DB7793638F1D8896B’)


My example has the syntax to link directly to that content type's newform, rather than just using the newform.aspx which links to the default Content Type.

Cheers!

Dan

Monday, August 19, 2013

How To Show Related Items Within A Document Set


This tutorial will show you how to activate the document set feature / content type, how to create a Document Set Content Type, How to Add the Content Type to Your Library, and how to show Related List Items within the particular document set.  If you know how to do all of the other aspects of this article, feel free to skip to the end and just read the part under “Display Related Items Within The Document Set.”


(This post assumes that you know how to create a lookup from your list to a field within the Document Set Content Type.  I have a previous post which shows how to use the lookup field required to create the relationship)


Materials Needed:

1.    A Document Library

2.    A List

3.    A relationship between the list and document set (lookup field)

4.    Page Field Filter Web Part

 
Activate the Document Set Feature:

(This requires SharePoint Online for Enterprises or SharePoint Server 2010)

 
1.    Select Site Actions

2.    Select Site Settings

3.    Site Collection Administration

4.    Site Collection Features

5.    Activate Document Sets

 
Create the desired Document Set Content Type

1.    Select Site Actions

2.    Select Site Settings

3.    Select Site Content Types

4.    Select Create

5.    Enter the name of your Content Type

6.    Under Select Parent Content Type

a.    Select Document Set Content Types

                                          i.    (this is only available after activating the feature which we did previously)

7.    Select a group where you would like the Document Set Stored

8.    Select OK

 
Add the Created Content Type To Your Library:

1.    Select the Desired Library

2.    Select Library Tools

3.    Select Library

4.    Select Library Settings

5.    Select Advanced Settings

6.    Select “Yes” Allow Management of Content Types

7.    Select OK

a.    “Add From Existing Site Content Types” Will Now Appear Under Content Types

8.    Select Add From Existing Content Types

9.    Select The Document Set Content Type Which You Created Earlier

10. Select Add

11. Select OK

a.    (There will now be two content types listed under Content Types “Document” & “Your Document Set Name”)

Related List

I have an earlier post “Linking Lists & Editing The Default Display Form” on how to relate the two pieces of content.  In a nutshell though, you will need to have a lookup field which pulls a field from your created Document Set.  I will be using the Title from my Document Set Content Type for my example.

 Display Related Items Within The Document Set:

1.    Navigate To Your Library

2.    Create a New Document Set Item

3.    Open the Document Set Item

4.    Select The Page Tab

5.    Select Edit Page

6.    Select The Zone You Would Like Your Related Items Displayed

7.    Select Add A Web Part

8.    Select The List With Related Items

9.    Select Add A Web Part

10. Insert the “Page Field Filter” Web Part

11. Select The Page Filter Web Part

a.    Select Connections

12. Select “Send Filter Values To”

13. Select Get Filter Values From

14. Select Configure Connection

15. Select the Related Field From Consumer Field Name

16. Select Finish

17. Select Stop Editing

Your Document Set Should Now Display Only The Related Items!!!