No announcement yet.

Custom Code on MasterPage (Every page)

  • Filter
  • Time
  • Show
Clear All
new posts

    Custom Code on MasterPage (Every page)

    I know that HomeSeer doesn't use ASPX and have masterpages and was wondering if there was an easy way to inject asp code to the top portion of every page?

    Hopefully you'll get a reply off of one of the web page gurus (Jon00 etc) but there is this function in the Web Site setup page;

    "Functions To Call with Body Onload (Put script code in meta.htm):"

    I don't quite know whether this will do what you are after, but it may be somewhere to start if all else fails


      If you are writing your own pages you can add the following to the top of the pages.

      <!-- #include file="/path/page.asp" -->

      If you are talking about the HomeSeer generated pages... the answer would be no.

      The body onLoad is used for javascripts.
      I do use the onLoad to add some info to the logo bar on the HS generated pages.

      In the meta.htm I have the following.
      ************************************************************ *****
      &lt;SCRIPT language="Javascript" src="/weathercom_xml/weathercondition.js"></SCRIPT>
      function displayWeather() {
      ************************************************************ *****
      I then have a script that runs every so often and outputs the javascript.

      For example the weathercondition.js has the following line.
      newImage="&nbsp;&lt;img height='20' align='absmiddle' border='0' src='/Images/weathericons/cond_small/33.gif'> &lt;b>Sunrise:&lt;/b> 7:14 AM"

      I added displayWeather() to the body on load in the HomeSeer setup pages.

      What this does is replace the sunrise icon with an icon of the current weather condition.
      I have another javascript that puts a scrolling weather forecast in the logo bar.

      It's not as good as asp but you can do a few things.
      Jeff Farmer
      HS 3, HSPhone
      My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
      Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

      Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2