Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Adding new column to banner slide

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 01-18-2018, 02:57 AM
 
divya divya is offline
 

Newbie
  
Join Date: May 2017
Posts: 4
 

Default Adding new column to banner slide

I'm trying to add new column "Description" to banner-rotation in admin.That would be advanced textarea(tinymce) to add html text to banner.
It works well if the type of field is inline text,but does not store values in advanced textarea.
Extended Model:
Quote:
<?php
// vim: set ts=4 sw=4 sts=4 et:



namespace XLite\Module\Dyn16\HomeBanner\Model;


class BannerRotationSlide extends \XLite\Model\BannerRotationSlide implements \XLite\Base\IDecorator
{


/**
* description
*
* @var string
*
* @Column (type="text")
*/
protected $description = '';

/*
* Set description
*
* @param text $description
* @return BannerRotationSlide
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return text
*/
public function getDescription()
{
return $this->description;
}

}
Extended \XLite\View\ItemsList\BannerRotationImages
Quote:
class BannerRotationImages extends \XLite\View\ItemsList\BannerRotationImages implements \XLite\Base\IDecorator
{


/**
* Define columns structure
*
* @return array
*/
protected function defineColumns()
{
return array_merge(parent::defineColumns(), [
'description' => [
static::COLUMN_NAME => static::t('Description'),
static::COLUMN_LINK => 'description',
static::COLUMN_CLASS => 'XLite\View\FormField\Textarea\Advanced',
static::COLUMN_ORDERBY => 300,
],
]);
}

Please can anyone advice what I'm missing to accept the field as advanced textarea?Any help would be greatly appreciated.
__________________
Divya
X-Cart Business 5.3.4.4
Reply With Quote
  #2  
Old 02-08-2018, 09:26 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Adding new column to banner slide

I'm not sure, but I guess it is because in lists you cannot use fields from the \XLite\View\FormField namespace, and should use these: \XLite\View\FormField\Inline

There is \XLite\View\FormField\Inline\Textarea\Simple, but I don't see the "advanced" version. Perhaps, you will have to use the "simple" version as an example and implement an "advanced" version yourself.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 02-21-2018, 07:47 AM
 
divya divya is offline
 

Newbie
  
Join Date: May 2017
Posts: 4
 

Default Re: Adding new column to banner slide

Thanks for the response.I implemented the simple version with "Edit" option and re-directed to the edit-page which has advanced version of text area.
__________________
Divya
X-Cart Business 5.3.4.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:17 PM.

   

 
X-Cart forums © 2001-2020