Jump to content

gckmac

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by gckmac

  1. It was a mistake to push the Report button. And I fully agree with Gurus. I've done this many times but am just having trouble in this instance.
  2. The problem is that having only 1 header include means that the Title & Description tags cannot change for the relevant page. This was bad coding for SEO purposes. Workaround is IF/ELSE, but having trouble implementing.
  3. I should add that the invoked file tpl_portfolio_category.html also references header.tpl: <? include_once 'parts/header.tpl'; ?> {header} <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td class="main"><h1><span class="firstLetter">{image_category}</span></h1> <p> </p> <table height="89" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="7"> </td> </tr> <!-- BEGIN block_thumb --> <tr> <td width='180' height="120" background="./images/thumb-bg.gif"> <div align="center">{thumb1}</div></td> <td width="10"> </td> <td width='180' background="./images/thumb-bg.gif"> <div align="center">{thumb2}</div></td> <td width="10"> </td> <td width='180' background="./images/thumb-bg.gif"> <div align="center">{thumb3}</div></td> <td width="10"> </td> <td width='180' background="./images/thumb-bg.gif"> <div align="center">{thumb4}</div></td> </tr> <tr valign="bottom"> <td height="3"></td> <td height="3"></td> <td height="3"></td> <td height="3"></td> <td height="3"></td> <td height="3"></td> <td height="3"></td> </tr> <!-- END block_thumb --> </table> <br> <img src="images/spacer.gif"></td> </tr> </table> {footer}
  4. For SEO purposes, I need to have a different header for the different portfolio pages generated on the following site: The primary page http://tcnyc.com/portfolio.php invokes the following, based on vf_category: http://tcnyc.com/por...egory=Bathrooms http://tcnyc.com/por...tegory=Kitchens The code at portfolio_category.php uses the following to set the header: //Show header $template_header = new HTML_Template_IT(); $template_header->loadTemplateFile("parts/header.tpl",true,false); $template_body->setVariable('header', $template_header->get()); The problem is the 2nd item, where parts/header.tpl is fixed. I need to use Bathroomsheader.tpl for bathrooms, Kitchensheader.tpl for kitchens, etc. (or some similar nomenclature). This is because the header (with Title & Description tags) needs to change based on category. The existing code is: <?php $vc_root_friendly = '.'; $vc_root_site = '.'; include_once("$vc_root_site/config.php"); include_once("$vc_includes_folder/IT.php"); $template_body = new HTML_Template_IT(); $template_body->loadTemplateFile("tpl_portfolio_category.html"); include_once("$vc_includes_folder/images.php"); if(!isset($_REQUEST['vf_category'])){ header("location:portfolio.php"); die(); } //Show header $template_header = new HTML_Template_IT(); $template_header->loadTemplateFile("parts/header.tpl",true,false); $template_body->setVariable('header', $template_header->get()); //Show footer $template_footer = new HTML_Template_IT(); $template_footer->loadTemplateFile("parts/footer.tpl",true,false); $template_body->setVariable('footer', $template_footer->get()); $template_body->setVariable("image_category", $_REQUEST['vf_category']); //Select photos for this category $vl_photos = $DB->q("SELECT * FROM $vc_prefix"."photo_gallery WHERE category = '$_REQUEST[vf_category]' ORDER BY id_photo"); //Show photos etc. Does anyone know how to modify this code such that the vf_category pulled from the database can cause includes of the correct header.tpl? I know that it will involve if & else commands, i.e., if vf_category = Bathrooms, then use header name A, else use head name B, etc. Thanks in advance! gckmac
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.