• Fantastic Plugin…

    I have created a custom template from pdb-list-default.php as pdb-list-phone.php. I plan on using this template in a shortcode designated for phone layouts only.

    My desire is to show FIRSTNAME, LASTNAME, EMAIL but I wish to show the email link as an icon – not as an email in text form (ie jsmith@gmail.com).

    One, is this possible?
    Two, is using a custom template the best method in your opinion?

    Or is there actually a way to accomplish this in the Manage Data Fields Section?

    Thank You In Advance,

    Jeffrey

    https://wordpress.org/plugins/participants-database/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Roland Barker

    (@xnau)

    HI Jeffrey,

    You can’t do this in the manage database fields, you will need to use a custom template. If you’re good with code, you can also do it by using a callback that alters how the email field is displayed.

    Thread Starter Q2Tech

    (@q2tech)

    I figured as much but thanks for the confirmation on that.

    So as I am attempting to use a custom template to deal with this would you agree the template I am using (pdb-list-default.php) will get the job done?

    I am guessing i need to inject an email specific snippet within this:

    =====================================================================
    <tbody>
    <?php while ( $this->have_records() ) : $this->the_record(); // each record is one row ?>
    <tr>
    <?php while( $this->have_fields() ) : $this->the_field(); // each field is one cell ?>

    <td class=”<?php echo $this->field->name ?>-field”>
    <?php $this->field->print_value() ?>
    </td>

    <?php endwhile; // each field ?>
    </tr>
    <?php endwhile; // each record ?>
    </tbody>

    =====================================================================

    Can i just echo the field from the recordset and either use CSS or IMG SRC to turn the record’s email link into an icon?

    Just want to make sure I am at least on the right path here 🙂

    Plugin Author Roland Barker

    (@xnau)

    The easiest way is to test the field name in the loop and when your email field comes by output your modified link instead of the $this->field->print_value(). You can access the value of the current field with $this->field->value

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Email Link as Icon’ is closed to new replies.