简体   繁体   中英

Prestashop, add hyperlink to website in backoffice tab

I have a custom admin page in prestashop and i would like to add a URL link at the bottom of that page. However, i am very new to prestashop and can not figure out how to do this.

I have an admin controller file for the module that creates the custom page with a form on it and was wondering how i can add a link at the bottom of the page that simply goes to another static page on the site or even an external page.

AdminFedeltaSchoolsController.php content

<?php
class AdminFedeltaSchoolsController extends ModuleAdminController {

    public function __construct() {

        // Configure admin controller with table, model, language and bootstrap theme
        $this->table = 'fedeltapos_school';
        $this->className = 'FedeltaposModel';
        $this->lang = true;
        $this->bootstrap = true;

        // Generat action on list   
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        // This adds a multiple deletion button
        $this->bulk_actions = array(
            'delete' => array(
                'text' => $this->l('Delete selected'),
                'confirm' => $this->l('Delete selected items?')
            )
        );
        // Generat list
        $this->fields_list = array(
            'id_fedeltapos_school' => array(
                'title' => $this->l('ID'),
                'align' => 'center',
                'width' => 25
            ),
            'school_name' => array(
                'title' => $this->l('School Name'),
                'width' => 'auto'
            ), 
            'delivery' => array(
                'title' => $this->l('Delivery'),
                'width' => 'auto'
            ),
            'pickup' => array(
                'title' => $this->l('Pickup'),
                'width' => 'auto'
            ),
            'pricelevel' => array(
                'title' => $this->l('Price Level'),
                'width' => 'auto',
            ),
        );

        parent::__construct();
    }

    // This method generates the Add/Edit form
    public function renderForm() {
        // Building the Add/Edit form
        $this->fields_form = array(
            'legend' => array(
                'title' => $this->l('Schools'),
                'icon' => 'icon-envelope-alt'
            ),
            'input' => array(
                array(
                    'type' => 'text',
                    'label' => $this->l('School Name:'),
                    'name' => 'school_name',
                    'lang' => true, 
                    'size' => 33,
                    'required' => true,
                ), array(
                    'type' => 'text',
                    'label' => $this->l('Delivery:'),
                    'name' => 'delivery',
                    'size' => 33,
                    'required' => true,
                ),
                array(
                    'type' => 'text',
                    'label' => $this->l('Pickup:'),
                    'name' => 'pickup',
                    'size' => 33,
                    'required' => true,
                ),
                array(
                    'type' => 'text',
                    'label' => $this->l('Price Level:'),
                    'name' => 'pricelevel',
                    'size' => 33,
                    'required' => true,
                ),
            ),
            'submit' => array(
                'title' => $this->l('Save')
            )
        );
        return parent::renderForm();
    }
}

I would like the link at the bottom of the page (see screenshot): http://awesomescreenshot.com/08252wdh8a

Any assistance will be appreciated.

Override the default content admin template file of your admin controller.

Create /your-admin-folder/themes/default/template/controllers/fedelta_schools/content.tpl

{if isset($content)}
    {$content}
{/if}

{block name="override_tpl_schools"}
    <div class="row">
        <div class="col-lg-12">
            <div class="panel">
                <h3>
                    <i class="icon-info"></i>
                    {l s='Help'}
                </h3>
                <p>{l s='You can find answer of your question here :'} <a href='#'>{l s='FAQ'}</a> </p>
            </div>
        </div>
    </div>      
{/block}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM