Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30
  1. #21
    Join Date
    Mar 2010
    Posts
    251
    Plugin Contributions
    0

    Default Re: Different Header for contact page?

    Quote Originally Posted by moesoap View Post
    I have tried this but cannot get it to work

    PHP Code:
    if ($current_page_base == 'main_page=document_product_info' and $cPath=='123' and $products_id=='229') {
    require(
    $template->get_template_dir('tpl_header2.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_header2.php');
    }
    else
    require(
    $template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_header.php');?> 
    ^^bump^^ Anyone?

  2. #22
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Different Header for contact page?

    Don't be so impatient - it can sometimes be a day before someone who knows your answer sees the thread.

    You don't test for $current_page_base to be 'main_page=document_product_info', you test for 'document_product_info', similar to other page tests described.
    PHP Code:
    if ($current_page_base == 'document_product_info' and $cPath=='123' and $products_id=='229') { 

  3. #23
    Join Date
    Mar 2010
    Posts
    251
    Plugin Contributions
    0

    Default Re: Different Header for contact page?

    Quote Originally Posted by gjh42 View Post
    Don't be so impatient - it can sometimes be a day before someone who knows your answer sees the thread.

    You don't test for $current_page_base to be 'main_page=document_product_info', you test for 'document_product_info', similar to other page tests described.
    PHP Code:
    if ($current_page_base == 'document_product_info' and $cPath=='123' and $products_id=='229') { 
    Thankyou for replying. I tried what you suggested and it didn't work. The code i used was -

    PHP Code:
    <?php
     
    /**
      * prepares and displays header output
      *
      */
      
    if ($current_page_base == 'cuzhy_clothing' or 'document_product_info' and $cPath=='123' and $products_id=='229') {
    require(
    $template->get_template_dir('tpl_header2.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_header2.php');
    }
    else
    require(
    $template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_header.php');?>
    The first section worked. However the product_info page did not?

  4. #24
    Join Date
    Mar 2010
    Posts
    251
    Plugin Contributions
    0

    Default Re: Different Header for contact page?

    Quote Originally Posted by gjh42 View Post
    Don't be so impatient - it can sometimes be a day before someone who knows your answer sees the thread.

    You don't test for $current_page_base to be 'main_page=document_product_info', you test for 'document_product_info', similar to other page tests described.
    PHP Code:
    if ($current_page_base == 'document_product_info' and $cPath=='123' and $products_id=='229') { 
    Got this to work with 'document_product_info' selected only. It won't work with the rest of the code, i.e. cpath and products id.

    However this is sufficient for me.

    Thanks gjh42 for your help.

  5. #25
    Join Date
    Mar 2010
    Posts
    251
    Plugin Contributions
    0

    Default Re: Different Header for contact page?

    Quote Originally Posted by moesoap View Post
    Got this to work with 'document_product_info' selected only. It won't work with the rest of the code, i.e. cpath and products id.

    However this is sufficient for me.

    Thanks gjh42 for your help.
    Forget that, that solution changed all the headers.

  6. #26
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Different Header for contact page?

    PHP Code:
      if ($current_page_base == 'cuzhy_clothing' or 'document_product_info' and $cPath=='123' and $products_id=='229') { 
    You didn't mention that you had multiple page base tests going on. You should use parentheses to ensure that the tests are grouped as you intend. The above won't test for $current_page_base == 'document_product_info'; to be certain, you need to state it as
    PHP Code:
      if ($current_page_base == 'cuzhy_clothing' or ($current_page_base == 'document_product_info' and $cPath=='123' and $products_id=='229')) { 

  7. #27
    Join Date
    Mar 2010
    Posts
    251
    Plugin Contributions
    0

    Default Re: Different Header for contact page?

    Quote Originally Posted by gjh42 View Post
    PHP Code:
      if ($current_page_base == 'cuzhy_clothing' or 'document_product_info' and $cPath=='123' and $products_id=='229') { 
    You didn't mention that you had multiple page base tests going on. You should use parentheses to ensure that the tests are grouped as you intend. The above won't test for $current_page_base == 'document_product_info'; to be certain, you need to state it as
    PHP Code:
      if ($current_page_base == 'cuzhy_clothing' or ($current_page_base == 'document_product_info' and $cPath=='123' and $products_id=='229')) { 
    Thankyou gjh42. The cpath and products id didnt work, however the document_product_info did and its applying only to that and not taking over all the headers.

    Thanks again.

  8. #28
    Join Date
    Feb 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Different Header for contact page?

    I used Glen's code for my home page, and it works perfectly. But, I want to do the same for a couple of ez pages. Seems to me we should be able to insert an 'elseif' statement in there somewhere to include ezpage_id numbers. I tried the 'array' statement above, but couldn't get it to work. Any suggestions?

  9. #29
    Join Date
    Feb 2010
    Posts
    16
    Plugin Contributions
    0

    Default Re: Different Header for contact page?

    I think I'm looking for something like the following, but I don't know how to write it:

    if ($this_is_home_page) {
    require($template->get_template_dir('tpl_header_home.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_home.php');}
    elseif ($ezpage_id=="15") {
    require($template->get_template_dir('tpl_header_home.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header_home.php');}
    else{
    require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');}


    This way, my home page, as well as any number of EZ Pages could use the same header...(I think).

  10. #30
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Different Header for contact page?

    PHP Code:
    elseif ($current_page_base == 'page' and in_array($_GET['id'], explode(',''15,27,31,8'))) {//for ez-page ids 15,27,31 or 8 

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. how to get different header for different pages? - Without CSS
    By markpr9 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 15 Apr 2009, 04:34 PM
  2. Different header for each page
    By lavergara in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 31 Aug 2007, 03:32 AM
  3. Different header for different product categories possible?
    By Rotkale in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 14 Dec 2006, 12:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg