kiransharma Posted September 27, 2012 Share Posted September 27, 2012 Hi, I had created listing for contact detail and on click on contact listing the it show edit page. I had url in contact edit page which currently i show in textarea the screenshot is as below. My current code in AdminContactRequest.php file is as below, public function renderForm() { $this->fields_form = array( 'legend' => array( 'title' => $this->l('Contact Request'), ), .... .... array( 'type' => 'textarea', // Change might be here 'label' => $this->l('Url:'), 'name' => 'url', 'cols' => 30, 'rows' => 4, 'required' => true, 'desc' => $this->l('Product Url'), ), Link to comment Share on other sites More sharing options...
kiransharma Posted September 29, 2012 Author Share Posted September 29, 2012 (edited) Anybody can answer???? Edited September 29, 2012 by kiransharma (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted September 29, 2012 Share Posted September 29, 2012 try this: take the link out of the form text box and write it as html. Link to comment Share on other sites More sharing options...
kiransharma Posted September 29, 2012 Author Share Posted September 29, 2012 (edited) Very thankx for reply @elpatron, I just thought that... to make function to show HTML output, but how i replace with this code as I use rander form and my current syntex is like below which i want to convert in clickable link. public function renderForm() { $this->fields_form = array( 'legend' => array( 'title' => $this->l('Contact Request'), ), .... .... array( 'type' => 'textarea', // Change might be here 'label' => $this->l('Url:'), 'name' => 'url', 'cols' => 30, 'rows' => 4, 'required' => true, 'desc' => $this->l('Product Url'), ), Here type is given as 'textarea', So, type will be html or anything else... try this: take the link out of the form text box and write it as html. try this: take the link out of the form text box and write it as html. Edited September 29, 2012 by kiransharma (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted September 29, 2012 Share Posted September 29, 2012 (edited) 'desc' => $this->l('Product Url').$this->('code for your URL') here is a working example from one of our modules that has a link: $this->displayWarning($this->l('In order to use GeoTargetingPro please download:').'<a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"><br>'.$this->l('1. This file').'</a> <br>'.$this->l('2. Extract GeoLiteCity.dat (Winrar or Gzip)').'<br>'.$this->l('3. FTP to your site directory: modules/geotargetingpro/').'<br>'); Edited September 29, 2012 by elpatron (see edit history) Link to comment Share on other sites More sharing options...
kiransharma Posted September 29, 2012 Author Share Posted September 29, 2012 Yes i had put this, as It shows warning message with link, But how can i use this in randerForm array... as shown above. Can't got proper way, I also had attach one image in first comment.. 'desc' => $this->l('Product Url').$this->('code for your URL') here is a working example from one of our modules that has a link: $this->displayWarning($this->l('In order to use GeoTargetingPro please download:').'<a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"><br>'.$this->l('1. This file').'</a> <br>'.$this->l('2. Extract GeoLiteCity.dat (Winrar or Gzip)').'<br>'.$this->l('3. FTP to your site directory: modules/geotargetingpro/').'<br>'); Link to comment Share on other sites More sharing options...
El Patron Posted September 29, 2012 Share Posted September 29, 2012 (edited) something like this, just add your array key data: i.e remove the warning code and assign 'desc' 'desc' => $this->l('In order to use GeoTargetingPro please download:').'<a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"><br>'.$this->l('1. This file').'</a> <br>'.$this->l('2. Extract GeoLiteCity.dat (Winrar or Gzip)').'<br>'.$this->l('3. FTP to your site directory: modules/geotargetingpro/').'<br>'); Edited September 29, 2012 by elpatron (see edit history) Link to comment Share on other sites More sharing options...
kiransharma Posted September 29, 2012 Author Share Posted September 29, 2012 (edited) Yes got something on track, but it will show as desc ( below the field where i want to show link ), as desc is use to show element description below it. so what i had to do to show with proper align ment like <lable>URL :</lable><a href="asdfsdf">Click here</a> and another thing is how can i give href url which came from database as in above array we use 'name'=>'url'? something like this, just add your array key data: i.e remove the warning code and assign 'desc' 'desc' => $this->l('In order to use GeoTargetingPro please download:').'<a href="http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz"><br>'.$this->l('1. This file').'</a> <br>'.$this->l('2. Extract GeoLiteCity.dat (Winrar or Gzip)').'<br>'.$this->l('3. FTP to your site directory: modules/geotargetingpro/').'<br>'); Edited September 29, 2012 by kiransharma (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted September 29, 2012 Share Posted September 29, 2012 Did you create a new admin tab? one problem with using existing back office admin processing, i.e. using auto form builds via existing ps classes...is you lose the flexibility and validation of your particular field...it may seem a fast way to do it..until it doesn't fit your needs....my suggestion is to create your custom form from scratch and use your own postProcess() function. then you have complete control of your form processing...remember the lazy work twice 1 Link to comment Share on other sites More sharing options...
kiransharma Posted October 1, 2012 Author Share Posted October 1, 2012 Yes @elpatron, Thankx fro your help, Now i got clear idea what to do, I was little confuse to set clickable link. Rather than using their default syntex for this i had to built my own form for admin, Now things working fine. +point for your comment. Did you create a new admin tab? one problem with using existing back office admin processing, i.e. using auto form builds via existing ps classes...is you lose the flexibility and validation of your particular field...it may seem a fast way to do it..until it doesn't fit your needs....my suggestion is to create your custom form from scratch and use your own postProcess() function. then you have complete control of your form processing...remember the lazy work twice 1 Link to comment Share on other sites More sharing options...
Recommended Posts