ralphonz Posted February 12, 2014 Share Posted February 12, 2014 Hi Guys, I'm making a custom template to fit with my site and I want to combine all the client area details pages: My details, sub-contacts, add contact, change password and security settings). These are fairly lightweight and could all be on one page which would also enable me to use the kind of mobile-compatible layout i want to have. So far it's easy to include them all on one page in the My Details template. For example to show the sub-contacts page I'm using: {include file="$template/clientareacontacts.tpl"} However, a problem arises when one of the forms is submitted, as the action on each one is set to itself. For example: {$smarty.server.PHP_SELF}?action=contacts So it redirects to that page upon submission. If i change the action to point at my details the form isn't submitted and doesn't work. Can anyone think of a way round this? Thanks 0 Quote Link to comment Share on other sites More sharing options...
ralphonz Posted February 13, 2014 Author Share Posted February 13, 2014 I managed to get around this problem by making all the details templates the same and including the forms by placing them in separate template files like this: <!--My Details--> <article class="my-details clearfix" role="article"> <header class="article-header blue1"> <h3 class="h3"><i class="fa fa-user"></i> {$LANG.clientareanavdetails}</h3> </header> {include file="$template/clientareadetailsform.tpl"} </article> <!--Sub-Accounts--> <article class="sub-accounts clearfix" role="article"> <header class="article-header blue2"> <h3 class="h3"><i class="fa fa-group"></i> {$LANG.clientareanavcontacts}</h3> </header> {include file="$template/clientareacontactsform.tpl"} </article> etc... However, one problem with this is that certain parts aren't populated with the data. Security settings is always blank when included from another page, as is the client information on the main details page. I assume this is because those variables are not available from the current page so how would one go about making them available? 0 Quote Link to comment Share on other sites More sharing options...
ralphonz Posted February 13, 2014 Author Share Posted February 13, 2014 Well if it helps anyone i did it like this: {php} global $smarty; $this->assign('clientfirstname', $smarty->_tpl_vars[clientsdetails][firstname]); $this->assign('clientlastname', $smarty->_tpl_vars[clientsdetails][lastname]); $this->assign('clientcompanyname', $smarty->_tpl_vars[clientsdetails][companyname]); $this->assign('clientemail', $smarty->_tpl_vars[clientsdetails]); $this->assign('clientaddress1', $smarty->_tpl_vars[clientsdetails][address1]); $this->assign('clientaddress2', $smarty->_tpl_vars[clientsdetails][address2]); $this->assign('clientcity', $smarty->_tpl_vars[clientsdetails][city]); $this->assign('clientstate', $smarty->_tpl_vars[clientsdetails][state]); $this->assign('clientpostcode', $smarty->_tpl_vars[clientsdetails][postcode]); $this->assign('clientcountry', $smarty->_tpl_vars[clientsdetails][countryname]); $this->assign('clientphonenumber', $smarty->_tpl_vars[clientsdetails][phonenumber]); $this->assign('clientbilling', $smarty->_tpl_vars[clientsdetails][billingcid]); $this->assign('clientgateway', $smarty->_tpl_vars[clientsdetails][defaultgateway]); {/php} 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.