wdrożenia PrestaShop Powiększenie zdjęć moduł

Modyfikacja w "homecategories"

  • 3 Odpowiedzi
  • 3601 Wyświetleń

0 użytkowników i 2 Gości przegląda ten wątek.

*

Offline elunia

  • Nowy
  • *
  • 5
  • 0
Modyfikacja w "homecategories"
« dnia: Kwiecień 15, 2011, 08:49:44 pm »
Witam wszystkich!

Mam problem po zainstalowaniu modułu "homecategories", mianowicie chce w nim zmienić:

-  Usunąć opisy kategorii oraz słowo "categories", (na screenshocie oznaczone jako C.)
-  Wydłużyć grafiki kategorii do rozmiaru "home" - (skrypt pomniejsza) (na screenshocie oznaczone jako D.)
-  Zrobić tak, by grafiki kategorii były zaraz pod sobą (na screenshocie oznaczone jako B.)

i to już chyba niezależne od "homecategories":

-  Zmniejszyć odległość "home" między lewą i prawą kolumną z boxami. (na screenshocie oznaczone jako A.)

Jeżeli ktoś będzie tak miły i mnie nakieruje co gdzie, będę wdzięczna :)




Cytuj
<!-- MODULE Home categories -->
<div>
   <h4>{l s='categories' mod='homecategories'}</h4>
   {if isset($categories) AND $categories}
      <div>
         <ul>
         {foreach from=$categories item=category name=homeCategories}
            {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)}
            <li class="ajax_block_category {if $smarty.foreach.homeCategories.first}first_item{elseif $smarty.foreach.homeCategories.last}last_item{else}item{/if}">
               <h5><a href="{$categoryLink}" title="{$categoryName}">{$category.name|truncate:35}[/url]</h5>
               
               <a href="{$categoryLink}" title="{$category.legend}" class="category_image"><img src="{$img_cat_dir}{$category.id_category}-category.jpg"  id="categoryImage" />[/url]
               
            </li>
         {/foreach}
         </ul>
      </div>
   {else}
      <p>{l s='No categories' mod='homecategories'}</p>
   {/if}
</div>
<!-- /MODULE Home categories -->

ORAZ DRUGI PLIK Z KODEM:

Cytuj
<?php

class Homecategories extends Module
{
   private $_html = '';
   private $_postErrors = array();

   function __construct()
   {
      $this->name = 'homecategories';
      $this->tab = 'Home';
      $this->version = 0.1;

      parent::__construct(); // The parent construct is required for translations

      $this->page = basename(__FILE__, '.php');
      $this->displayName = $this->l('Frontpage Categories');
      $this->description = $this->l('Displays categories in the middle of your homepage');
   }

   function install()
   {
      if (!Configuration::updateValue('HOME_categories_NBR', 10) OR !parent::install() OR !$this->registerHook('home'))
         return false;
      return true;
   }

   public function getContent()
   {
      $output = '<h2>'.$this->displayName.'</h2>';
      if (Tools::isSubmit('submitHomecategories'))
      {
         $nbr = intval(Tools::getValue('nbr'));
         if (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr))
            $errors[] = $this->l('Invalid number of categories');
         else
            Configuration::updateValue('HOME_categories_NBR', $nbr);
         if (isset($errors) AND sizeof($errors))
            $output .= $this->displayError(implode('
', $errors));
         else
            $output .= $this->displayConfirmation($this->l('Settings updated'));
      }
      return $output.$this->displayForm();
   }

   public function displayForm()
   {
      $output = '
      <form action="'.$_SERVER['REQUEST_URI'].'" method="post">
         <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
            <label>'.$this->l('Number of categories displayed').'</label>
            <div class="margin-form">
               <input type="text" size="5" name="nbr" value="'.Tools::getValue('nbr', Configuration::get('HOME_categories_NBR')).'" />
               <p class="clear">'.$this->l('The number of catgeories displayed on homepage (default: 10)').'</p>
               
            </div>
            <center><input type="submit" name="submitHomecategories" value="'.$this->l('Save').'" class="button" /></center>
         </fieldset>
      </form>';
      return $output;
   }

   function hookHome($params)
   {
      global $smarty;
      $category = new Category(1);
      $nb = intval(Configuration::get('HOME_categories_NBR'));
      
      $smarty->assign(array(
         'category' => $category,
         'lang' => Language::getIsoById(intval($params['cookie']->id_lang)),
      ));
      return $this->display(__FILE__, 'homecategories.tpl');
   }

}

Dziękuję wszystkim z góry za pomoc.

*

Offline deviant

  • Mieszkaniec
  • *****
  • 776
  • 1
  • Płeć: Mężczyzna
  • prestamod
  • PrestaShop: PS
  • Status: forum
Odp: Modyfikacja w "homecategories"
« Odpowiedź #1 dnia: Kwiecień 15, 2011, 09:00:55 pm »
A gdzie zrzut ?
Prestamod -> [sklepy][hosting][modyfikacje][szablony][pomoc]

*

Offline elunia

  • Nowy
  • *
  • 5
  • 0
Odp: Modyfikacja w "homecategories"
« Odpowiedź #2 dnia: Kwiecień 15, 2011, 09:03:04 pm »
Nie wyświetlił się w poście?
http://zapodaj.net/9e2d127fd536.jpg.html

*

Offline elunia

  • Nowy
  • *
  • 5
  • 0
Odp: Modyfikacja w "homecategories"
« Odpowiedź #3 dnia: Kwiecień 19, 2011, 07:22:09 am »
Witajcie ponownie,

Faktycznie zadałam taki ciężki temat?
W weekend będę mieć więcej czasu, to metodą prób i błędów spróbuję "dojść" :D do tego ja to zrobić.
Jak mi się uda, to się podzielę :)

Pozdrawiam gorąco! )