Support » Plugin: teachPress » Format the teachpress output

  • HI all,
    I would like to ask you if there is anyone who could help me with format of output to show my list of publication. Is it possible to achieve this type of output? For example:

    Surname M, ALano A: Progress and challenges. <em>Appl. Mater. Today, 1, 222, 2000</em>. (DOI)

    I mean:
    Full last name,
    The first letter of the name
    Then sign :
    Then title of publication
    Then sign .
    Then name or abbreviation of journal name
    Then publication details (volume, issue, year)

    How can i remove: Links BibTeX?

    Thank you very much for any help.
    Smith

Viewing 1 replies (of 1 total)
  • Hello,

    To achieve this, you will have to duplicate the teachpress template folder in your uploads directory and edit the PHP template code.

    – Visit Teachpress settings page (settings > teachpress)

    – open the “template” tab

    – Click on the link at the top of the “temlplate” tab content : “But you can change the directory for the templates” and the plugin will display the code you have to add in wp-config.php.
    Something like :
    define (‘TEACHPRESS_TEMPLATE_PATH’, ‘/……/wp-content/uploads/teachpress/templates/’);
    define (‘TEACHPRESS_TEMPLATE_URL’, ‘…../wp-content/uploads/teachpress/templates/’);

    – duplicate Teachpress template folder (/wp-content/plugins/teachpress/templates/) at the new path (/wp-content/uploads/teachpress/templates/)

    – Edit the files as you need.
    That may be tricky of you don’t have good knowledge of PHP language.

    In example, here is the code I use to change the display for authors and have their names just separated by commas, with a simple str_replace() on the authors values.

    public function get_entry ($interface) {
          $auteurtemp = $interface->get_author('<p class="tp_pub_author">', '</p>');
          $auteurtemp = str_replace(",","",$auteurtemp);
          $auteurtemp = str_replace(";",",",$auteurtemp);
          // $auteurtemp = str_replace("</p>",".</p>",$auteurtemp);
    
            $class = ' tp_publication_' . $interface->get_type('');
            $s = '<div class="tp_publication' . $class . '">';
            $s .= $interface->get_number('<div class="tp_pub_number">', '.</div>');
            $s .= $interface->get_images('left');
            $s .= '<div class="tp_pub_info">';
            $s .= $auteurtemp;
            $s .= '<p class="tp_pub_title">' . $interface->get_title() . ' ' . $interface->get_type() . ' ' . $interface->get_label('status', array('forthcoming') ) . '</p>';
            $s .= '<p class="tp_pub_additional">' . $interface->get_meta() . '</p>';
            $s .= '<p class="tp_pub_menu">' . $interface->get_menu_line() . '</p>';
            $s .= $interface->get_infocontainer();
            $s .= $interface->get_images('bottom');
            $s .= '</div>';
            $s .= $interface->get_images('right');
            $s .= '</div>';
            return $s;
        }

    You can compare it with the original code in the files you use as template (tp_template_20xx.php).

    Hope this helps !

    • This reply was modified 8 months, 3 weeks ago by Ishko.
Viewing 1 replies (of 1 total)
  • The topic ‘Format the teachpress output’ is closed to new replies.