SharePoint Online’s Public Website Doesn’t Allow Users to View Display Forms

If you’re used to SharePoint, and the display form on lists, you may be thinking you can use that on your SharePoint Online Public Sites as well. Sadly, by default your anonymous users cannot access the display form of a list item. Instead, SharePoint Online prompts the user to login.

Annoying? Yes.

It is due to the ViewFormPagesLockdown feature, which is available in SharePoint on-prem, and appears to be on by default on SharePoint Online. I think the reasoning is that the display form can have more data on it than you’d care to share to your visitors, and frankly, the page is rather dull. So thinking through how to get around this, my initial thoughts were:

  • Disable this silly feature, but alas, you can’t.
  • Use the search web parts with a custom display template, but alas, these aren’t available on the public site #FAIL
  • Write some custom JavaScript to grab the data, meh, too much work.
  • Fudge a few columns, and the view, and get it to work. BING BING BING

We can use the views of a list, since users can access that fine, and manipulate it to look like a form page.

Below I walk through how we did it on the Boston Office 365 User Group site, www.bostono365usergroup.com,

Take the default view of the list:

Boring SharePoint List View

Then let’s change the view style, we used Newsletter, which gives us the nice start to where we want to be:

List view in Office 365 SharePoint

Not terrible right? But let’s make it a wee bit more prettier. I edited the page, added a code snippet web part (embed code) and threw in the following collection of CSS:


<style unselectable="on">
.ms-listviewtable tr td.ms-vb2:first-child {
display:inline-block;
}

.ms-listviewtable td:first-child+td, .ms-listviewtable td:first-child+td+td {
display:inline-block;
width:45%;
font-size:14px;
}

.ms-vh2 {
display:none;
}

table.ms-listviewtable tr td.ms-vb2:first-child {
font-size:1.6em;
width:400px;
}

.registerButton {
padding:4px 5px;
border-top-left-radius:10px;
border-top-right-radius:10px;
border-bottom-right-radius:10px;
border-bottom-left-radius:10px;
border:1px solid #5b5b5b;
width:180px;
text-align:center;
color:#ffffff;
font-weight:bold;
display:inline-block;
text-shadow:none;
background-color:#001a81;
}

@media screen and (max-width: 400px) {
.ms-listviewtable td:first-child+td, .ms-listviewtable td:first-child+td+td {
display:inline-block;
width:100%;
}
.ms-vb-tall {
width:280px;
display:inline-block;
}
}
</style>

Much better right? Almost looks like a normal content page now ;)

SharePoint List View Customized

How do we get users to this page view now? If I had multiple items in the list it would just scroll long. Since this is a list view, we can filter the list view by the ID of the item.

We added a calculated column to use as a link on the home page. So, let’s add the column and the calculation:

=CONCATENATE("<div><a href='/events?FilterField1=Title&FilterValue1=",Title,"'>",Title,"</a></div>")

Make sure to set the Calculated Field to output as Number. Why didn’t I use ID you might ask, well, the ID field doesn’t work as you’d like. The ID isn’t calculated until after the item is added and the calculated column doesn’t get updated accordingly. Very annoying. Fortunately, in our case the title will suffice.

So the above calculation will output a link, sending the user to the events list view, filtered based on the current item. You can see it in action on the home page:

SHarePoint Event List on Office 365

Wait a second, what’s that nifty Register button?

register

That’s another calculated column, reading from the registration URL field, and then spits out some extra HTML for us to format it as needed (in conjunction with the above CSS):

=IF(RegistrationURL="","coming soon",IF(RegistrationURL<>"",CONCATENATE("<div><a id='regLink' class='registerButton' href=",RegistrationURL," target=_blank>Register</a></div>")))

It’s not impossible to have nice looking forms on the public site in your Office 365 tenant, but does take a little extra work.

Til next time, happy SharePointing!

About these ads

Vertical Promoted Links in SharePoint 2013

David Lozzi:

I had the pleasure of helping out Veronique via SPYam. It’s a great use case for the promoted links list!

Originally posted on Views from Veronique:

SharePoint 2013 has nice little tiles called Promoted Links to link to stuff all over your sites.  However, they all display horizontally when you add them to your page. Silly Microsoft for not providing us the option to list them horizontally or vertically in the first place – but thank you SharePoint community for providing the work-around, (and specifically in this case, David Lozzi)! :)  I love copy / paste code!!  Learn how to do this from our discussion on Yammer – thanks for your help David!

promoted links vertical and horizontal

================================================================

Post Blog Update : So it seems not everyone is on Yammer.  Instructions and code copied and pasted below for your convenience. :)

<style type=”text/css”>
.ms-promlink-body {width: 170px }
.ms-promlink-header {display: none}
</style>

Drop it into the Edit Source bit of the Content Editor Web Part on the page to make it work.  If the web part is too wide, insert it into…

View original 104 more words

Bringing SharePoint Public: Using SharePoint Online for your web site

I am very pleased to share that I will be presenting at this month’s Boston Office 365 user group, on August 21st.

I will be sharing about using SharePoint Online public website, which you get with your Office 365 tenant, to host your web site. We’ll cover some techie stuff but I will mostly cover the more important aspects of a public web site, like search engine optimization, mobility, performance and more.

More details on the Boston Office 365 User Group web site. Hope to see you there!

Presentation: Collaboration Throwdown: Salesforce vs SharePoint

My colleague Marty and I had the wonderful opportunity to present at the Boston SharePoint Users Group, comparing the collaboration features between Salesforce and SharePoint Online (Office 365). We did our best as we went round for round, comparing key features focusing on collaboration: social, documents, lists and data, workflows and mobility.

Here’s the deck: https://lozzi6-my.sharepoint.com/personal/david_lozzi6_onmicrosoft_com/_layouts/15/guestaccess.aspx?guestaccesstoken=SXthc5wfc42L%2bSHRQ0X3RqEer1u01qvGhd1icQ4WOQY%3d&docid=03220034c20ce4603b849d2f186881102.

Enjoy!

Throw down: Salesforce Communities vs SharePoint Online

Salesforce vs SharePoint

Salesforce Communities or SharePoint Online, what’s right for you? They both boast collaboration, but which one works for you?

My colleague, Marty Chang (Salesforce Architect, @martyychang, blog) and I will be battling head to head at the upcoming Boston SharePoint Users Group, July 9th, comparing the collaboration, user experience and mobility features of each platform.

Register here!

Who will come out victorious? Come and find out!