Optimize Visualforce Page for Salesforce1 - layout

I created a simple visualforce page to override the standard salesforce.com page for "New" and "Edit" for a Custom Object.
It is pretty simple, it was just because in the standard salesforce.com page the textarea was not wide enough, since the form is splitted in two columns. (Or am I wrong? Is there a way to accomplish that without creating a custom visualforce page?)
Well, here is the code:
<apex:page standardController="Object__c">
<apex:sectionHeader title="Object Edit" subtitle="{!if(Object__c.id==null,'New Object',Object__c.Name)}"/>
<apex:form >
<apex:pageBlock title="Object Edit" mode="edit">
<apex:pageblockbuttons >
<apex:commandbutton action="{!save}" value="Save"/>
<apex:commandbutton action="{!cancel}" value="Cancel"/>
</apex:pageblockbuttons>
<apex:pagemessages />
<apex:pageblockSection title="Basics" columns="2">
<apex:inputField value="{!Object__c.Field1__c}"/>
... more fields
</apex:pageblockSection>
<apex:pageblocksection title="Details" columns="1">
<apex:inputField value="{!Object__c.Field10__c}"/>
... more fields
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>
Ok, the page looks good on force.com, but when I open it from within the salesforce1-App on my iPad it has the same style like on force.com and not the nice styling like the other (standard salesforce.com page-)forms in the salesforce1-App?

To get the styling right, consider using the Mobile Design Templates: https://developer.salesforce.com/en/mobile/services/mobile-templates/templates-faq.
I think you would also benefit from reviewing this slide deck: http://www.slideshare.net/developerforce/visualforce-in-salesforce1-1-1. It specifically asks developers to avoid using pageBlocks in Salesforce1. The author of those slides is Sandeep Bhanot, who, in general, is a great person to connect to on Twitter/Youtube, etc, for all your Salesforce1 needs.

You can have textarea span 2 columns in std page layout by putting it to separate section and setting columns to 1. Just hover over the section header, click the wrench icon on the right and you should get a popup like this:
I'd say for such change it's bit of an overkill to go full VF page route. But if you really need it or my trick won't work - there are few questions on Salesforce-dedicated site that might be a good start for you:
https://salesforce.stackexchange.com/questions/22290/sfdc-styleguide-usage-questions-in-salesforce1
https://salesforce.stackexchange.com/questions/25541/salesforce1-look-feel-in-visualforce
https://salesforce.stackexchange.com/questions/27788/how-to-do-visualforce-page-with-the-same-look-feel-as-salesforce1
https://salesforce.stackexchange.com/questions/37111/mobile-view-one-one-app-differs-from-native-salesforce1-view (not really related but it's my answer so :P Seriously though - the presentations I've linked to in that answer really helped me to kick off my development)

Related

Bootstrap 4 menu

I'm trying to make a two-lines menu with bootstrap 4, and I found some examples on the web:
https://www.codeply.com/go/DpHESPqZsx
https://www.codeply.com/go/cxXqBnGrPx
In the first example they use "div class='navbar'" to create the menus.
<div class="navbar">...</div>
In the second example they use "nav class='navbar'" to create the menus.
<nav class="navbar">...</nav>
Which is the correct way? Which one should be used?
I have another question. Why do they NOT use the bootstrap grid with the rows and columns? When should you use it?
Thank you very much
Div and nav are similar element, in terms of what they do. However, nav is better in this situation because you want to have semantic markup. It is because of SEO and more readable for developers.
And why they are not using grid is probably because they haven't implemented it yet and should be coming. Their grid system is done with flex currently, but should change. And CSS Grid does not work that great with IE11.
You should use Grid when you feel that it will be easier to structure your site. It's a great tool, and combine it with Flex is so easy and comfortable
The difference is that a div has no meaning and a nav Element has a semantic meaning (indicating that there is a navigation). You can remove every div and span from a website and have no difference about the semantic structure of a page, every other element has a meaning: For example, states that there is the main content, says here is the header-part of the site.
These parts tell for example search engines what's on a site. So if you have the text "Stackoverflow" in your Element somewhere, google (and other search engines) know that you have a stackoverflow link in your navigation. If you have it in your Tag, you probably have a text about stackoverflow.
Keep in mind: These are some simplified examples.
The html5 nav tag has semantic meaning.
Please follow the Bootstrap docs. The grid (row>col) should not be used in the Navbar as it's not a supported component. Using the grid inside the Navbar will through off alignment, spacing and the responsive behavior controlled by the navbar-expand-* classes. I'm the author of both Navbar examples from Codeply you posted.

How Can I Use Shadowbox to Extract Text Only from Webpage?

I have an article set up in Joomla that displays Terms and Conditions for the site users. I would like this to show up in a shadowbox when a user clicks a link. Here is the current anchor text example:
Terms and Conditions
This works out great for displaying the entire web page, but what I would like to do is just display the article text on the page (plain with a white background). Is this in someway possible with shadowbox? If so, how?
If I'm understanding you correctly - you want to suppress the modules and other periphery from your 'page' when it is loaded in the shadowbox.
Add ?tmpl=component to the url of your link.
You can do this with a div element and css shadow effect.
How to show/hide div is explained here:
http://www.randomsnippets.com/2008/02/12/how-to-hide-and-show-your-div/
How you can add shadow is explained here:
http://placenamehere.com/article/384/css3boxshadowininternetexplorerblurshadow/
I believe there are some components to do this - but you may have to get creative to do it without pulling the whole page with an a href tag.
In the database there's a particular area that holds that specifically and you could write a little query to just pull that information specifically and put it in the shadowbox, but what that query would look like I'm not sure.

Solpart menu is ripping my soul apart!!! Not opening up in DNN

Please, someone tell me if there is a replacement for the rubbish Solpart menu, the menu with the small arrow to administer a module in DotNetNuke?
I have been using DNN for some time now and I would love to know if there is not a better way to get this menu working. I cannot believe DNN would let something as buggy as that out!
Thanks
You can use any menu for that drop down. You'd just swap out the solpartmenu for the one you want in the container you create. Here is a blog post outlining some of the menu options available. I'd suggest taking a look into each one of these and see which would be a good fit for you.
New Navigation Options in DotNetNuke 5.x Designers Should Know
Below is one (slightly updated) example from How to use RadMenu instead of the default solpartactions menu
Open an existing container for edit (a Default DNN container will work fine).
Register the RADMENUACTIONS tag by adding the following line of code: <%# Register TagPrefix="dnn" TagName="RADMENUACTIONS" Src="~/DesktopModules/RadMenu/RadMenuActions.ascx" %>
Replace <dnn:ACTIONS ... /> with <dnn:RADMENUACTIONS ... />
Set additional properties for RadMenu if desired. For example you can set the Skin property: <dnn:RADMENUACTIONS runat="server" id="dnnRADMENUACTIONS" Skin="CssGreen" />

Creating tooltips for each field in Sharepoint form

I want to create tool tips for each part in a form which employees have to fill in a share point web page. When users move the mouse cursor on each field (Title, description, department etc.) the related tip will be automatically became visible as a simple pop-up (tool tip) and summarize what they should write there. and when the mouse cursor is not on one of these fields there is no tool tip.
How can I design such a system via share point designer? I am not able use any add ons. I can't upload any additional things to the server. I have to make page based design.
I would be glad if you kindly help me.
Have you considered using field description?
This is SharePoint's default way of adding additional information to fields.
I couldn't find the ToolTip control in my SharePoint Designer 2007 Toolbox, so I looked on W3Schools.com for a standard HTML option and found that you can use the <ABBR> tag.
See http://www.w3schools.com/tags/tag_abbr.asp for the reference, but here's an example of a tooltip implemented on a SharePoint field title in a display form:
<td valign="top" class="ms-formlabel" style="width: 50px">
<H3 class="ms-standardheader">
<nobr><abbr title="The actual number of man-days effort expended.">Man-days (Actual)</abbr></nobr>
</H3>
</td>
Open up the aspx page for the form in SharePoint designer. Then you can use SharePoint designer just like Visual Studio to see the code. Try adding the "tooltip" attribute to the field controls within the form. There is a small possibility these controls will actually be written using XSLT instead of ASP, so be prepared to do some studying.
By default the display name of the site column becomes the tool tip for that field.

Web accessibility and h1-h6 headings - must all content be under these tags?

At the top of many pages in our web application we have error messages and notifications, 'Save' and other buttons, and then our h1 tag with the content title. When making a web application accessible, is it ever acceptable to have content above the top-level structure tag like we do here?
As a screen reader user I don't like content above the main heading. Normally I navigate by headings so would miss the error message. A better solution is to output an h1 heading above the error message, then leave the rest of your headings in tact giving you two h1 headings.
Yes (you can put stuff above them). The H simply means Heading. It's a question of what the heading relates to I guess.
My only caveat is, H2 shouldn't really be above H1, and H3 Shouldn't be above H2. But I don't think it's an actual rule.Websites have menus, warning, notifications. It's acceptable to put them above the rest of your content. I don't see how it would affect accessibility as long as your content is ordered logically. Look at the page CSS turned off. Does it look logical? That's the most important part of accessibility.
Although some people do go that extra mile and have the menu as the last item in the markup and use CSS to bring it back to the top. Personally, I find that solution counter productive. The menu is still important, it belongs at the top of the page.
Yes, just consider it is in that order that the user will get the information. So, if you just did an operation it sounds like a good idea to get any message related to it as the first thing. If it is a notification that appears on any page unrelated to what you are doing, I wouldn't put it above, as it might be a little weird.
Also you can use a text browser that doesn't use styles, it should look like a document with appropriate headers.
Heading tags are used to indicate the hierarchy of the content below it. You should only have one h1 tag and it should be the first content to appear on your page (this is usually the name of the site). Also, you shouldn't skip heading tags when drilling down through different tiers of content.
In your case, you can still use CSS to position items above the h1 tag as long as it is in the correct order in the html.
I assume the elements above the heading are used by JavaScript. In that case, it's preferable if they are created by JavaScript, not included in the source of the page.
To return to your original question, it is probably best that they be at the foot of the page. However, if they are hidden using the CSS "display: none;" or "visibility: hidden;" properties then they will not be seen by most (perhaps all?) screenreaders or by many other assistive technologies, and so should not be an issue. I've written a fairly detailed explanation of why accessibility technology ignores such elements.
Of course if somebody disables CSS things are going to look pretty messy. If there is content on the page that can be used even when CSS and/or JavaScript are disabled, then putting those elements at the bottom of the page will at least make things less cluttered.

Resources