Jump to content

<ASK> Membuat Modul Text


Recommended Posts

mungkin bisa membantu, buat module baru aja.
Pertama, bikin folder di folder modules. Seumpama buat module allo. Bikin modules/allo. File-filenya : allo.php, allo.tpl, config.xml, en.php.

Allo.php

<?php

if (!defined('_CAN_LOAD_FILES_'))
   exit;

define('BLOCKTAGS_MAX_LEVEL', 3);

class Allo extends Module
{
   function __construct()
   {
       $this->name = 'allo';
       $this->tab = 'front_office_features';
       $this->version = 1.0;
       $this->author = 'Namaku';

       parent::__construct();

       $this->displayName = $this->l('Allo');
       $this->description = $this->l('Olla Allo.');
   }


   function hookLeftColumn($params)
   {

   return $this->display(__FILE__, 'allo.tpl');

   }

}



allo.tpl


{l s='Allo' mod='allo'}


Kontak Kami


Tulis semuanya disini









Config.xml

<?xml version="1.0" encoding="UTF-8" ?>

allo
Allo
1
Olla Allo.
PrestaShop
front_office_features
0
1




en.php

<?php

global $_MODULE;
$_MODULE = array();



selain file-file di atas, ternyata harus buat file lagi (ruwet yah?) untuk css-nya. Di folder nama_themes/ css/allo. File allo.css

/* Allo */
div.allo_block .alo_content { padding: 3px 6px 0 }
div.allo_block p {
   text-align: justify;
   font-size: 0.9em
}
div.allo_block p a {
   margin: 0 0.1em;
   line-height: 1.5em
}
div.allo_block p a:hover {
   color: white!important;
   background-color: #5D717E;
   text-decoration: none
}
a.allo_level3 { font-size: 1.8em; font-weight: bold }
a.allo_level2 { font-size: 1.4em }
a.allo_level1 { font-size: 1em; color: #888!important }




sekarang di refresh, apakah muncul? Ternyata masih belum. Kita kan belum aktifkan module tersebut secara backend terlebih dahulu. Masuk ke administratornya, tabs module, cari tuh module allo. Kalo ada kita klik enable.

Kalo gak ada terpaksa pergi ke phpmyadmin, fungsinya munculin tuh module ke daftar module.

Pilih table _module, cari ada apa ndak allo. Kalo gak ada, ya udah insert baru aja, dengan nama allo, field active isi dengan 1. setelah itu, pergi ke admin lagi enable-kan tuh module

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 2 months later...
  • 4 months later...

eh sori2 bos....

 

kalo pengen tampil di backend qt buat function baru di file allo.php

 

public function getContent()
{
//tulis code disini
}

 

Maaf Mr Lent

pada // tulis code disini , apakah isi dari code tersebut

 

tolong ditambahkan jika ada ..

 

terima kasih atas pencerahannya

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 5 weeks later...
  • 3 months later...
×
×
  • Create New...