Announcement

Collapse
No announcement yet.

Hide outer layout content on product page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hide outer layout content on product page

    Does anyone know how do hide some content in the outer layout, only on a product page? I am using the final single product page method.

    I know I can use the following to display some content in the outer layout on a product page only, but I'm getting confused with trying to reverse the logic:

    <actinic:block type="ProductList">
    Testing
    </actinic:block>

    I can't use the PageType == "Section" method as I don't want my content to be displayed on any section pages.

    Norman suggested the following, but I don't understand how to implement it:
    "Set a PHP variable outside the block.
    Set it to a different value within the block.
    Use PHP to test said variable after the block and output code conditionally."


    Site as is: http://www.pixelcreation.co.uk/ie-store/
    Web . Design . Multimedia . Branding

    #2
    What content are we talking about, can you do something using just the list layout instead?

    Comment


      #3
      Try:
      Code:
      <actinic:block php="true">$productonpage = false;</actinic:block>
      <actinic:block type="ProductList">
        <actinic:block php="true">$productonpage = true;</actinic:block>
      </actinic:block>
      <actinic:block php="true">
        if ($productonpage)
          {
          $html = <<<ENDOFCODE
      Actinic code goes here
      ENDOFCODE;
          echo $html;
          }
      </actinic:block>
      Note that the ENDOFCODE; line must start in the left hand margin. Do not indent it.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Norman, that worked a treat! Many thanks.

        Had to make a minor tweak to reverse the logic as I wanted the content to not display on a product page but appear everywhere else:

        Code:
        <actinic:block php="true">$productonpage = true;</actinic:block>
        <actinic:block type="ProductList">
          <actinic:block php="true">$productonpage = false;</actinic:block>
        </actinic:block>
        <actinic:block php="true">
          if ($productonpage)
            {
            $html = <<<ENDOFCODE
        Actinic code goes here
        ENDOFCODE;
            echo $html;
            }
        </actinic:block>
        Web . Design . Multimedia . Branding

        Comment


          #5
          Richard

          Could you edit your tweak above to replace all

          $productonpage

          with

          $noproductonpage

          As this will help others who may come along later understand it.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Done, but I don't understand. What purpose does it serve?

            Code:
            <actinic:block php="true">$noproductonpage = true;</actinic:block>
            <actinic:block type="ProductList">
              <actinic:block php="true">$noproductonpage = false;</actinic:block>
            </actinic:block>
            <actinic:block php="true">
              if ($noproductonpage)
                {
                $html = <<<ENDOFCODE
            Actinic code goes here
            ENDOFCODE;
                echo $html;
                }
            </actinic:block>
            Web . Design . Multimedia . Branding

            Comment


              #7
              Readability. Someone seeing if ($productonpage) and finding it does the opposite of what it implies may be very confuddled.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Sorry Norman, makes complete sense. Think I need another coffee!
                Web . Design . Multimedia . Branding

                Comment

                Working...
                X