php snippet

22 Oct 2003

I’ve found the PHP stylesheet switcher from ALA immensely useful, as it also opens up an easy way to provide different content, depending on the style chosen.

For example, to make sure that the navigation is displayed ‘flat’ in the diet version of hicksdesign (by removing the javascript), I’ve used the following php snippet:


<?php
  if ($sitestyle=="plain") 
  echo 
  "<script type=\"text/javascript\" src=\"/js/global_plain.js\"></script>"; 
  else echo 
  "<script type=\"text/javascript\" src=\"/js/global.js\"></script>";
?>

If ‘plain’ has been chosen by the user, it inserts the link to an external javascript file containing no menu scripts. If the user has chosen the default, or not chosen at all, it inserts the link to the version that has. (This won’t work in Mozilla if the user changes style using the browser menu). Using the css property display:none will just hide it from view, but this means you can decide what content goes into the HTML before it actually gets to the user.

Recent Posts

The Hicks Logowall

05 Oct 2018

Hiding Away

16 Sep 2018

Biro sketch of Lauzerte

23 Aug 2018

Firefox Identity Project

21 Aug 2018

It’s just fashion

26 Jun 2018

The Symbol Sourcebook

08 Jun 2018

Differences between Icon and Logo Design on This is HCD Podcast

10 Apr 2018

Twelve South PencilSnap

01 Apr 2018

The Infinite Canvas

09 Feb 2018

Instagram Hickstagram

  • 16 Oct 2018

    Inktober day 16 “The Pilot” - a response to @hicksmade’s barber shop poster. Experimenting with a different style on this one #inktober #inktober2018 #leighandjondoinktober #pilot

  • 15 Oct 2018

    Inktober Day 15. @hicksmade’s staircase led me to this. There must be a hairdressers somewhere called this? #inktober #inktober2018 #leighandjondoinktober #hairwaytosteven

  • 14 Oct 2018

    Inktober day 14 - from @hicksmade’s theme of escape, and tonight’s Dr Who, with a return to classic theme: running!. #inktober #inktober2018 #leighandjondoinktober #drwho #pictogram #signage

  • 14 Oct 2018

    Inktober day 13 is more of a doodle as time was very short! There was a bird in @hicksmade’s day 13 so I ran with that. . #inktober #inktober2018 #leighandjondoinktober

  • 12 Oct 2018

    Inktober Day 12. Thinking about @hicksmade’s lumos led me to this “please don’t turn me off…”. #inktober #inktober2018 #leighandjondoinktober #sadlightswitch

  • 11 Oct 2018

    Inktober Day 11. The shape of @hicksmade’s spoons made me think of the Mandrake - a root that looks like a tiny human. There are lots of legends around it, but this one is based on the Harry Potter interpretation. . #inktober #inktober2018 #leighandjondoinktober #mandrake #harrypotter

  • 10 Oct 2018

    Inktober day 10. @hicksmade led with a lovely bee, which made me think of the Jesus and Mary Chain song “Just like honey”. Fancied trying something different so went for a 60s typographical thingy . #inktober #inktober2018 #leighandjondoinktober #honey

  • 10 Oct 2018

    Beautiful morning at North Leigh Common!

  • 09 Oct 2018

    Inktober day 9, as the crow flies. An obvious link from @hicksmade’s scarecrow, but I’m much happier with this one compared to yesterday’s. #inktober #inktober2018 #leighandjondoinktober #crow

  • 09 Oct 2018

    Inktober day 8 and boy am I cross with how this one turned out. It’s utter pants. Supposed to be Bill Murray and Scarlet Johannsen in Lost in Translation, not that you could tell from this. Bill looks like a zombie, and goodness knows what that is on the right. It put me in such a bad mood last night, but I need to let it go and move on. (I even cheated a bit and touched up some bits in Photoshop!). The one bit I’m happy with is his neck, and that’s it. Rant over #inktober #inktober2018 #leighandjondoinktober

Contact us

Call Jon on +44 (0)7917 391536, email or tweet @hicksdesign.

Alternatively, pop in for tea and cake at the studio…

Hicks
Wenrisc House
Meadow Court
Witney, OX28 6ER
United Kingdom