1
kerkyra
How to get block name
  • 2010/6/9 19:56

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hallo there, does anybody knows how i can get the name of a block.

I'm creating a block for a module and i want the title to be the main block title plus the title of the content its showing. so i need to do this in the block code itself. Any ideas?

2
kerkyra
Re: How to get block name
  • 2010/6/10 10:11

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


bump?
www.guidemap.gr - Beta is out...

3
ghia
Re: How to get block name
  • 2010/6/10 10:52

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Can't you assign $block['title'] in your block code?

4
kerkyra
Re: How to get block name
  • 2010/6/10 12:40

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


my code is like that
Quote:
global $xoTheme, $xoopsOption, $xoopsTpl,$xoopsConfig;
include_once(XOOPS_ROOT_PATH.'/modules/slider/class/sliders.php');

if ( file_exists(XOOPS_ROOT_PATH."/modules/slider/language/".$xoopsConfig['language']."/main.php") ) {
include_once (XOOPS_ROOT_PATH."/modules/slider/language/".$xoopsConfig['language']."/main.php");
} else {
include_once (XOOPS_ROOT_PATH."/modules/slider/language/english/main.php");
}


$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
$xoTheme->addScript('modules/slider/js/slider.js');
$xoTheme->addScript('modules/slider/js/jquery.easing.1.3.js');
$xoTheme->addScript('modules/slider/js/jquery.ennui.contentslider.js');
$xoTheme->addStylesheet('modules/slider/css/slider.css', array('media' => 'screen'));


$sliders = new Sliders();
$myslider = $sliders->getActiveSlider();
$xoopsTpl->assign('sliderlist',$myslider);
$xoopsTpl->assign('more',_AM_SLIDER_READMORE);
$xoopsTpl->assign('block',$block);
return true;


what i want to do is

set the title as

$block_title .= $somethingelse
www.guidemap.gr - Beta is out...

5
Runeher
Re: How to get block name
  • 2010/6/10 13:11

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


$modversion['blocks'][1]['file'] = "your_module_block.php";
$modversion['blocks'][1]['name'] = "Name of Block"
$modversion['blocks'][1]['description'] = "Description of Block"
$modversion['blocks'][1]['show_func'] = "your_module_show";


in xoops_version.php ?

6
kerkyra
Re: How to get block name
  • 2010/6/10 14:58

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i've changed the block name from the system->blocks administration area.

For example i gave it the name Car of the month

but i want the block name to be

Car of the month: Pegaut 306

and the same each time the title of the car changes.
www.guidemap.gr - Beta is out...

7
ghia
Re: How to get block name
  • 2010/6/10 15:18

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Your block don't seem to be a module block, but a custom block.

8
kerkyra
Re: How to get block name
  • 2010/6/10 16:45

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


its a module block, from a module i'm writing at the moment.
www.guidemap.gr - Beta is out...

9
ghia
Re: How to get block name
  • 2010/6/10 17:56

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Then you have to return a $block array (see step 2) and one of the members could be $block['title'] which specifies the title.

10
kerkyra
Re: How to get block name
  • 2010/6/10 18:09

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


returning the block array is not necessary. I've already tried that and block['title'] is empty. Still i would have somehow to get the block title from the db if i want to change it. Returning true works for me.

even returning the block array,
since we create the array in the function we still have to set $block['title'].

i tried to just set $block['title'] = 'something'; and see what happens but still the block has the same title, the one i set in the system->blocks admin area.

I just need to get that name and set a new block name for this specific block!! Can't this be done??!!
www.guidemap.gr - Beta is out...

Login

Who's Online

208 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 208


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