Jump to content

Question regarding product group variable for displaying dynamic content on products.tpl


Recommended Posts

Hi All,

I would like to include certain information on the products.tpl based on which product group is currently being displayed.

For instance, if a customer is viewing our web hosting packages, I'd like to show a hosting FAQ below the products display.

I'm thinking this could be done with a simple {if/else} to include the appropriate faq.tpl, but not sure how to call the variable to differentiate between displayed product groups.

I know similar {if/else} statements are littered throughout the various templates, but I can't seem to find reference to the variable I'd need to call in this instance.

As always, thank you in advance for any assistance.

Todd

Link to comment
Share on other sites

Ha! Every. Time!

I've searched off-and-on for a couple days on how to do this, and 20 minutes after asking for help, come across the answer. 🤪

Here's what I put in place, and it seems to work OK:

{if $groupname eq "Fully Managed Hosting"}
    {include file="$template/assets/layout/sections/faqHosting.tpl"}
{else}
    
{/if}

I'd still be interested in comments, whether this is the best way to managed what I'm trying to do, etc.

Thank you again, all!

Todd

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated