[solved]how to implement detailpage in module??

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
piotrekkr
Forum Members
Forum Members
Posts: 38
Joined: Mon Mar 05, 2007 5:30 pm

[solved]how to implement detailpage in module??

Post by piotrekkr »

Hi everyone.
I want to implement detailpage (like in album or news) in my module but i dont know how to do it? Can somebody explain how?? Please.
Last edited by piotrekkr on Thu Apr 12, 2007 10:16 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: how to implement detailpage in module??

Post by calguy1000 »

It's easy...... here's the code:

Code: Select all

$detailpage = '';
if (isset($params['detailpage']))
  {
    $manager =& $gCms->GetHierarchyManager();
    $node =& $manager->sureGetNodeByAlias($params['detailpage']);
    if (isset($node))
      {
	$content =& $node->GetContent();	
	if (isset($content))
	  {
	    $detailpage = $content->Id();
	  }
      }
    else
      {
	$node =& $manager->sureGetNodeById($params['detailpage']);
	if (isset($node))
	  {
	    $detailpage = $params['detailpage'];
	  }
      }
  }
Now, just use $detailpage instead of $returnid in your links.  i.e:

Code: Select all

$thereturnid = $returnid;
if( $detailpage != '' )
  {
      $params['origid'] = $returnid;
      $thereturnid = $detailpage;
  }

$oneentry->morelink = $this->CreateLink($id,'default',$thereturnid,
               $this->Lang('prompt_more'),$params);
Hope this helps.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
piotrekkr
Forum Members
Forum Members
Posts: 38
Joined: Mon Mar 05, 2007 5:30 pm

Re: how to implement detailpage in module??

Post by piotrekkr »

It's working, thanks! :)
Post Reply

Return to “Modules/Add-Ons”