3

What is best practice for implementing a community site with a hybrid approach?

For example:

  • if you have the header that is displayed throughout the community by setting up the header in the branding section using an HTML file that is stored in the document object and ..
  • you use sites for your custom visualforce and apex pages that include links to go to pages in the community standard UI such as detail pages for account/contact/case records.

This approach seems to go against the MVC framework. You have a mix-mash of custom pages/standard pages.

Is this consider acceptable or a best practice?

Not only does it conflict with the MVC pattern, but the branding is different between your custom VF pages in sites and then navigation that takes you to standard UI detail pages. If we code the standard detail pages to conform to the MVC pattern, we'd have to customize tons of pages using visualforce and apex.

So, what is the best practice for implementing the hybrid approach?

  • 2
    apex:detail can make it easy to recreate standard object pages to VF (that you can adorn with custom headers). No apex code required. – cropredy Mar 20 '16 at 20:44
1

First, let me say that I think the term "best practice" is often overused. Instead, I believe in many cases there are "poor", "good", "better", and "excellent" or even "ideal" practices. What's "best" is often a subjective term and is open to debate.

The term "Best" doesn't take into account budgets, the size of the organization, time factors and other intangibles. What's appropriate for a Fortune 500 enterprise organization may not be practical for a 5 - 10 user small business organization. The latter simply doesn't have the same budget or resources to work with. In some cases, just as with "anti-patterns" there truly are "unsafe" or "insecure" practices which should be avoided for security or functional reasons. In other areas, "best" is what's within the reach of an organization to acheive with the resources they have available if they work "smart".

You mention a conflict with MVC patterns. I see no conflicts with the MVC object oriented design pattern with what you're asking about. MVC simply means Model-View-Controller. The default page can be overridden using a custom page that utilizes the standard controller for any given object whether it be standard or custom. There are built-in visualforce commands such as apex:detail that simplify replacing the detail pages for those objects. Someone who works "smart", can also create reusable Custom Components for custom detail pages to help simplify this work.

So, what would be a "good" practice? If it's within your budget, create a UI that will look the same for both Sites pages and Detail pages for your Sites & Community Visitors. Ideally, your visitors shouldn't feel as though they've been magically transported to a different site or an "old page" that's not been updated.

Equally important is something that many visualforce developers seem to miss. Just because a field is available for inclusion in the UI on a detail page, that doesn't mean it needs to be included or seen by a user. Only show your users what's REALLY important! Put that information at the top of the page in a larger font. Do they really need to see the LastModified, CreatedDate and other system fields? Most don't! If you want to have that info available for the rare occasion it might be helpful, put it way down below in a section that uses a smaller font.

Hide as much as possible from a non-salesforce user! Why? It's information overload. It's visually overwhelming to someone who's not familiar with our interface to see so much information presented to them all at once. Less is better. This is one of the drivers behind behind Lightning and Salesforce1. Its my opinion that Salesforce Developers and Admins often tend to ignore UI/UX design practices by visually overwhelming users with too much information; information that they often don't need. This same advice applies to non-admin Salesforce Users. Only display what they really need to see and give it emphasis. Lower value or priority information should be in smaller text and/or lower down on the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.