• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: UDT - module_link
PostPosted: Wed Apr 30, 2008 8:49 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4809
Location: Ferrara, Italy
module_link:
Ritorna l'url di un item di un modulo (predefinito News) ma è estensibile.
Da testare che poi lo metto sul Wiki

Code:
//
// UDT for link to News/Generic Module
// Alberto Benati (alby) <cms at xme.it>
//
// @param "id" - MANDATORY
//      The article/module item ID
//
// @param "cntnt" - optional
//      Form counter. It's not important for this example, but tomorrow...
//
// @param "origid" - optional
//      The original page (default current page), can be an ID number or an alias.
//
// @param "redirect" - optional
//      The redirect page (default current page), can be an ID number or an alias.
//
// @param "other" - optional
//      Other query params.
//
// @param "assign" - optional
//      Smarty assign variable.
//
// @example
//      {module_link id=1 redirect='News'}
//      {module_link id=1 module='Cataloger'} not implemented!
//

global $gCms;
global $smarty;


$id = 1;
if(isset($params['id']) && $params['id'] != '') $id = intval($params['id']);


$module = 'News';
if(isset($params['module']) && $params['module'] != '') $module = strtolower($params['module']);


$cntnt = '01';
if(isset($params['cntnt']) && $params['cntnt'] != '') $cntnt = $params['cntnt'];


$origid = $gCms->variables['content_id'];
if(isset($params['origid']) && $params['origid'] != '')
{
 $manager =& $gCms->GetHierarchyManager();
 $currentNode = &$manager->sureGetNodeById($params['origid']);
 $currentContent =& $currentNode->getContent();
 $origid = $currentContent->Id();
}


$redirect = $gCms->variables['content_id'];
if(isset($params['redirect']) && $params['redirect'] != '')
{
 $manager =& $gCms->GetHierarchyManager();
 $currentNode = &$manager->sureGetNodeById($params['redirect']);
 $currentContent =& $currentNode->getContent();
 $redirect = $currentContent->Id();
}


$other = '';
if(isset($params['other']) && $params['other'] != '') $other = $params['other'];
if(!empty($other)) $other = '&'.$other;


$url = $gCms->config['root_url']."/index.php?mact=";

switch($module)
{
   default:   $url .= "News,cntnt{$cntnt},detail,0&cntnt{$cntnt}articleid={$id}&cntnt{$cntnt}origid={$origid}&cntnt{$cntnt}returnid={$redirect}{$other}";
}


if(isset($params['assign']) && $params['assign'] != '')
{
 $smarty->assign($params['assign'], $url);
 return '';
}
else return $url;


Alby

_________________
Former Italian Admin and Moderator
Multilingual: MLE is not CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: UDT - module_link
PostPosted: Wed Apr 30, 2008 8:52 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8095
Location: Fernie British Columbia, Canada
alby:  have you seen the {module_action_link} function in CGSimpleSmarty ?

_________________
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: UDT - module_link
PostPosted: Wed Apr 30, 2008 9:04 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4809
Location: Ferrara, Italy
calguy1000 wrote:
alby:  have you seen the {module_action_link} function in CGSimpleSmarty ?


Is not fair .... leaves a little to other  :D

Alby

_________________
Former Italian Admin and Moderator
Multilingual: MLE is not CMSMS


Last edited by alby on Wed Apr 30, 2008 9:10 pm, edited 1 time in total.

Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: UDT - module_link
PostPosted: Tue May 13, 2008 10:40 pm 
Offline
Forum Members
Forum Members

Joined: Wed Feb 06, 2008 12:27 am
Posts: 22
Hi Alby

I was wondering how to change the Page Alias of each Cataloger category/item to have their own page alias names. ie for english like product-a... and should change to urnler-a....

Hope to hear from you and many thanks in advance for all your support


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: UDT - module_link
PostPosted: Wed May 14, 2008 10:18 am 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4809
Location: Ferrara, Italy
baki250 wrote:
I was wondering how to change the Page Alias of each Cataloger category/item to have their own page alias names. ie for english like product-a... and should change to urnler-a....

Hope to hear from you and many thanks in advance for all your support


Maybe OT on module_link

Say you page alias name in MLE?
Alias page and ID page in CMSMS are unique variables for each page.
Language use other variable (hl) for change your content language.
If you change alias of page you change alias to all language pages.

Alby

_________________
Former Italian Admin and Moderator
Multilingual: MLE is not CMSMS


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting