{"id":3366,"date":"2023-02-06T08:22:30","date_gmt":"2023-02-06T06:22:30","guid":{"rendered":"https:\/\/dox.fi\/?p=3366"},"modified":"2023-02-06T08:22:31","modified_gmt":"2023-02-06T06:22:31","slug":"how-to-adapt-the-webhelp-template-for-mobile-use","status":"publish","type":"post","link":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/","title":{"rendered":"How to adapt the WebHelp template for mobile use"},"content":{"rendered":"\n<p>You can use <a href=\"https:\/\/dox.fi\/en\/systems\/dox-cms\/\"><strong>DoX CMS<\/strong><\/a> to publish online content in the <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> format which applies a predefined frame to <a href=\"https:\/\/www.w3schools.com\/html\/\"><strong>HTML<\/strong><\/a> content. I have previously discussed how you can adjust the appearance of this frame <a href=\"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template\/\"><strong>here<\/strong><\/a>. Here, I will instead discuss the details involved when you must adapt a <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publication for mobile use. The default style for them includes rules for mobile devices, but these methods improve the mobile functionality of such content.<\/p>\n\n\n\n<p>These instructions will not directly address how you can adapt your content for mobile use given your current style sheets. I will also try to address situations in which the details of prior style sheets can limit usability on mobile unless you specify alternative values for mobile use.<\/p>\n\n\n\n<p>Similarly to the prior piece, this piece will also primarily involve the use of <a href=\"https:\/\/www.w3schools.com\/css\/\"><strong>CSS<\/strong><\/a>-based style sheets. This makes the information here most useful to those who can already write and edit style sheets.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Content for mobile use<\/h2>\n\n\n\n<p>Ideal content for mobile use is different from content that fits other online use and paged publications. You should thus also consider how the content is formulated if it will be published for mobile use. I will address such considerations below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Tables<\/h3>\n\n\n\n<p>Tables are an important means to structure information. However, their proper use can often require more space than what mobile devices can afford. A device in portrait mode has considerably less of the horizontal space that tables with more columns need. Meanwhile, a device in landscape mode might not even show a full row of a given table at a time if it contains much content or if its content is packed to narrow but tall cells.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">New content<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"530\" src=\"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1024x530.png\" alt=\"\" class=\"wp-image-3358\" srcset=\"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1024x530.png 1024w, https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-300x155.png 300w, https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-768x397.png 768w, https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1536x795.png 1536w, https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives.png 1975w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><em>Screenshot of the text editor. Below the table, there is a definition list which is conditioned for mobile use and which has the same content as the table because of content references and shared variables.<\/em><\/figcaption><\/figure>\n\n\n\n<p>If you must write the content for mobile use from scratch, avoid tables where cells must fit whole sentences. An exception to this are tables with two columns where the cells with full sentences have nearly the normal amount of horizontal space available. If tables would have three or more columns, use, for example, definition lists instead. The definition field (dd) can then have a list which corresponds to the cells of a table row. You can also use tables where the equivalent of one item consists of multiple rows of content. You can merge some of the cells on the extra rows to make room for longer content. The image above contains examples of such models for organizing content.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Prior content<\/h4>\n\n\n\n<p>If you must adapt former structured content for mobile use and it already contains tables which are not suited for mobile use, you should condition these elements to match where they will be used. There are instructions for how to do this below.<\/p>\n\n\n\n<p>You can add alternatives like those described above for mobile use and condition them accordingly, in the way described below. Because all tables in the <a href=\"http:\/\/docs.oasis-open.org\/dita\/LwDITA\/v1.0\/cnprd01\/LwDITA-v1.0-cnprd01.html\"><strong>LW-DITA<\/strong><\/a> format that <a href=\"https:\/\/dox.fi\/en\/systems\/dox-cms\/\"><strong>DoX CMS<\/strong><\/a> uses contain paragraph elements, you can reuse many of them through content references. This requires that the original cells&#8217; contents are suited for use as, for example, list items (or additional paragraphs inside list items). Add <strong>ID<\/strong> values to the paragraph (p) elements inside table cells, and add proper references to these elements as the <strong>Conref<\/strong> values for the corresponding paragraph elements in the new content. This keeps this content in both versions the same with no extra effort needed even if you make changes to it later.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Images<\/h3>\n\n\n\n<p>As I emphasize in relation to style sheets below, mobile use generally requires that you use no metric units or inches. This also includes elements where such values were added in the text editor. Images are the prime example. Ideally, image size depends on element classes that let you control it through the style sheet in different situations and simultaneously across all of them. However, if image sizes in the editor are in non-scaling units such as millimeters, you must change these values to scaling units for publications used on mobile. You can also override them with the style sheet. This involves maximum dimensions that you specify for mobile use. Instructions for this are available below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conditioning<\/h3>\n\n\n\n<p>Tag-based conditioning lets you make publications where you will only include the versions which are suited for mobile use if you set them up like I described above. This lets you use the content that you conditioned like this either to publish online in general, because adaptations for mobile use do not limit other usage, or as publications intended only for mobile use.<\/p>\n\n\n\n<p>In practice, you must add a new tag category with separate tags for mobile publications and other publications to do this. You must then apply these tags in the editor to the parts of publications that have separate versions for mobile use. Use the tag for mobile publications on the elements suited for mobile use and the alternatives other tags from the same category that match their use cases. Finally, specify as part of each related publication template whether they are to be published for mobile use or not. For each, use the corresponding tag to filter out the alternatives.<\/p>\n\n\n\n<p>You can also control whether content with specific tags shows with a style sheet as I discuss <a href=\"https:\/\/dox.fi\/en\/styles-for-tags\/\"><strong>here<\/strong><\/a> and <a href=\"https:\/\/dox.fi\/en\/user-controlled-conditioned-manuals\/\"><strong>here<\/strong><\/a>. As such, I will describe below how you can use a style sheet to only show the proper content for a specific device in the same publication.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Style sheets for mobile use<\/h2>\n\n\n\n<p>The primary means to adapt <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publications for mobile use relies on style sheets. Fortunately, you can specify separate rules only for mobile devices. If you are already happy with your style in other situations, you can just provide the exceptions that apply to mobile devices and add them to that style. If you want to keep the style sheet(s) for the default style well-organized, you can add these parts either at its end or in a different style sheet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Review the mobile view<\/h3>\n\n\n\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"584\" src=\"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/htinspectmobile-1024x584.png\" alt=\"\" class=\"wp-image-3355\" srcset=\"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/htinspectmobile-1024x584.png 1024w, https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/htinspectmobile-300x171.png 300w, https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/htinspectmobile-768x438.png 768w, https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/htinspectmobile.png 1252w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><em>Screenshot of the cover for DoX CMS&#8217;s manual being inspected in a mobile view. The Inspect command and the Toggle Device Toolbar button have green frames.<\/em><\/figcaption><\/figure>\n\n\n\n<p>You cannot review <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a>-publications directly with the <strong>Preview<\/strong> command. They must be published first. You can then review them in your browser. This will almost invariably involve a desktop device rather than a mobile device. This would require you to make the content available online to review it on a mobile device. Fortunately, at least some browsers such as <a href=\"https:\/\/www.google.com\/intl\/fi_fi\/chrome\/\"><strong>Chrome<\/strong><\/a> and its derivatives let you review content in a mobile device view directly from a desktop device.<\/p>\n\n\n\n<p>The image above shows how the <strong>Inspect<\/strong> command can show pages as they appear on mobile devices. In practice, this is what you must do:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publication in a browser through its <strong>index.html<\/strong> file.<\/li>\n\n\n\n<li>Click on some element in the view with the right mouse button and select the <strong>Inspect<\/strong> command from the menu that this opens.<\/li>\n\n\n\n<li>Then, click the icon for the <strong>Toggle Device Toolbar<\/strong> command in the upper left corner of the <strong>DevTools<\/strong> toolbar.<\/li>\n\n\n\n<li>Specify the dimensions for the device and turn the view that shows with these commands in the toolbar above the view.<\/li>\n<\/ol>\n\n\n\n<p>This view lets you make changes to the stylesheet(s) to see their effects before you edit the style sheets in <a href=\"https:\/\/dox.fi\/en\/systems\/dox-cms\/\"><strong>DoX CMS<\/strong><\/a>. However, note that not all changes that you make like this will also have exactly the same results when you publish the content after you make the same changes to your style sheets. You must always review such publications afterwards because of the risk of such differences.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Challenges of mobile use<\/h3>\n\n\n\n<p>I am not a developer for mobile. This made the experience of adapting a style for mobile frustrating at times because of the innate functions involved. Such functions change the layout without them showing as part of a style sheet. My observations may not even include all the relevant functions like this. You must thus acount for the possibility that otherwise inexplicable behaviour can relate to some such difference in how mobile devices operate.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Scaled font sizes<\/h4>\n\n\n\n<p>The majority of browsers for mobile devices scales the font size to the available space by default. Further information on this is available <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/text-size-adjust\"><strong>here<\/strong><\/a>. These browsers try to retain sufficient functionality like this even when the page is not designed with mobile use in mind. Such scaling is based on available space, especially available horizontal space. This can make the font sizes for some elements shift seemingly at random.<\/p>\n\n\n\n<p>I stumbled into this when I examined why the font sizes for the number identifiers for topics did not match the font sizes of the rest of their titles. Depending on the orientation of the view, the number identifiers became either smaller or larger than the rest of the titles. The cause was eventually revealed to be how the <strong>.titleNumberWrapper<\/strong> field for these number identifiers was specified to be an inline-box. This detail added hidden frames within which their font sizes were determined. The solution was to change their display mode to inline (on mobile devices).<\/p>\n\n\n\n<p>You should also note that sometimes the content that looks off actually matches your specifications and the content that looks good was scaled to that size by this function. In this case, you should check the font sizes for these elements and set them to what you need.<\/p>\n\n\n\n<p>If you want to ensure that the results are predictable or that any issues are related to this function, you can use a style sheet to control such automatic scaling of font sizes. You can enable this function or change its settings in browsers which support it. You can also disable it entirely. Further information on this is available <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/text-size-adjust\"><strong>here<\/strong><\/a>. The demonstration below shows how you can disable this function completely.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>* {\n -webkit-text-size-adjust: none;\n  text-size-adjust: none;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Vertical margins and flexbox<\/h4>\n\n\n\n<p>This section is not directly related to mobile devices. However, flexbox is a good way to make a view more mobile friendly. It lets specify proportional dimensions for elements and to reorganize them. For example, the instructions that I provide below that let you move the transition buttons in <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publications to the top of the view use a flexbox. Further information on this is available <a href=\"https:\/\/www.w3schools.com\/css\/css3_flexbox.asp\"><strong>here<\/strong><\/a>.<\/p>\n\n\n\n<p>You must note, though, that elements displayed with a flexbox also do not adhere to all the same layout rules otherwise. The most relevant feature like this involves vertical margins not collapsing. The vertical margins for content usually collapse to only use the largest applicable value instead of summing them all together. This applies to both embedded and sequential elements&#8217; margins. This is a feature of the block model used by default. For more information on the block model, see <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Guide\/CSS\/Block_formatting_context\"><strong>here<\/strong><\/a>. Flexboxes, on the other hand, show all these elements&#8217; vertical margins in full. For more information on margin collapses, see <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/CSS_Box_Model\/Mastering_margin_collapsing\"><strong>here<\/strong><\/a>.<\/p>\n\n\n\n<p>As a result, you should check the vertical margins of your content if you use a flexbox layout on mobile (or otherwise). You can retain the original layout like this if you use halved vertical margins for elements in sequence which each had the same vertical margins between them. At either end of such a sequence, you can remove the vertical margins that face that direction from the element that has the lower vertical margin there. If this will only affect mobile use, you can specify these vertical margins for mobile use only with the additional selectors introduced below.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Touchscreens<\/h4>\n\n\n\n<p>The users of mobile devices do not usually connect them to accessories that let them use pointers with these devices. Without a pointer, you cannot interact with content in ways which would depend on one. The most common example involves moving the pointer above a specific element. You can add rules to such situations with the :hover selector. For more information on the :hover selector, see <a href=\"https:\/\/www.w3schools.com\/cssref\/sel_hover.php\"><strong>here<\/strong><\/a>.<\/p>\n\n\n\n<p>If the layout or style of your content involve such selectors in ways which would limit the content&#8217;s usability with touchscreens, you must change them. This may require a wider renovation of your layout. In some instances, it can instead be enough that you also add the :active selector to these parts of the layout. This makes the rules actvate when someone selects the affected element. You can select with a touchscreen when you press the element for a moment and do not just touch it momentarily. For more information on the :active selector, see <a href=\"https:\/\/www.w3schools.com\/cssref\/sel_active.php\"><strong>here<\/strong><\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Styles only for mobile devices<\/h3>\n\n\n\n<p>You can specify some styles to only apply on specified types of devices. The most common condition for this involves screen size. For example, the default style for <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publications on <a href=\"https:\/\/dox.fi\/en\/systems\/dox-cms\/\"><strong>DoX CMS<\/strong><\/a> includes rules that only apply to<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>viewports that are 1279 or fewer pixels wide, <\/li>\n\n\n\n<li>viewports that are 1023 or fewer pixels wide, and<\/li>\n\n\n\n<li>viewports that are 767 or fewer pixels wide.<\/li>\n<\/ul>\n\n\n\n<p>Each of these cutoff points is specified separately in the default style sheets, and each is associated with its own set of rules.<\/p>\n\n\n\n<p>You write such additional selectors with a @media selector and associated further specifications. Further information on this is available <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/@media\"><strong>here<\/strong><\/a>. You can use such selectors as a higher order selector inside which you write associated rules as though it were its own style sheet: such embedded parts include both selectors and the associated rules. You can have more than one such selector inside the @media selector&#8217;s parentheses and they must each have their own sets of parentheses. I will provide an example below, where viewports that are 1279 or fewer pixels wide will have red backgrounds in landscape mode and yellow backgrounds in portrait mode. It also sets the default text color to white in landscape mode. Such immediately obvious effects let you test the thresholds and functioning of @media selectors. Remove them before you proceed with your edits to the style sheet.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@media only screen and (max-width: 1279px) and (orientation: landscape) {\n     body {\n          color: white;\n     }\n     .topicWrapper {\n          background-color: red;\n     }\n}\n\n@media only screen and (max-width: 1279px) and (orientation: portrait) {\n     .topicWrapper {\n          background-color: yellow;\n     }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Better space management<\/h3>\n\n\n\n<p>Mobile devices have considerably less available space than desktop devices. As such, you should remove any excess empty space to improve space management. The default setting for <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publications on <a href=\"https:\/\/dox.fi\/en\/systems\/dox-cms\/\"><strong>DoX CMS<\/strong><\/a> do not do this enough for mobile use. I cannot provide you with default values that will work in every use case. You must adjust the values to fit your manuals.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Size boundaries<\/h4>\n\n\n\n<p>Ideally, you already use element classes to control details such as image sizes and the widths of table columns instead of their settings in the text editor. In this case, you can directly change their values with a style sheet. This lets you give them different values on mobile with the method provided above. If this is not the case, you can still specify maximum and minimum dimensions in different situations while on mobile. This limits values that go past these thresholds to these values. Images, for example, would then not be too large for mobile use even when their original sizes were defined in non-scaling units such as millimeters.<\/p>\n\n\n\n<p>You can provide different boundaries for different situations, such as to keep images inside tables within the space available to them. In this case, you can use percentages for the maximum size of images inside table cells to let cells sizes determine how big the images can be. This only applies when the space available within these tables is already defined, though. If tables use automated layouts, you must instead provide the maximum dimensions for images in unrelated units such as those linked to font size (rem or em) or pixels. You can also provide similar values for cases such as images immediately inside figure elements or list items.<\/p>\n\n\n\n<p>A key values in this respect is the maximum width for the content field. If you will use specific layouts in different situations such as for landscape and portrait modes on mobile, this value contributes greatly to that. The default style sheets already have a defined value. Thus, you must use the !important qualifier to replace it. Below, I present a means to do so. I use the default value which you can then adjust to fit the situation. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.topicWrapper {\n    max-width: 750px !important;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Margins<\/h4>\n\n\n\n<p>When space is limited, unnecessary margins are the first thing to cut. In this context, margins include any form of empty space around elements rather than only the values for the margin rule. In particular, you must set the margins for the default elements which are not a part of content proper to match the use case. Otherwise, a small mobile viewport in landscape mode may only show half a text row at once, and the limited available space even prevents scrolling through the content.<\/p>\n\n\n\n<p>To help with this, you should adjust details such as the vertical margins for titles, at least in landscape layouts. You can also remove the margins around the whole <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publication from mobile viewports. I present the values that I applied to the manual for <a href=\"https:\/\/dox.fi\/en\/systems\/dox-cms\/\"><strong>DoX CMS<\/strong><\/a> below. You can adjust them to fit your style sheet.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@media only screen and (max-width: 1279px) {\n    .tocTitleWrapper {\n    \tpadding: 12px 20px !important;\n    }\n\n    .paginationWrapper {\n    \tmargin-top: 10px !important;\n    }\n\n    body {\n        padding: 0 !important;\n    }\n\n    h1, h2, h3, h4, h5, h6, h7, h8 {\n        line-height: 1em !important;\n        margin: 10px 0 10px 0 !important;\n    }\n\n    .documentBodyWrapper {\n        padding: 20px !important;\n    }\n\n    p {\n    \tmargin: 0.6rem 0 !important;\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Move transition buttons<\/h3>\n\n\n\n<p>By default, the transition buttons to the previous and next section show at the bottom of the view. A mobile device in portrait mode can leave these buttons apart, when content does not cover the available vertical space. To address this by reorganizing the view, you must use a flexbox. As such, you may have to define the vertical margins for content again if you do so. More information on flexbox in relation to vertical margins is available above. I show a solution that moves these transition buttons above the content titles below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.topicWrapper {\n    display: flex;\n    flex-direction: column;\n}\n\n.paginationWrapper {\n    order: 1;\n}\n\n.titleWrapper {\n    order: 2;\n}\n\n.topicBodyWrapper {\n    order: 3;\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Switch to mobile content<\/h3>\n\n\n\n<p>Elements retain their tags and you can use tags to control their visibility as I explain <a href=\"https:\/\/dox.fi\/en\/user-controlled-conditioned-manuals\/\"><strong>here<\/strong><\/a>. Thus, one publication can include both the elements for mobile use and the elements not for mobile use. The system will only show the appropriate versions of said contents for each use case.<\/p>\n\n\n\n<p>First, condition the content based on its use case like I described above. Select each tag associated with these different use cases to be used by the publication template. You can, for example, define the same content to be in use both in the default view and the landscape mode on mobile but use a different one in the portrait mode on mobile. In the example I provide below, all mobile views will use the same content which was conditioned for mobile use only.<\/p>\n\n\n\n<p>The tags involved are just an example. If you use these rules, instead use the values for your tag categories and the tags within. You can also change which content shows and when. This example uses the same qualifiers for mobile use as the default rules for mobile use in <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publications on <a href=\"https:\/\/dox.fi\/en\/systems\/dox-cms\/\"><strong>DoX CMS<\/strong><\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>*&#91;data-doxattribute-usecase=\"mobile\"] {\n    display: none;\n    }\n\n@media only screen and (max-width: 1279px) {\n    *&#91;data-doxattribute-usecase=\"mobile\"] {\n    display: initial !important;\n    }\n\n    *&#91;data-doxattribute-usecase]:not(&#91;data-doxattribute-usecase=\"mobile\"]) {\n    display: none !important;\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>Not all content and not all settings for content are suited for mobile use. Thus, if you know that your publications will be available on mobile, you can formulate them accordingly. You can either use types of content suited for mobile for everything or add new publications specifically for mobile use. The biggest issue are tables with many columns. You can replace them with definition lists, for example. If you have separate versions of the content for mobile use, you can use tags to differentiate them from the default versions. Content references (conref) are the simplest way to keep the content between the two versions identical. Use parts of the default versions as source elements. The best way to define image size involves element classes. If you use the editor for this instead, you should avoid metric units and inches.<\/p>\n\n\n\n<p>When you edit a style sheet for mobile use, you can review the results with the <strong>Inspect<\/strong> command. At least <a href=\"https:\/\/www.google.com\/intl\/fi_fi\/chrome\/\"><strong>Chrome<\/strong><\/a> and its derivatives also let you emulate different mobile viewports when you do this. Do note how the changes that you make in the browser might not be reflected in full by the publication when you add these changes to its style sheet and publish the content again. Always review the content in the changed publication again.<\/p>\n\n\n\n<p>The most important tool to make <a href=\"https:\/\/help.adobe.com\/en_US\/robohelp\/2015\/robohtml\/book\/rob_layouts_la\/WebHelp_layout-.htm\"><strong>WebHelp<\/strong><\/a> publications suitable for mobile use are style sheets. Changes to them have their own challenges, though, such as font size scaling which only applies on mobile. Touchscreens also do not support functions which rely on pointer position. You can respond to these challenges when you acknowledge them beforehand.<\/p>\n\n\n\n<p>You can define rules only for mobile devices when you place the selectors and associated rules inside selectors that use media queries. Use this option to reduce unnecessary margins that take up space that you need for content, and to specify boundaries for the sizes of various elements. When you do this, an image set to be ten centimeters wide for printing purposes will not stay the same on a five centrimeters wide smartphone screen. You should also consider the layout and changes to it which improve mobile use. For example, screens that can be tilted work better with transition buttons that you move to the top of the view with a flexbox layout. Otherwise, there is a risk that they are left separated from content proper.<\/p>\n\n\n\n<p>The most extreme form of adaptation for mobile use involves conditioned content and controlling its visibility with style sheets. This involves conditioning the content based on its use case. The publication itself will include each version of such content, though. You only show one situationally appropriate version at a time by using a style sheet to hide the alternatives that have different tags from this tag category.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use DoX CMS to publish online content in the WebHelp format which applies a predefined frame to HTML content. I have previously discussed how you can adjust the appearance of this frame here. Here, &#8230; <a title=\"How to adapt the WebHelp template for mobile use\" class=\"read-more\" href=\"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/\" aria-label=\"Read more about How to adapt the WebHelp template for mobile use\">Read More<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[49,118,69,48,332,333,129,334,57,312],"class_list":["post-3366","post","type-post","status-publish","format-standard","hentry","category-news-archive","tag-cms-en","tag-conditioning","tag-css-en","tag-dox-en","tag-mobile","tag-smartphone","tag-stylesheet","tag-tablet","tag-tag","tag-webhelp-en","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to adapt the WebHelp template for mobile use - DoX Systems<\/title>\n<meta name=\"description\" content=\"Use these methods to make WebHelp publications from DoX CMS work better on mobile devices.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to adapt the WebHelp template for mobile use - DoX Systems\" \/>\n<meta property=\"og:description\" content=\"Use these methods to make WebHelp publications from DoX CMS work better on mobile devices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/\" \/>\n<meta property=\"og:site_name\" content=\"DoX Systems\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-06T06:22:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-06T06:22:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1024x530.png\" \/>\n<meta name=\"author\" content=\"Sami Rissanen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sami Rissanen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"24 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/\"},\"author\":{\"name\":\"Sami Rissanen\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#\\\/schema\\\/person\\\/a83ff87cfa6da8c9e8d4c0943d6f5e3c\"},\"headline\":\"How to adapt the WebHelp template for mobile use\",\"datePublished\":\"2023-02-06T06:22:30+00:00\",\"dateModified\":\"2023-02-06T06:22:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/\"},\"wordCount\":3598,\"publisher\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/dox.fi\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/mobilealternatives-1024x530.png\",\"keywords\":[\"CMS\",\"conditioning\",\"CSS\",\"DoX\",\"mobile\",\"smartphone\",\"stylesheet\",\"tablet\",\"Tag\",\"WebHelp\"],\"articleSection\":[\"News\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/\",\"url\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/\",\"name\":\"How to adapt the WebHelp template for mobile use - DoX Systems\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/dox.fi\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/mobilealternatives-1024x530.png\",\"datePublished\":\"2023-02-06T06:22:30+00:00\",\"dateModified\":\"2023-02-06T06:22:31+00:00\",\"description\":\"Use these methods to make WebHelp publications from DoX CMS work better on mobile devices.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/#primaryimage\",\"url\":\"https:\\\/\\\/dox.fi\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/mobilealternatives-1024x530.png\",\"contentUrl\":\"https:\\\/\\\/dox.fi\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/mobilealternatives-1024x530.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/how-to-adapt-the-webhelp-template-for-mobile-use\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dox.fi\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to adapt the WebHelp template for mobile use\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#website\",\"url\":\"https:\\\/\\\/dox.fi\\\/\",\"name\":\"DoX Systems\",\"description\":\"KUSTANNUSTEHOKKAAT JA MODERNIT J\u00c4RJESTELM\u00c4T TEKNISEN DOKUMENTOINNIN JA VARAOSALIIKETOIMINNAN TARPEISIIN\",\"publisher\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/dox.fi\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#organization\",\"name\":\"DoX systems\",\"url\":\"https:\\\/\\\/dox.fi\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/dox.fi\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/favicon.png\",\"contentUrl\":\"https:\\\/\\\/dox.fi\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/favicon.png\",\"width\":512,\"height\":512,\"caption\":\"DoX systems\"},\"image\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#\\\/schema\\\/person\\\/a83ff87cfa6da8c9e8d4c0943d6f5e3c\",\"name\":\"Sami Rissanen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g\",\"caption\":\"Sami Rissanen\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to adapt the WebHelp template for mobile use - DoX Systems","description":"Use these methods to make WebHelp publications from DoX CMS work better on mobile devices.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/","og_locale":"en_GB","og_type":"article","og_title":"How to adapt the WebHelp template for mobile use - DoX Systems","og_description":"Use these methods to make WebHelp publications from DoX CMS work better on mobile devices.","og_url":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/","og_site_name":"DoX Systems","article_published_time":"2023-02-06T06:22:30+00:00","article_modified_time":"2023-02-06T06:22:31+00:00","og_image":[{"url":"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1024x530.png","type":"","width":"","height":""}],"author":"Sami Rissanen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sami Rissanen","Estimated reading time":"24 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/#article","isPartOf":{"@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/"},"author":{"name":"Sami Rissanen","@id":"https:\/\/dox.fi\/#\/schema\/person\/a83ff87cfa6da8c9e8d4c0943d6f5e3c"},"headline":"How to adapt the WebHelp template for mobile use","datePublished":"2023-02-06T06:22:30+00:00","dateModified":"2023-02-06T06:22:31+00:00","mainEntityOfPage":{"@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/"},"wordCount":3598,"publisher":{"@id":"https:\/\/dox.fi\/#organization"},"image":{"@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/#primaryimage"},"thumbnailUrl":"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1024x530.png","keywords":["CMS","conditioning","CSS","DoX","mobile","smartphone","stylesheet","tablet","Tag","WebHelp"],"articleSection":["News"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/","url":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/","name":"How to adapt the WebHelp template for mobile use - DoX Systems","isPartOf":{"@id":"https:\/\/dox.fi\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/#primaryimage"},"image":{"@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/#primaryimage"},"thumbnailUrl":"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1024x530.png","datePublished":"2023-02-06T06:22:30+00:00","dateModified":"2023-02-06T06:22:31+00:00","description":"Use these methods to make WebHelp publications from DoX CMS work better on mobile devices.","breadcrumb":{"@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/#primaryimage","url":"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1024x530.png","contentUrl":"https:\/\/dox.fi\/wp-content\/uploads\/2023\/01\/mobilealternatives-1024x530.png"},{"@type":"BreadcrumbList","@id":"https:\/\/dox.fi\/en\/how-to-adapt-the-webhelp-template-for-mobile-use\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dox.fi\/en\/"},{"@type":"ListItem","position":2,"name":"How to adapt the WebHelp template for mobile use"}]},{"@type":"WebSite","@id":"https:\/\/dox.fi\/#website","url":"https:\/\/dox.fi\/","name":"DoX Systems","description":"KUSTANNUSTEHOKKAAT JA MODERNIT J\u00c4RJESTELM\u00c4T TEKNISEN DOKUMENTOINNIN JA VARAOSALIIKETOIMINNAN TARPEISIIN","publisher":{"@id":"https:\/\/dox.fi\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dox.fi\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/dox.fi\/#organization","name":"DoX systems","url":"https:\/\/dox.fi\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/dox.fi\/#\/schema\/logo\/image\/","url":"https:\/\/dox.fi\/wp-content\/uploads\/2019\/10\/favicon.png","contentUrl":"https:\/\/dox.fi\/wp-content\/uploads\/2019\/10\/favicon.png","width":512,"height":512,"caption":"DoX systems"},"image":{"@id":"https:\/\/dox.fi\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dox.fi\/#\/schema\/person\/a83ff87cfa6da8c9e8d4c0943d6f5e3c","name":"Sami Rissanen","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g","caption":"Sami Rissanen"}}]}},"_links":{"self":[{"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/posts\/3366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/comments?post=3366"}],"version-history":[{"count":4,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/posts\/3366\/revisions"}],"predecessor-version":[{"id":3370,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/posts\/3366\/revisions\/3370"}],"wp:attachment":[{"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/media?parent=3366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/categories?post=3366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/tags?post=3366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}