Dif template per product?

Discussion in 'Templates customization' started by brandon515, Dec 18, 2006.

  1. brandon515

    brandon515 Member

    Joined:
    Dec 9, 2006
    Messages:
    47
    Is it possible to use a different template for each product?

    Any help would be really appreciated.

    Thanks,
    Brandon
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Sorry, what template should be different?
  3. brandon515

    brandon515 Member

    Joined:
    Dec 9, 2006
    Messages:
    47
    The signup page template.

    Brandon
  4. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Yes, it is possible. You can define different "Price Group" in product settings, then in the signup template (amember/templates/signup.html) use conditional directives

    {if $smarty.request.price_group eq "1"}
    display html code for first price group
    {elseif $smarty.request.price_group eq "3"}
    display html code for third price group
    {/if}
  5. brandon515

    brandon515 Member

    Joined:
    Dec 9, 2006
    Messages:
    47
    Ah, very cool.

    Not being a big programmer, I am wanting to have a specific header & footer displayed depending on price_group. So where you say:

    "display html code for first price group"

    would I just have it call my header or footer html there?

    Something like:

    Code:
    {if $smarty.request.price_group eq "1"}
    {include file="header1.html"}
    {elseif $smarty.request.price_group eq "3"}
    {include file="header2.html"}
    {/if}
    Thanks,
    Brandon
  6. brandon515

    brandon515 Member

    Joined:
    Dec 9, 2006
    Messages:
    47
    Nevermind...that worked!

    Thanks Alex!
  7. daviddalley

    daviddalley New Member

    Joined:
    May 17, 2007
    Messages:
    2
    Getting it! - but. . .

    I am trying to set up what sounds like Brandon515 did with the signup templates. I am needing to create a few totally different looking signup pages. I don't want one to look like the other. I think I understand how to change out the header and footer per the price group with the code info he used. But what about other content? I have, for example, a column to the right of the signup form. Is it possible to change text within the signup.html template per price group?

    Thanks,

    David
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Sure you can do this the same way:
    {if $smarty.request.price_group eq "1"}
    Text for price_group 1
    {elseif $smarty.request.price_group eq "3"}
    Text for price_group 3

    {/if}
  9. bluewren2

    bluewren2 New Member

    Joined:
    Jun 18, 2007
    Messages:
    1
    For the technically challenged, could you explain just where in signup.html this piece of code goes. :confused:

    For example could you put something like this: in the first quarter of the page after {if in_array($p.product_id, (array)$smarty.request.product_id)}checked="checked"{/if}

    For myself that would be a help if I could identify the code the line before where you insert the new code. :D

    Also do you have to delete any of the code that is already there to put it in?

Share This Page