Skip to content

Commit

Permalink
adding model
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidpeywasti committed Dec 7, 2014
1 parent 39f9f28 commit c8ec5d6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
13 changes: 11 additions & 2 deletions dca/tl_catalog_product.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
'href' => 'act=edit',
'icon' => 'header.gif'
),

'type' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_catalog_product']['type'],
Expand Down Expand Up @@ -125,7 +124,8 @@
'palettes' => array
(
'__selector__' => array('addEnclosure','published'),
'default' => '{title_legend},title,alias,featured,date;
'default' => '{title_legend},title,alias,model,date;
{config_legend},featured;
{meta_legend},description,keywords;
{feature_legend},features;
{spec_legend},spec;
Expand Down Expand Up @@ -185,6 +185,15 @@
),
'sql' => "varchar(128) NOT NULL default ''"
),
'model' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_catalog_product']['model'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>128, 'tl_class'=>'w50'),
'sql' => "varchar(128) NOT NULL default ''"
),
'date' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_catalog_product']['date'],
Expand Down
3 changes: 2 additions & 1 deletion languages/en/tl_catalog_product.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
* Fields
*/
$GLOBALS['TL_LANG']['tl_catalog_product']['title'] = array('Product title', 'Please enter the product title.');
$GLOBALS['TL_LANG']['tl_catalog_product']['alias'] = array('Product code or alias', 'Please enter the product code.');
$GLOBALS['TL_LANG']['tl_catalog_product']['alias'] = array('Product alias', 'Please enter the product alias.');
$GLOBALS['TL_LANG']['tl_catalog_product']['model'] = array('Product model', 'Please enter the product model.');
$GLOBALS['TL_LANG']['tl_catalog_product']['date'] = array('Date', 'Please enter date.');
$GLOBALS['TL_LANG']['tl_catalog_product']['description'] = array('Description','Please enter description.');
$GLOBALS['TL_LANG']['tl_catalog_product']['keywords'] = array('Meta keywords','Here you can enter a list of comma separated keywords. Keywords, however, are no longer relevant to most search engines (including Google).');
Expand Down
7 changes: 6 additions & 1 deletion modules/ModuleCatalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ protected function parseProduct($objProduct, $blnAddCategory=false, $strClass=''

$objTemplate->title = $objProduct->title;
$objTemplate->alias = $objProduct->alias;
$objTemplate->model = $objProduct->model;

$objTemplate->features = deserialize($objProduct->features);
print_r($objProduct->features);
if (!empty($objProduct->features))
{
$objTemplate->features = deserialize($objProduct->features);
}
$objTemplate->specs = deserialize($objProduct->spec);

$objTemplate->description = $objProduct->description;
Expand Down
7 changes: 4 additions & 3 deletions templates/product/product_full.html5
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="layout_full block<?php echo $this->class; ?>">

<h2><?php echo $this->title; ?></h2>
<h3><?php echo $this->alias; ?></h3>
<p class="model"><?php echo $this->model; ?></p>

<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?php echo $this->datetime; ?>"><?php echo $this->date; ?></time></p>
Expand All @@ -29,8 +29,9 @@
</figure>
<?php endif; ?>

<?php print_r($this->features); ?>

<?php if($this->features) { ?>
<?php if($this->features !== null) { ?>
<div class="features">
<h3>ویژگی‌ها</h3>
<ul>
Expand All @@ -41,7 +42,7 @@
</div>
<?php } ?>

<?php if($this->specs) { ?>
<?php if($this->specs !== null) { ?>
<div class="specs">
<h3>خصوصیات</h3>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion templates/product/product_full.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="layout_full block<?php echo $this->class; ?>">

<h2><?php echo $this->title; ?></h2>
<h3><?php echo $this->alias; ?></h3>
<p class="model"><?php echo $this->model; ?></p>

<?php if ($this->addImage): ?>
<figure class="image_container<?php echo $this->floatClass; ?>"<?php if ($this->margin): ?> style="<?php echo $this->margin; ?>"<?php endif; ?>>
Expand Down

0 comments on commit c8ec5d6

Please sign in to comment.