Image Text Module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm

Re: Image Text Module

Post 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();
:D
Ok i founded this, but i am inside a smarty plugin now how can a get the refer of "ContentManager::LoadContentFromId" :D
sorry

Maybe from "$smarty" parameter of function smarty plugin?
Last edited by megabob3 on Fri Apr 15, 2005 1:14 pm, edited 1 time in total.
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm

Re: Image Text Module

Post 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!!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Image Text Module

Post by Ted »

require_once(dirname(dirname(__FILE__))."/lib/classes/class.content.inc.php");
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm

Re: Image Text Module

Post 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!!
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm

Re: Image Text Module

Post 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.
megabob3
Power Poster
Power Poster
Posts: 498
Joined: Sat Jan 08, 2005 11:11 pm

Re: Image Text Module

Post 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);

Code: Select all

echo "**".$this->curtitle."**";
curtitle is blank :(
Last edited by megabob3 on Fri Apr 15, 2005 1:47 pm, edited 1 time in total.
Post Reply

Return to “Modules/Add-Ons”