Announcement

Collapse
No announcement yet.

Include fragments in product page?

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

    Include fragments in product page?

    Is there a way I can 'php include' or similar section fragments into a product page of a product in the same section using the <actinic:variable name="FragmentAnchor" /> of the fragment?

    Thank you.
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    #2
    OK: This works if there is only one product in the section:

    Wrap the fragment layout in a div by putting this at the top of the fragment: <div id="include<actinic:variable name="FragmentAnchor" />">
    and </div> at the bottom

    Code:
    		<div id="include<actinic:variable name="FragmentAnchor" />">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22FragmentImageFileName%22%20%2f%3e%20%21%3d%20%22%22">
    		<actinic:variable formatting="div,style|set-right" name="FragmentImage" />
    	</actinic:block>
    <actinic:variable name="FragmentVideo" />
    <actinic:block if="%3cactinic%3avariable%20name%3d%22FragmentAnchor%22%20%2f%3e%20!=%20%22%22" >
    		<a name="<actinic:variable name="FragmentAnchor" />"></a>
    	</actinic:block>
    	<actinic:block if="%3cactinic%3avariable%20name%3d%22FragmentTitle%22%20%2f%3e%20%21%3d%20%22%22">
    		<actinic:variable formatting="h2" name="FragmentTitle" />
    	</actinic:block>
    <actinic:variable formatting="div,style|fragment-text" name="FragmentText" />
    </div>
    Then on your product page add this:

    Code:
    	<div id="fragmentstuff"></div> 
    <script>
    $( "#fragmentstuff" ).load( "Childrens-Earrings.html #includea50" );
    </script>	
    </div>
    Where Childrens-Earings.html is the respective section URL. Drawback is you have to find the value for the fragment anchor before you can comleplete the code and I don't know how it could be made to work with multiple products. Can anyone develop and improve this please???

    Thanks
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    Comment

    Working...
    X