Announcement

Collapse
No announcement yet.

Variable to see product's parent section name

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

    Variable to see product's parent section name

    Hi all,

    I hope someone can help me:

    If I'm viewing a product within a section, is it possible to get the parent section name in a variable?

    Thanks in advance

    Dean

    #2
    There's no such variable (I think) but the following will display the parent section name if used in a Product Layout:
    Code:
    <actinic:block php="true">
    	$prevlevel = <actinic:variable name="SectionLevel" selectable="false" /> - 1;
    	<actinic:block type="ParentSectionList">
    		if ( <actinic:variable name="SectionLevel" selectable="false" /> == $prevlevel ) echo '<actinic:variable name="SectionName" encoding="perl" selectable="false" />';
    	</actinic:block>	
    </actinic:block>
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      NormanRouxel - thank you that is perfect solved my problem although, I didn't take into account when there are more than 2 sections holding products. For example:

      Section 1 -> Section 2 -> Section 3 -> Product

      I'd like to know the name of Section 2 if possible!

      Thanks again

      Comment


        #4
        Sorry for my late reply - you are correct, my mistake.

        So that's working now but I am getting these error messages:

        "The 'SectionLevel' variable has been placed within the 'Kaisertech Catalog' layout, but it won't work there. Click here to go to the code."

        What am I missing?

        Thank you!

        Comment


          #5
          Also, is there a way to check if a product is active. Say on a menu if that is the current active product add this class?

          Thanks again

          Comment

          Working...
          X