We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31559
    • 20 Posts
    Hi All,

    I’m looking for a solution to manage accessibility options on my site. I’d essentially like to have some links within my top navigation/image that enable a user to select larger text, wider template etc etc. I did have a look at TemplateSwitcher, but it appears to work on a page by page basis. Is there an easy way to achieve this customisation for users? Thanks in advance for any help/guidance you can offer. I did do a swifty search through the forum and couldn’t find anything. Apologies if I’ve overlooked a relevant post.
      • 36541
      • 222 Posts
      AFAIK there’s no out-of-the-box solution for that task in MODx. However, what you demand is achievable with standard means.

      1) Font size - if only you don’t define it in pixels (which I assume you are aware of when asking about accessibility) the user is capable to change the text size from within the browser. It’s up to you, the designer, whether it will result in page scaling or not (ie whether you base your layout on ems or not).

      However, there are browser which don’t supply any direct way to change font size (Opera being the example) but instead magnify the whole page. If you want to provide the explicit way to allow the font size scaling you need to use a few lines of JS.

      2) Template switching - if you use source ordered templates for your documents than all you have to do is to provide diffrent presentation layer, while the source stays intact. Modern browsers support alternate stylesheets, which are a great and simple way to provide diffrent styling/layout. Just use an appropriate [tt]rel[/tt] attribute in the link to the alternative stylesheet.

      <link href="path/to/stylesheet.css" rel="alternative stylesheet" type="text/css" media="screen, projection" title="Stylesheet title"/>


      Don’t forget to provide [tt]title[/tt] for your default stylesheet to.

      And just as with font size, there are browsers, which don’t support alternative stylesheets (IE<7 for example). You have to provide JS for their users.

      You might want to check this resource: http://css-discuss.incutio.com/?page=StyleSwitching
        This is the web: the only thing you know about who will come is that you don't know who will come.
        • 12652
        • 228 Posts
        Really what you are wanting to do is change stylesheets, not templates. I believe you could approach that with the snippet that is in the repository. Also, there is a javascript driven switcher you can find at alistapart.com that I have used that works very well with placing a cookie. There is also a php version at ALA that I haven’t used yet and was thinking of trying to incorporate it into MODx as the one in the repository may be a little much for simple "large text" changes.
          | Identity Developments delivers SEO focused web design and web presence services
          - it&#39;s not about websites, it&#39;s about your identity. |
          • 727
          • 502 Posts
          If you use XHTML strict then it forces you to completely seperate content from presentation, so in theory you can change the appearance of the site simply by changing the css.
            • 31559
            • 20 Posts
            Thanks all - I’ll look into the ALA scripts to change stylesheets. I believe this is most what I’m looking for. I’ll report back assuming I don’t make a complete numpty of it all. In which case I’ll report back anyway.