How to Turn Off the Mobile View
By default, uPortal 4 displays the mobile view on mobile devices. However, if you prefer to turn this feature off and display only the full portal site on mobile devices then do the following:
Step 1: Edit userContext.xml
- Open userContext.xml for editing (uportal-war/src/main/resources/properties/contexts/userContext.xml)
Comment out the org.jasig.portal.layout.UserAgentProfileMapper bean
.... <!-- Remove detection of the following user agents by commenting out the bean below --> <bean class="org.jasig.portal.layout.UserAgentProfileMapper"> <property name="mappings"> <list> <!-- Apple iPad --> <bean class="org.jasig.portal.layout.UserAgentProfileMapper.Mapping"> <property name="pattern" value=".*iPad.*" /> <property name="profileName" value="default" /> </bean> <!-- Apple iPhone --> <bean class="org.jasig.portal.layout.UserAgentProfileMapper.Mapping"> <property name="pattern" value=".*iPhone.*" /> <property name="profileName" value="mobileDefault" /> </bean> <!-- Android --> <bean class="org.jasig.portal.layout.UserAgentProfileMapper.Mapping"> <property name="pattern" value=".*Android.*Mobile.*" /> <property name="profileName" value="mobileDefault" /> </bean> <!-- Palm Pre --> <bean class="org.jasig.portal.layout.UserAgentProfileMapper.Mapping"> <property name="pattern" value=".*Safari.*Pre.*" /> <property name="profileName" value="mobileDefault" /> </bean> <!-- Nokia S60 web browser --> <bean class="org.jasig.portal.layout.UserAgentProfileMapper.Mapping"> <property name="pattern" value=".*Nokia.*AppleWebKit.*" /> <property name="profileName" value="mobileDefault" /> </bean> <!-- Blackberry web browser --> <bean class="org.jasig.portal.layout.UserAgentProfileMapper.Mapping"> <property name="pattern" value=".*Black[Bb]erry.*" /> <property name="profileName" value="mobileDefault" /> </bean> <!-- Opera Mobile web browser --> <bean class="org.jasig.portal.layout.UserAgentProfileMapper.Mapping"> <property name="pattern" value=".*Opera Mobile.*" /> <property name="profileName" value="mobileDefault" /> </bean> </list> </property> </bean> .....
Step 2: Rebuild/Redeploy uPortal
ant clean deploy-war
Step 3: Restart tomcat
Restart your tomcat server to see the changes.
Step 4: Test your changes using the User Agent
You can make sure that your full site is being rendered by verifying the mobile view isn't being displaying by doing the following:Â
Changing the User Agent
Changing the User Agent in Safari
- Click on the sprocket icon to open the Settings menu, then choose Preferences.Â
- On the Advanced tab, tick the "Show Develop menu in menu bar" checkbox.Â
- Then close the Preferences window.
- Next, click on the page icon to open the Current Page menu and choose Develop > User Agent.Â
- Select a User Agent from the list.
Since the theme setting is saved in your session, you need to clear your cookies after you change the User Agent string:
- In Safari, go to Settings > Preferences > Privacy.Â
- Under "Cookies and other website data" click on the "Details" button.Â
- Search for your uPortal domain, select it from the list, and click the "Remove" button.Â
- Then refresh the page.
Changing the User Agent in Chrome
- Click on the wrench icon to open the Settings menu, and choose Tools > Developer Tools.Â
- Click on the sprocket icon at the bottom right of the Developer Tools window.
- Under "Network", tick the "Override User Agent" checkbox and then choose a User Agent string.
The uPortal theme is saved in your session, so you need to delete the session cookie:
- In the Developer Tools window, under the "Resources" tab, select your domain under "Cookies" on the left panel.Â
- Then right click the JSESSIONID cookie and choose "Delete".Â
- The refresh the page.
Changing the User Agent in FireFox
Changing the User Agent string in FireFox is tedious, so it is best to use an Add On. There are several available from the Get Add-ons tool in FireFox. (User Agent Switcher by Chris Pederick is a good one.)
After you change the User Agent, you need to clear your cookies because uPortal saves the theme selection in your session:
- From the navigation menu (you might have to press Alt to see it) choose Tools > Options.Â
- Under the Privacy tab, click the "remove individual cookies" link.Â
- Search for your domain name and remove the "JSESSIONID" cookie.
Changing the User Agent in Internet Explorer
- From the navigation menu (You might have to press Alt to see it) choose Tools > F12 Developer Tools. This will open the Developer Tools window.Â
- From the Developer Tools window, choose Tools > change User Agent string, then choose the User Agent.Â
- If a User Agent isn't listed, choose "Custom" to add one. (Refer to the list of Common Mobile User Agent Strings in the list below)
- Click the "Add" button, then choose the User Agent and click the "Set" button.Â
- Restart the Browser to reset the User Agent string to default.
- In the Developer Tools, choose Cache > clear session cookies to clear your session.
Â
Â
Â
Add Feedback content box here.....