Showing posts with label Styles. Show all posts
Showing posts with label Styles. Show all posts

Friday, May 10, 2013

How To Hide The Add New Item Link On The Bottom Of Lists & Libraries


How to Hide the Add New Item Link on the Bottom of Lists & Libraries (per view)

Why on earth would we want to hide the “add new item link” on the bottom of lists and libraries!  One very good reason to hide this link is due to multiple content types and the fact that this link will only give the new form for the default content type.  We can have our users submit new items either through the ribbon or navigation that we create.  I will base this tutorial on the example I proposed in an earlier post “An Example of When to Use Multiple Content Types for a List” which essentially has an HR Question Repository with a content type for each HR Question Type being submitted.

In order to hide this link you will need:
  •  SharePoint Designer or a Content Editor Web Part on the page
  • This code snippet

<style>
 td.ms-addnew { display:none; }
 </style>

Steps
1. Open SharePoint Designer
2.Open the List/Library which needs the link hidden
3. Right Click the view you would like to hide the link for
4. Select “Edit File in Advanced Mode”


5. Place the code between your asp:content tags for “PlaceHolderBodyAreaClass”

6. Save
7. View Your Results!

Regards,
Dan



Monday, May 6, 2013

How To Hide The Quick Launch

There are scenarios where you need to hide the quick launch for a particular page and here is the code to do it!

<style>
#s4-leftpanel{
display:none
}
.s4-ca{
margin-left:0px
}
</style>
In order to use this code for a particular page you could drop this block of code into a text file and then link a content editor webpart to it or by embedding this code into the header of the page itself.  I know this is a short article, but hiding the nav bar is that easy!

Good Luck!
Dan

Thursday, April 18, 2013

SharePoint 2010 Surveys & How to Fix the Rating Scale Spacing


I recently have been asked to create surveys to capture this and that and the most commonly used question in my experience is the rating scales, but this question type is also the cause of an issue.  The issue is that longer questions within the scale get smashed together like I have shown below and make it nearly unreadable.  In this article I will show you how to fix this issue.



To Fix This Issue You Will Need:
1.    SharePoint 2010
2.    A Survey
3.    A question using rating scales
4.    SharePoint Designer
5.    This Code Block:
<style>
.ms-gridT1 { padding-top: 10px; padding-bottom: 10px; }
</style>

After you have created the Survey and you have questions which utilize the rating scale, you will need to open SharePoint Designer.

From SharePoint designer navigate to your site and then open the survey under lists and libraries.



The next set of steps will need to be done for the “DispForm.aspx”, “EditForm.aspx”, & “NewForm.aspx”.

To increase the padding between questions:
!1.    Right Click the NewForm.Aspx & edit in advanced mode
2.    Set the View to either Code or Split
3.    Find the Tags <ContentTemplate></ContentTemplate>
4.    Place the provided code block within these tags like the image below:
a.    

5.    Right Click the form tab and select save.
6.    Say Yes to the following message
a.    

7.    Navigate to your site and pull view the form (whichever form you did these steps for, I happened to do the newform for this example) and it should look like the below screen shot

!!!Please Note!!!!!
You will have to do this process for each of the forms within your survey.  In this example I did the newform, but if I were to view the item using the viewform, the questions would be smushed since we have not modified that display form.

I hope this helps and enjoy the easy to read surveys!

Dan