page reference

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
bittercoder
New Member
New Member
Posts: 5
Joined: Thu Feb 01, 2007 9:09 pm

page reference

Post by bittercoder »

I'm writing a shopping cart module, and in a number of places I need to redirect to my "cart" page ... I can redirect to the modules "cart" action, but how does this relate to pages in the site, which page will it use, or does it just use the default template and no page at all (that seems to be what's happening).

Really I just want to redirect to a page the user has selected as their checkout page... how would I go about doing this, can I exposed some functionality for selecting a page from a drop down list and store it in user preferences... are there any existing modules I could look at for examples?

Cheers,

- Alex
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: page reference

Post by Elijah Lofgren »

bittercoder wrote: I'm writing a shopping cart module, and in a number of places I need to redirect to my "cart" page ... I can redirect to the modules "cart" action, but how does this relate to pages in the site, which page will it use, or does it just use the default template and no page at all (that seems to be what's happening).

Really I just want to redirect to a page the user has selected as their checkout page... how would I go about doing this, can I exposed some functionality for selecting a page from a drop down list and store it in user preferences... are there any existing modules I could look at for examples?

Cheers,

- Alex
I recently added a way to store a default page in Calendar: http://viewsvn.cmsmadesimple.org/viewsv ... r&view=rev

In this change: http://viewsvn.cmsmadesimple.org/viewsv ... module.php
the main code is this:

Code: Select all

  $contentops =& $gCms->GetContentOperations();
  	                 $this->smarty->assign('defaultcalendarpage_text', $this->Lang('defaultcalendarpage'));
  	                 $this->smarty->assign('defaultcalendarpage_input', $contentops->CreateHierarchyDropdown('', $this->GetPreference('defaultcalendarpage','')));
  	 
I then put this in the template: http://viewsvn.cmsmadesimple.org/viewsv ... ttings.tpl

Code: Select all

<div class="pageoverflow">
  	                 <p class="pagetext">{$defaultcalendarpage_text}:</p>
  	                 <p class="pageinput">{$defaultcalendarpage_input}</p>
  	         </div>
Then to save the pref: http://viewsvn.cmsmadesimple.org/viewsv ... update.php

Code: Select all

                 $this->SetPreference('defaultcalendarpage', $_POST['parent_id']);
Hope this helps,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
Post Reply

Return to “Developers Discussion”