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:

le="color: #000000"><?php $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-module-tutorial/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: 11543

  • Since: 2004/4/23


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



Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs