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

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: inline module inside {content} with a different $action?
PostPosted: Wed Apr 25, 2012 1:43 pm 
Offline
Forum Members
Forum Members

Joined: Tue Apr 24, 2012 2:41 pm
Posts: 12
Location: Québec, Canada
Hi!

I have a template with {content}, a content page with a layout which in it load a module using {cms_module module='sbCarriere'}. The module loads and it works. In DoAction(), $action == "default".

I'd like to use the same content page with a different action for the module.

I tryed:
?page=carriere&action=myaction -> same as "default"
?page=carriere&id=test&action=testmyaction -> empty {content}
?page=carriere&mact=sbCarriere,cntnt01,myaction,1 -> shows only the module in {content}

I could override $action in DoAction() if I see a variable in $_GET, but is there an "official" way to do this?

Thanks!


Top
 Profile  
 
 Post subject: Re: inline module inside {content} with a different $action?
PostPosted: Wed Apr 25, 2012 4:42 pm 
Offline
Forum Members
Forum Members

Joined: Tue Apr 24, 2012 2:41 pm
Posts: 12
Location: Québec, Canada
with JoMorg's help, I got:

Code:
function SetParameters() {
      $this->RegisterModulePlugin(); // to be able to use {sbCarriere} instead of {cms_module sbCarriere}
      
      /* */
      $this->RegisterRoute('&sbc_action=(?P<sbc_action>[a-zA-Z]+)$/');
      
      /* Security */
      $this->RestrictUnknownParams();
      $this->CreateParameter('sbc_action','','help');
      $this->SetParameterType('sbc_action',CLEAN_STRING);
   }


but with the url: index.php?page=carriere&sbc_action=jobview

I get:
Code:
var_dump($action, $params);
string(7) "default" array(2) { ["module"]=> string(10) "sbCarriere" ["action"]=> string(7) "default" }


:(


Top
 Profile  
 
 Post subject: Re: inline module inside {content} with a different $action?
PostPosted: Wed Apr 25, 2012 5:18 pm 
Offline
Forum Members
Forum Members

Joined: Tue Apr 24, 2012 2:41 pm
Posts: 12
Location: Québec, Canada
got it!

Code:
$this->smarty->assign('job_view', $this->CreateFrontendLink($id, $returnid, 'job_view', 'test'));


which makes:
Code:
index.php?mact=sbCarriere,m5969d,job_view,1&m5969dreturnid=78&page=78


the template from my content page stays, only the module parts updates

win!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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