Just a question with show_if, and what server variables… are the able to be checked against the php server variables? or someting else?
is there ony doco on these, either in pdf, text, developer notes, wiki?
The server variables condition is able to be checked against any of the server variables PHP makes available (These may differ between environments, not certain on this though). A reference for what is available can be seen on the PHP site at PHP Server Variables.
A few examples of how to use the condition in a design can be found in the asset’s directory:
[MATRIX_ROOT]/core/assets/system/conditions/condition_types/condition_server_variable/example_code.html
This file walks through a few examples, including Language detection and Browser detection, which should give you an idea of how they can be used.
Of course they can also be used in any area where other conditions can, such as User Group Restrictions, and these areas should provide an interface for configuring the condition.
On this topic, does anyone know whether there is a server variable that gets the users screen resolution, ie, 800x600 or 1024x768. I was thinking about using the show if command to attach the relevant style sheet based on the users screen resolution. I have read through the PHP server variables which doesn't seem to have one for this.
Does anyone know if this is a possibility using the server variable show if function? Or is there another way to show a specific design based on screen resolution?
Thanks!
[quote]Does anyone know if this is a possibility using the server variable show if function? Or is there another way to show a specific design based on screen resolution?
Thanks!
[right][post=“10164”]<{POST_SNAPBACK}>[/post][/right][/quote]
This wouldn’t be possible using the server variables. The only way I can think of doing this off the top of my head would be using javascript to determine the width of the client being used to view the page, and manipulating the stylesheets appropriately. No details as yet (the top of my head only holds so much) but if you would like a hand with this sort of implementation I’ll see what I can muster.
[quote]No details as yet (the top of my head only holds so much) but if you would like a hand with this sort of implementation I’ll see what I can muster.
[right][post=“10165”]<{POST_SNAPBACK}>[/post][/right][/quote]
Thanks Darren! I will have a play with the some JavaScript then and see what I can come up with. The idea came from the ABC site --> http://www.abc.net.au/default.htm. First check the site out with resolution of 1024x768 then change it to 800x600 and you will notice the same design fits into this smaller resolution. You will also notice the index page changes to default_800.htm. It only occurs on the home page.
Just had a look and it looks like this is done with javascript http://www.abc.net.au/default.htm. Ummmm…
I think I’ve now answered my own question – 
You might want to check out this script too.
Same HTML for both - it just changes the style sheet - so you only have one page to maintain.
cheers
[quote]You might want to check out this script too.
Same HTML for both - it just changes the style sheet - so you only have one page to maintain.
cheers
[right][post=“10173”]<{POST_SNAPBACK}>[/post][/right][/quote]
Thanks Richard. That looks like a good tutorial on how this is done.
In regards to the ABC site, I would hesitate to use the 2 different HTML pages, just for maintenance reasons, unless they contain vastly different material. Changing only one stylesheet would be very clean in my opinion.
Having said that though, their script looks like a good pointer on how to get this done.
Let me know how it goes!
I know Microsoft's Internet Information Server can do browser size detection, so I suspect it could be possible to get Apache to do it too. It may be something that is possible with some development on the server side (if you didn't want to use JavaScript).
Thanks for your help.
I got this working brilliantly. I used a combination of the Particle Tree’s and Particle Tree’s script. If anyone would like the script send me an email. I think its a good idea for when you want to use a fixed-width design within a controlled environment. This was implemented on our Intranet, where we knew 98% of users are using 1024x768 or above and the remaining 2% are using 800x600.