1
loukaum
Dummy block in Dummy module
  • 2018/3/23 0:20

  • loukaum

  • Just popping in

  • Posts: 93

  • Since: 2003/11/2


Hello all,

For educational purpose, I'm trying to put a dummy block in a dummy module:

In a fresh installation of xoops 2.5.9, Instaled dummy module wich is basically an very simple module sample (Developed by Trabis).

Edited xoops_version.php, and put the lines at the end of file:

$modversion['blocks'][0]['file'] = "blocks/dummy_block.php";
$modversion['blocks'][0]['name'] = "Dummy";
$modversion['blocks'][0]['description'] = "A Dummy block"
$modversion['blocks'][0]['show_func'] = "b_dummy_block_show";


then created the folder blocks and the file dummy_block.php with the coontent:
<?php
function b_dummy_block_show () {
    
$moduleDirName basename(dirname(__DIR__));
    echo 
$moduleDirName;
}
?>


After module updated, could see it on admin/blocks section... enabled it and droped it on my center block, but not shows on the user side...

Where did I miss something?

2
iHackCode
Re: Dummy block in Dummy module

oh. this
$modversion['blocks'][0]['file'] = "blocks/dummy_block.php";

should be. this
$modversion['blocks'][0]['file'] = "dummy_block.php";

But if you want a block to appear you'll need a template.

ex:
$modversion['blocks'][0]['template'] = 'sometemplate.tpl';

https://xoops.gitbooks.io/kaotik-modul ... al/content/en/book/4.html

3
loukaum
Re: Dummy block in Dummy module
  • 2018/3/23 12:37

  • loukaum

  • Just popping in

  • Posts: 93

  • Since: 2003/11/2


Many Thanks! It worked fine.

Best regards!

4
mjoel
Re: Dummy block in Dummy module
  • 2018/3/24 5:30

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Maybe a new release of the new dummy module by trabis

just some suggestion to add

- dummy block with block template
- add two three pages..
- function add/edit delete
- able to find the pages through search.php
- submenus
- simple admin page

etc

it will be much easier for user

5
Mamba
Re: Dummy block in Dummy module
  • 2018/3/24 8:38

  • Mamba

  • Moderator

  • Posts: 11245

  • Since: 2004/4/23


You can try using TDMCreate: https://github.com/txmodxoops/tdmcreate



Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Login

Username:
Password:

Lost Password? Register now!

Who's Online

73 user(s) are online (47 user(s) are browsing Support Forums)


Members: 0


Guests: 73


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits