Community Site Setup Customizations

Customizing Subject View

In SharePoint Designer, in lists and libraries, click Discussion List.

SharePoint Designer: Discussion List

Under views, click on Subject.

SharePoint Designer: Subject View

In the code view, change ReadOnly=”TRUE” to ReadOnly=”FALSE”

SharePoint Designer: Behind the Scenes Code - highlighting ReadOnly=TRUE

Creating a Worfklow to set Category ID

​In the discussion list, go to the LIST tab, then choose List Settings

I named the column CatID

Make it a Number field

Uncheck “add to all content types” – we want the item to be hidden from all input screens.

You are free to Leave “add to default view” checked. – I don’t think this really matters because the default view is Subject anyway, and it doesn’t really show anything with the CATID in there.

Do NOT require that this column contains information – it will be completed by a workflow. We don’t want users seeing this item.

CatID: Number type

Within SharePoint Designer, open the site, and click Workflows on the left menu.

Click on List Workflow, then choose discussion list

Workflows: List Workflow - Discussion List

Give the workflow a name – keep it short, since it will be the name of a column later.
Write a detailed description so that you will know what the workflow is meant to do.

In this following screen, make sure you select all the Start Options because you want this change to always be made, whether it’s a new discussion item, or a changed discussion item.

Workflows: Workflow Screen

Click on Stage 1 and rename it to SetCatID (again, keep this short)

Workflows: Set Stage Name

From the Action Dropdown, pick Set Field in Current Item

Workflows: Action - Set Field in Current Item

Click on Field and choose CatID from the drop down menu

Workflows: Set Field in Current Item

Click on Value, then the 3 ellipses to open the lookup window

Click on Add or Change Lookup

From the Data Source Drop Down, choose Categories

From the field from source field: choose ID (you want the value from the ID column in the Categories table).

Workflows: Set Field in Current Item

Under “Find the List Item” choose Category name as the field, then click on the fx button and select Category

Workflows: Set Field in Current Item

You will get a message saying that you may not get unique values, click YES.
What it’s saying is that if we have two category names that are identical, it would only show the number for the first one.

In the string builder, you will see only this. Click OK.

Workflows: String Builder

Right-click the Transition to stage section and choose go to a stage
Click on go to stage and choose End of Workflow

Workflows: End Workflow

Check to make sure there aren’t any errors by clicking the Check for Errors button. Then hit Publish.

Test your new workflow by creating a new discussion item, or changing the category on an existing item.

You may need to add the CatID field to the Management view in the discussion list so you can see it populate.

You may also want to add the Set CatID field to the management view for testing purposes.

Advertisements

Finding your spot in the SharePoint HTML source code

SharePoint has a view quirks that may require you to go to into the HTML source code of a page.

NOTE: If you’re not familiar with HTML code, you should probably not be in the source code of SharePoint. Ask someone who is familiar to do this for you.

At work I have a tutorials page where I categorized all the tutorials by topic and color-coded them by difficulty. The little monkey faces show you if something is green iconeasy, yellow iconmoderate, orange iconchallenging, or… red iconwell, do not try this at home – or at least not without supervision.

When adding tutorial links to the tutorials page, I often find it easier to be in the source code because I already have all the settings back there. All I need to do is find a spot, and enter the HTML code below:

<img alt="green icon" src="/sites/dsa/sp/greek/SiteAssets/monkey-green-15.png" style="margin: 0px 5px;"/><a href="/sites/dsa/sp/greek/Lists/Posts/Post.aspx?ID=XXX">Tutorial Title</a><br/>

where XXX is the post ID from my blog.

The settings I am referring to include the location of the image, the img alt tag, and the margins of 0px and 5px.

By going into the source code and copying and pasting, it saves me the steps of looking for the image by using the INSERT Picture menu, and then setting the image alt tag and the margin settings.

Finding the location of the HTML content you want to change

This tutorial is to share a tip on how to “find a spot” to paste the content. If you just open the page, hit edit, and then go to Edit Source to get to the source code for SharePoint, you’ll see all the code from the beginning of the page. Finding the spot to paste your content can be tricky to find this way.

A little trick is to place your page in edit mode, and then select a word or two near the spot where you want to paste your content before selecting the Edit Source button. Doing so will take you directly to your content, so you can add your HTML code in that vicinity.

SharePoint: HTML Source Code

I have used this trick more times than I can count. Though visually, it’s very helpful to do so, you don’t necessarily have to highlight a word. Just placing your cursor on the page will send you to that spot in the code also. I just find it easier to take that extra step to highlighting something so I can be sure of my place where I need to be before I change the code on the back end.

Creating Leave Approval Calendars – Part Two

In the previous tutorial we covered the mechanics of creating the approval workflow on your calendar. Now we’re going build the user interface to where it’s more accessible for your users.

Create a Calendar view showing Approvals only

We want the calendar on SharePoint to only show approved leave, so we need to create a view that only shows approved leave.

You can edit the Calendar view if you wish and just add the filter piece to it; I prefer to create a new view based on the Calendar view, and then called it Approved, and set that as the default view.

Then scroll down to the filter area and set the Approval Status field is equal to Approved

SharePoint: Approval Calendar View

Set the default view for Approval Tasks to be Active Tasks

You do not need to see old requests when you go to the Approval Tasks screen. You only want to see current items so you can approve or reject them.
Click on the Active Tasks link next to All Tasks, then once your active tasks load, go to the LIST tab and choose Modify View. Click the Set as Default checkbox and save.

Create pages that do not allow general users to see the back end of the SharePoint lists.

In general, within SharePoint you can click on a web part header to go to the back end of the SharePoint list. Because leave requests can be sensitive in nature, you don’t want the general population to be able to do that and gain access to submitted requests.

To combat this ability, create separate pages for each of the users, and then add the web part views to them, with Chrome Type = None. That way users can see the content of the page, but unless they are familiar enough with SharePoint, and have the necessary access, they won’t be able to see the back end.

You can get to the pages screen by going to the Site Contents and looking for SitePages. Else, you can click on the PAGE tab, and then View All Pages.

Calendar Page

You may want to add instructions to the calendar page on how to use it. In my blog post about how to break SharePoint I warn you about editing the actual calendar page. Therefore, create a new page, call it Calendar, and then add the calendar web part to it. Under Edit Web Part, choose the Approved view, and then under Appearance, set Chrome Type = None.

My Leave Requests

Create a new page, call it My Leave Requests, and then add the Task list web part to it. Under Edit Web Part, choose the My Leave Requests view, and under Appearance, set Chrome Type = None.

Side Note…

You could also create a page with both the Calendar and the My Leave Requests web parts on the same page.

Leave Approval – Pending Requests

This page will be hidden in the navigation from everyone except the Approvers Group using the Target Audience setting in Navigation.

It contains the Tasks web part, with the Active Tasks view. I recommend you do not turn off the Chrome Type on this one so that if they needed to, the Approvers could click on Tasks and get to the back end if they needed, to possibly reverse a request response, etc.

Update the Workflow

To complete the process, we need to make a final change to the workflow itself to add a link to the Leave Approval – Pending Requests Page.

The email that is sent to the approver generates a link to the calendar item that was added. On the calendar item, there is an option to approve or reject the request. If the approver only uses that function, it does not close out the task on the task list. Therefore, we want to train the approver to go to the Leave Approval – Pending Requests page that contains the Active Tasks view.

Return to Workflow settings, and click on the name of the workflow (Leave Requests)

On the second screen, under the Request field, add the link to the Leave Approval – Pending Requests page such as shown below.

A request for leave is waiting for approval. To view details of request click on the link at the bottom of the page.

However, to actually <a href=”https://starfleet.sharepoint.com/sites/***/****/SitePages/Leave%20Approval%20-Pending%20requests.aspx”>approve request please use this link</a>.

Update Site Navigation

If you went through the steps of creating all the pages above, and thus hiding the built-in functionality of allowing users to get to the back end, then before you deploy the solution to your group, you will want to remove your apps from the navigation, and add your new pages to the navigation in their place.

Rather than going directly to Navigation and removing the links to the apps there, I suggest you go to the list settings for both the Calendar and Task apps, clicking on the Name & Navigation link and removing them from the Quick Launch. There can be an unintended consequence of having to manually add links in the future if you just remove them from Navigation.

Once you have set the apps to not show on Quick Launch, go to the Navigation menu by going to the Gear, then Site Settings, then Navigation.

In the Local Navigation, add the pages to the navigation. Use the Browse feature or just copy and paste the URLs from another browser window.

For the Leave Approval – Pending Requests page, use the Audience: field to restrict the link to that page. Click on the address book icon, search for your Approvers group, then add them to the audience. You also want to add the site collection administrators group, and if need be, your own site owners group.

SharePoint: Navigation Target Audience

Creating Leave Approval Calendars – Part One

In this post we will be creating an approval workflow for a leave calendar. Some departments and companies have a leave request submission process, often accomplished via paper forms that are submitted, reviewed, and then signed by the authorized person. Sometimes the approval comes back to the requestor, sometimes it doesn’t. There’s a better way… SharePoint to the rescue!

This tutorial involves quite a few steps, but they are all completed using the SharePoint browser window, which should make it accessible to all site owners. This tutorial assumes you know your way around SharePoint and does not include screen shots for every step.

Step One: Make sure you have a group on your site with Approver as one of their statuses.

If not, you can grant approver status to an existing group, or create a new group and give the new group Approver status.

Step Two: Create a new calendar.

You can also use an existing one if you’re not using it for anything else, but you generally want to create a new calendar for this purpose. Go to the gear, then Add an App. Give it a one-word name, then later in the settings, change the name to something more friendly.

Step Three: In the versioning settings, set Require content approval for submitted items? to Yes

SharePoint: Versioning Settings

By adding the versioning, SharePoint automatically creates a view for Approve/Reject items. It also creates a view called My submissions.

By default, the “My submissions” view does not actually have the filter set up to only show Created by is equal to [Me]. You’ll need to add that if you want that feature to work.

Step Four: Create your approval workflow.

You can find Workflow settings in the Calendar Tab, or from the List Settings page.
Click Add a Workflow to get to the Workflow screen. The image below shows a Change a Workflow screen, but the screen is the same. Fill in the details as shown below, with the exception of the CC field – please put your own name there, and not mine. You will also edit the request field later, but for now, this is good.

Approval Task List

When you create an approval workflow, it generates a task list and a workflow history list if it doesn’t already exist. When you first create an approval workflow, you probably only have the option to choose Tasks (new), and that’s ok. Do that, and then go to the list settings and rename it later. While you are in there, you may also want to display this list on the quick launch for now.

Final Touches

While you’re done with the creation of the workflow piece, and it will work now, you’re not done yet. There are a number of things that need to be done for the final touches of this process, which are covered in the next post.

5 tips for writing compelling Discussion List posts

Discussion lists allow us to connect with one another and react to the content being posted. While the announcement is nice for one-way communication, the features that go along with the Discussion List, such as the ability to connect them to, and post directly from Outlook, make this a standout in terms of collaboration and communication. The list is designed to post news and other bits of information to share with your colleagues. I don’t know about you though but sometimes reading through an announcement or discussion list is like trying to solve anagrams or crossword puzzles, and I thought it might be helpful to write up a couple of tips to help make our collaboration even better.

Here are some tips on making sure that your posts get read:

  1. Create a great descriptive title. “Idea” is not a good title. “Help” is not a good title. The title of the post shows up in nice, large letters, so use them to your advantage. You have 75 characters to get our attention. Use them well!
  2. Forget the salutation. The first 75 characters of your post appear in the preview, so make them count! Between 75 characters in the title and 75 characters in the preview, you have 150 characters to get us to click on your discussion item. I know that we’ve trained ourselves that we need to open emails and letters with Dear Team, but in a discussion list it’s somewhat redundant as only our colleagues are reading it. You don’t start ever web page with “Dear Reader” so no need to do it here either.
  3. Use separate discussion items to split your content. While we would love to read your prose, let’s be honest: we’re all very busy. Please help us by keeping discussion items short and to the point. If you have a lot to tell us, either break up the content with very easy to see headers, or you might be able to split your content into multiple discussion items so we can pick and choose which is most relevant. I fall into this trap all the time. I can get long winded trying to provide some context behind what we’re doing. In the end though, sorry to say, the longer the post, the less likely it gets read.
  4. Keep your message short by using links to expanded content. This may be redundant, but it’s a slight twist on the above note. If your content needs to be long, such as when you need to provide instructions or describe a detailed process, consider creating a web page or word document with all the details and linking to that source, so that we can get to the message quickly, and then if we need more information, we can go to the link.
  5. Create meaningful hyperlinks. SharePoint has the ability to insert hyperlinks through the INSERT tab. You can add meaningful text that’s linked to additional content. Type your meaningful text first, and then highlight your sentence and use the INSERT Link feature to hyperlink it to your content. Because links are not too easy to see on SharePoint, feel free to highlight and link the entire sentence. You also don’t necessarily need to use the words “click here” or “visit this site” to show people you’ve linked something. Just linking the sentence gets the point across that there’s something more to click on.

I hope these five tips will get you started with writing compelling content for your discussion lists and will make your collaboration more meaningful.

Stripping underscores on a page

​​When creating a new page, the title is the same as the file name.
As of this date, there currently is no way to split file name from page title.
It’s important that we do not include spaces in a file name, and that we instead use underscores.
Unfortunately, with underscores, we have a strange looking page title that includes underscores, which we can strip using a content editor web part.

This is what the title of this page would look like without the underscores stripped:

Page Head with Underscores

Check out the page, and place in EDIT mode.

In the footer of the page, or at the bottom of your site content, insert a Content Editor webpart.

You can find the Content Editor web part under the Media and Content category.

Insert Content Editor Web Part

Click on the little triangle in the top right hand corner of the web part, and choose Edit Web Part.

In the Content Link box, copy and paste the following:

/sites/dsa/SiteAssets/Javascript_strip_underscores.js

Content Editor Javascript Strip Underscores

Under the Appearance drop down, choose Chrome Style of NONE.
Then click OK and SAVE the page.

Content Editor Chrome None

Create a calculated field to show due dates first

When viewing task lists ordered by due date, often the tasks with no due dates appear at the top of the list, while the items that have a due date appear at the bottom. Sorting the list in descending order doesn’t help either, because then your items that are due soon will appear in the middle of the list.

There doesn’t appear to be an out of the box setting that will display items with a due date first, followed by those without one, so we get around this by using a calculated field column within the list settings.

Click on the List tab, then on List Settings

SharePoint: List Settings

Scroll to the middle of the page and add a new column. Give that column a name, such as HasDueDate

Choose for this column to be a calculated field and use the following formula in the formula field:

=IF(ISBLANK([Due Date]),”No”,”Yes”)

Calculated field: hasduedate

Save the column.

Sorting your list to include this new HasDueDate column.

The next step is to add this field to the sorting options on your list view.

SharePoint: Modify View

Scroll to the middle of the page, where the sorting options are, and choose HasDueDate from the first column option; then set that to descending order (you want “Yes” to come before “No”).

In the second sort column, choose Due Date in ascending order.

Now your list will always sort with the due dates first, in ascending order.