We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Quote from: davidm at Sep 19, 2006, 10:01 AM

    Or should we stick to adding :
    AddType text/x-component .htc
    to our .htaccess ? )
    I can see how some people would want to have a snippet for this, but I personally use the AddType in my htaccess files, and prefer this approach. As long as it is an optional snippet to address the problem, I don’t see issue with providing both solutions as alternatives to each other.
      • 6726
      • 7,075 Posts
      Simpler sure is better... my concern was, will it work with most server configs ?
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 22815
        • 1,097 Posts
        See, this is an awkward and complicated decision to make, but worth making right.

        MODx comes with an .htaccess file (called ht.access) so in one respect the htaccess route is the official approach. But then that doesn’t actually get used by default - Friendly URLs are not the default setting.

        You can’t really turn htcmime.php into a snippet. What the script does is serve up the .htc file having set the right headers. You could have a document with no template and the only content a snippet that did the same thing, but frankly that’s ludicrous. It is better to have htcmime.php in the same folder as the .htc file, and to advise people to switch from
        behavior: url(assets/js/csshover.htc)

        to
        behavior: url(assets/js/htcmime.php?file=csshover.htc)

        in their CSS if they need to.

        So, bearing that in mind..

        Quote from: davidm at Sep 19, 2006, 10:01 AM

        Nothing major, but WinXP SP2 is a good share of the market and cannot (unluckily) just be ignored.
        Well, there’s degrees of ignoring. Frankly, I don’t intend on having anything with a hover state that is so essential that IE6 users need to see it (no matter what SP they’re on). I’ve considered .htc, but it seems to bring more trouble than it is worth. People will notice a nasty error when they try to browse their site in a McDonald’s internet kiosk more than they will notice the absence of a hover effect. I therefore avoid using it in my templates.

        It is worth pointing out that presently only Minimal Template seems to include the line. Which, frankly should probably be taken out of Minimal along with the reference to an RSS feed from [~11~] which is just plain stupid on single-page installs.

        That said, I think the best MODx solution would be a plugin that added the line (configurable between using .htc or .php) as an inline style in the header. Given that we go to the trouble of including the .htc file in the distribution it would make sense for such a plugin to be part of the optional extras added during installation. (Would a second plugin for the manager be useful too?)
          No, I don't know what OpenGeek's saying half the time either.
          MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
          Forum: Where to post threads about add-ons | Forum Rules
          Like MODx? donate (and/or share your resources)
          Like me? See my Amazon wishlist
          MODx "Most Promising CMS" - so appropriate!
          • 25663 MODX Staff
          • 12,272 Posts
          Updated csshover.htc, and added the mime helpers. Good call and thanks for the research David. See commit 1456
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 6726
            • 7,075 Posts
            Quote from: PaulGregory at Sep 19, 2006, 11:08 AM
            Well, there’s degrees of ignoring. Frankly, I don’t intend on having anything with a hover state that is so essential that IE6 users need to see it. I’ve considered .htc, but it seems to bring more trouble than it is worth. People will notice a nasty error when they try to browse their site in a McDonald’s internet kiosks more than they will notice the absence of a hover effect. I therefore avoid using it in my templates.

            Yeah well, I sure can understand the logic behind what you’re saying. But how do you manage pure CSS dropdown menus without :hover in IE ?
            I know, the answer is : dropdown menu are not accessible -> don’t use them. And I agree, I don’t. Most of the times I convince clients not to go down this road, but I happen to have one who explicitly required it.

            Thus I depend on :hover which is a lesser evil than depending on a js menu, IMHO.

            Quote from: PaulGregory
            That said, I think the best MODx solution would be a plugin that added the line (configurable between using .htc or .php) as an inline style in the header. Given that we go to the trouble of including the .htc file in the distribution it would make sense for such a plugin to be part of the optional extras added during installation. (Would a second plugin for the manager be useful too?)

            Very nice idea, I am all for it !

            Quote from: rthrash at Sep 19, 2006, 11:13 AM
            Updated csshover.htc, and added the mime helpers. Good call and thanks for the research David. See commit 1456

            Glad I could help with technicalities, for once smiley

              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 25663 MODX Staff
              • 12,272 Posts
              And added the MIME fix to the ht.access file and updated instructions/changelog/version.inc.php in 1457.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 25663 MODX Staff
                • 12,272 Posts
                I think the best solution is to provide all the options, which we now have. I like the idea of a IE CC plugin actually, that will check for the existence of the ht.access file (presumably not using .htaccess) and will then add the png behavior and the css hover to the header automatically in a conditional comment. Otherwise it would use the helper PHP file. Of course it should have a configuration parameter to force a specific mode, too (helper file or none).
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 22815
                  • 1,097 Posts
                  Yes, MODx is very much geared up to adding stuff to headers, and we have all these little IE-fixes in MODx that we don’t really draw attention to. A configurable IE Fixes plugin would be really cool and a good marketing plus-point.
                    No, I don't know what OpenGeek's saying half the time either.
                    MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                    Forum: Where to post threads about add-ons | Forum Rules
                    Like MODx? donate (and/or share your resources)
                    Like me? See my Amazon wishlist
                    MODx "Most Promising CMS" - so appropriate!
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Quote from: rthrash at Sep 19, 2006, 11:26 AM

                    ...that will check for the existence of the ht.access file (presumably not using .htaccess) ...
                    Maybe I’m just overcautious, but I never actually rename my existing ht.access file, I make a copy and rename and edit that. So my ht.access file will still exist.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 25663 MODX Staff
                      • 12,272 Posts
                      Yep, so you’d have doubly-correctly served .htc files! laugh

                      (Paul correctly pointed out elsewhere that you can count on the .htaccess being in the root of the MODx install either, so that’s not a valid check. Hence my suggestion for an overriding config parameter. smiley )
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me