Adding custom fields

Discussion in 'Templates customization' started by arpowers, May 16, 2010.

  1. arpowers

    arpowers New Member

    Joined:
    Nov 8, 2009
    Messages:
    24
    What is the easiest way to add custom fields to products in aMember?
    For instance add:
    product thumb url,
    product overview url,
    product demo url

    so I can use them in the templates?
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Use the amember admin / add fields, then you can display them on the members page etc..

    {$smarty.request.fieldname}

    David
  3. arpowers

    arpowers New Member

    Joined:
    Nov 8, 2009
    Messages:
    24
    That seems to be a customer side field.

    What I mean is, how can I add custom values like a thumbnail url, or a product demo url in the admin so I can use them in the template?

    For example, I want to display the products with a thumbnail; to spice up the template. How can this be done?
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Oh, misread, that would require customization to amember, possibly could be done with a plugin.

    I have helped my members do this without using database entries, but instead using the product ID to call an image in the template eg product1.gif

    David
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Add this code to /amember/site.inc.php:
    PHP:
    <?php 
    add_product_field
    ('thumbnail''Thumbnail Image URL''text''');
    ?>
    this will add field to product settings. Then you will be able to use it in template: {$p.thumbnail} or {$product.thumbnail} depends on template.

Share This Page