Skip to content

Instantly share code, notes, and snippets.

@aaronmcadam
Created September 16, 2010 16:56
Show Gist options
  • Select an option

  • Save aaronmcadam/582752 to your computer and use it in GitHub Desktop.

Select an option

Save aaronmcadam/582752 to your computer and use it in GitHub Desktop.
// Banner Images:
// Dealing with the case of an image not existing for a given page, dealing with main section header images, stripping out sub page names too
$strippedName = substr($name, 0, strpos($name.'/', '/')); // stripping out sub page names
$imagePath=$root.'/images/header_images/' . $strippedName . '.jpg';
if ( file_exists($imagePath) === false) {
$dbXML.='<noBannerImage>No banner image exists for this page</noBannerImage>';
}
/*
Then in XSLT sheet:
<xsl:if test="count(/page/noBannerImage) = 1">
<img src="/images/banner_images/default.jpg" alt="{/page/name}" width="727" height="295" />
</xsl:if>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment