Announcement

Collapse
No announcement yet.

Hiding sidebar on product pages, but not other pages

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

    Hiding sidebar on product pages, but not other pages

    I currently have two types of pages on my site.

    1) Product page - contains 1 product (in it's own sub-section) - e.g. http://shop.packyourbags.com/acatalo...r_LG_8x21.html

    2) Section page - contains a list of sub-sections or a list of duplicate products. E.g.
    http://shop.packyourbags.com/acatalo...inoculars.html

    They both currently use the same template/layout which has a left sidebar containing a small menu, email sign-up etc.

    Is there a way I can show the sidebar on the section pages, but hide it on the product pages?

    I am trying to use a block if, but I don't know what variable I could use.

    #2
    You'd create the variable that did the switching, you'd then set that accordingly at the appropriate levels.

    Comment


      #3
      Would this involve going through each page on my site and setting the value to show/hide?

      If so I have over 1000 pages, so it would take a long time to do this. Is there any other way of doing it which wouldn't involve going through all my pages?

      I was thinking there might be a variable that only appears in the product layout and not the section layout. I could then use a block if to see if that variable is on the page. Is there any variables like this?

      Comment


        #4
        Originally posted by leehack View Post
        You'd create the variable that did the switching, you'd then set that accordingly at the appropriate levels.
        What Lee was telling you is that you need to create a variable yourself. A true/fasle one perhaps? Then use than in the blockif...

        Army Gore-tex
        Winter Climbing Mitts
        webD's Blog: Website design, SEO and other ramblings…
        Twitter LinkedIN

        If you think a post is good, rate it!

        Find the answers in the Knowledge Base | Have you read the User Guides

        Comment


          #5
          Originally posted by webD View Post
          What Lee was telling you is that you need to create a variable yourself. A true/fasle one perhaps? Then use than in the blockif...
          Yes ok, I may have to do it this way. Once the new variable is set up I would need to go through 1000+ pages and set them to either true or false. I was hoping there was another way of doing it.

          If anyone has any ideas please let me know.

          Comment


            #6
            No, just edit the page layouts.

            Army Gore-tex
            Winter Climbing Mitts
            webD's Blog: Website design, SEO and other ramblings…
            Twitter LinkedIN

            If you think a post is good, rate it!

            Find the answers in the Knowledge Base | Have you read the User Guides

            Comment


              #7
              Is the section level the same on all products? You could use the section level conditions if so.

              Comment


                #8
                Originally posted by leehack View Post
                Is the section level the same on all products? You could use the section level conditions if so.
                Unfortunately the products are at different section levels.

                Comment


                  #9
                  Well you're going to need to evaluate something that is exclusive to the product layout level to make a decision whether you are at product level or not. I'm sure there is something for this, but i can't for the life of me remember what it was. I think my first port of call would be the product price, if that is empty, then you know you're not at product level yet. Maybe a blockif checking whether product price is empty or not, wrapped around the column you wish to get rid of. That kind of logic will be the starting point, or at least it would be my starting point on this. You are almost certainly going to need PHP also.

                  You could try adding a product level variable, fill it out with a standard value (so all products have a value) and then try evaluating that at different levels of the structure to see if it can be evaluated to illustrate product level reached.

                  Comment


                    #10
                    Following Lee's logic above see http://community.actinic.com/showpos...90&postcount=4 which places the product price at the section level.

                    As you are wanting to work at a level above where you are testing this is not going to be a straight fight.

                    I have just done something similar but removed the side bar from the brochure pages on a site I have just developed to allow a single outer layout to be used (no messing with 2 layouts - bah!)

                    product page

                    brochure page

                    Think what you want to achieve and attack it standing on your head.


                    Bikster
                    SellerDeck Designs and Responsive Themes

                    Comment


                      #11
                      Thanks for your help, this is almost working now.

                      If I have a page with only sections and then a page with only products, the above code works for separating the two. I can then hide or show the sidebar depending on the result.

                      However some of my section pages have a list of duplicate products.

                      Is there a way I can check to see if the page has products or duplicate products?

                      My products & duplicate products use a different layout, so perhaps I could use this some how.

                      Any ideas?

                      Comment


                        #12
                        Duplicates have a different product reference, so you could possibly look for that. I think there are some standard conditions relating to duplicates too, have a look at those. If you don't get anywhere, then setting your own section level variable to set the condition is probably the best way, although i'd be amazed if you can't use php in some way to find out whether duplicates or not.

                        Comment


                          #13
                          Is there a way I can check to see if the page has products or duplicate products?
                          From the Variable Reference Guide:

                          ProductType: Type of product (0 = Product, 1 = Duplicate, 2 = Fragment)
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #14
                            That's the bugger!

                            Comment


                              #15
                              I have managed to get this working using the code below. My product page template has the word "ProductPage" in it. (my duplicate product layouts, and section layouts don't have this). So I look for this word with php.

                              However I have a problem with this. Most of the time this works, and sometimes it doesn't. For example I could try it on one page and it works, but then I could try the exact same page a minute later, and it might not work. Maybe this means the php code works, but actinic doesn't run the php every time it loads the page. Any ideas what is happening?

                              Code:
                              <actinic:block type="ProductList" >
                              <actinic:block type="PriceList" >
                              	<actinic:block php="true" >
                              	
                              	$productlayout = '<actinic:variable encoding="perl" name="ProductLayout" />';
                              	
                              	// echo $productlayout;
                              	
                              	$pos = strpos($productlayout,'ProductPage');
                              	
                              	if($pos === false) {
                              		// echo 'no';
                              		$PageType = 'section';
                              	}
                              	else {
                              		// echo 'yes';
                              		$PageType = 'product';
                              	}
                              	
                              	</actinic:block>
                              </actinic:block>
                              </actinic:block>
                              Then I use:

                              Code:
                              <actinic:block php="true" >
                              if ($PageType == "section")
                              	{
                              		// code to show sidebar goes here
                              	}
                              </actinic:block>

                              Comment

                              Working...
                              X