Page 2 of 2
Re: Image Text Module
Posted: Fri Apr 15, 2005 1:12 pm
by megabob3
wishy wrote:
Oh, it's a plugin. Gotcha.
Well, I just looked through the code and title is not put into $gCms anywhere. You're only real option is:
Code: Select all
$contentobj = ContentManager::LoadContentFromId($id, false);
$title = $contentobj->GetName();

Ok i founded this, but i am inside a smarty plugin now how can a get the refer of "ContentManager::LoadContentFromId"

sorry
Maybe from "$smarty" parameter of function smarty plugin?
Re: Image Text Module
Posted: Fri Apr 15, 2005 1:20 pm
by megabob3
wishy wrote:
I was thinking something like this would work... ContentTitle will be called before DoAction('default'), so you should be good.
Code: Select all
class MyModule extends CMSModule
{
var $curtitle;
function ContentTitle(&$title)
{
$this->curtitle = $title;
}
}
I used this line for having inside $gCms under the module the "curtitle" value, and it appear as a variable but it's always BLANK!!
Re: Image Text Module
Posted: Fri Apr 15, 2005 1:21 pm
by Ted
require_once(dirname(dirname(__FILE__))."/lib/classes/class.content.inc.php");
Re: Image Text Module
Posted: Fri Apr 15, 2005 1:23 pm
by megabob3
megabob3 wrote:
wishy wrote:
I was thinking something like this would work... ContentTitle will be called before DoAction('default'), so you should be good.
Code: Select all
class MyModule extends CMSModule
{
var $curtitle;
function ContentTitle(&$title)
{
$this->curtitle = $title;
}
}
I used this line for having inside $gCms under the module the "curtitle" value, and it appear as a variable but it's always BLANK!!
I forgot that on content my module isn't called like a module, so because "curtitle" is BLANK!!
Re: Image Text Module
Posted: Fri Apr 15, 2005 1:37 pm
by megabob3
wishy wrote:
require_once(dirname(dirname(__FILE__))."/lib/classes/class.content.inc.php");
Too much expensive call another time "ContentManager::LoadContentFromId($gCms->variables[page_name], true);"
I must fount the way to use the SMARTY from DoAction(default) of module.
Re: Image Text Module
Posted: Fri Apr 15, 2005 1:44 pm
by megabob3
wishy wrote:
I was thinking something like this would work... ContentTitle will be called before DoAction('default'), so you should be good.
Code: Select all
class MyModule extends CMSModule
{
var $curtitle;
function ContentTitle(&$title)
{
$this->curtitle = $title;
}
}
I did it the BLANK continue
Code inserted inside DoAction(default);
curtitle is blank
