Jump to content
ejectcore

Frontpage Categories Module for v1.3 and below

Recommended Posts

I have to say this is the first Module for prestashop I have ever created, some of you here may already know how to do this. but for those who don't carry on reading below

 

Sorry this module is in english only I am no good with module translation  :-

As I progress with learning PrestaShop I will try to share these new Mods  ;)

 

Frontpage Categories v0.1

Displays categories in the middle of your homepage

 

Please download then unzip homecategories.zip to the modules directory then upload.

 

All you have to do then is add the value homecategories to name field & value 1 in to active field within mysql table ps_module then your see the new module in the PrestaShop Admin. (Select hompage possition)

 

I have not used any styling from global.css so if you wan to use box styling you will need to modify homecategories.tpl

 

example

 

change:

<div>
<h4>{l s='categories' mod='homecategories'}</h4>
{if isset($categories) AND $categories}
<div>

 

to:

<div id="featured-products_block_center" class="block products_block">
<h4>{l s='categories' mod='homecategories'}</h4>
{if isset($categories) AND $categories}
<div class="block_content">

 

Enjoy  :) 

 

 

 

homecategories.zip

  • Like 2

Share this post


Link to post
Share on other sites

Quick note: Make sure categories are enabled on the left column for the frontpage categories to work.

Question for the Prestashop Team how do I get this module to work in any position, it seems to only work when categories are displayed on the left column  ???

 

<?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('<br />', $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');
}

}

 

Share this post


Link to post
Share on other sites

I ve done it as you said but nothing new appears on the home page :(

Share this post


Link to post
Share on other sites

Make sure you have categories in the left column & inserted the value into the database  8)

& don't forget to upload the homecategories folder into the modules directory

 

Then if all the above is correct activate it in the admin (Transplant a module)

then Frontpage Categories will appear in the dropdown hook into Homepage Content

833_XFjsS1wcvVqShW5Lz9x6_t

Share this post


Link to post
Share on other sites

Maybe that is the problem, when I click on Transplant module, I get only Hack atempt message :(

Share this post


Link to post
Share on other sites

Just a thought to activate frontpage categories manually via mysql:

 

First backup your DB then enter the id you used to setup this module in table ps_module ie. (36 homecategories)

now enter this id into ps_hook module id_module then in the next field enter 8 which is the idhook for home then enter 1 for the possition value

 

No idea why your getting hack attempt but the above should work. If not fix this issue before using this module

search for forum maybe someone has the same issue if not go back & see what the developers say.

 

To completely change the subject will RC3 be released in the next few days?

 

 

Share this post


Link to post
Share on other sites

I've installed this module on a RC2 test shop, it works perfectly.  You can see result at

Categories are dispayed in a single column, it could be nice to be able to choose 1,2,3 or 4... columns on admin.

 

Thanks for this works

Share this post


Link to post
Share on other sites

All you have to do to get your column layout is add some new styles to global.css or set css to the same as the featured module blocks  :)

<div id="featured-products_block_center" class="block products_block">

  • Like 1

Share this post


Link to post
Share on other sites

I am currently looking at a 3 column layout for one of my own projects & will try to update zip when complete  ::)

Share this post


Link to post
Share on other sites

Frontpage Categories Module V0.2

3 Column Front Page Category layout  8)

(Make sure you have the category size in the admin set to the same size as your images)

 

here's the css you need to add to global.css within your themes directory

 

#homeCatWrapper {
margin-left: 6px; /* You may not need this unless you want to try to center categories */
}
#homeCat {
float: left;
width: 124px; 
}
#homeCat h5 {
text-align: center; 
}

homecategories_v0.2.zip

Share this post


Link to post
Share on other sites

Quick note: Make sure categories are enabled on the left column for the frontpage categories to work.

Question for the Prestashop Team how do I get this module to work in any position, it seems to only work when categories are displayed on the left column  ???

 

I missed out the obvious  :-[

allow for both hooks in header & footer

 

header.php

<?php
require_once(dirname(__FILE__).'/init.php');

/* CSS */
$css_files[_THEME_CSS_DIR_.'global.css'] = 'all';

/* Hooks are volontary out the initialize array (need those variables already assigned) */
$smarty->assign(array(
'HOOK_HEADER' => Module::hookExec('header'),
'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'),	
'HOOK_RIGHT_COLUMN' => Module::hookExec('rightColumn'),
'HOOK_TOP' => Module::hookExec('top'),
));

if(isset($css_files) AND !empty($css_files)) $smarty->assign('css_files', $css_files);
if(isset($js_files) AND !empty($js_files)) $smarty->assign('js_files', $js_files);

/* Display a maintenance page if shop is closed */
if (isset($maintenance))
{
header('HTTP/1.1 503 temporarily overloaded');
$smarty->display(_PS_THEME_DIR_.'maintenance.tpl');
exit;
}

$smarty->display(_PS_THEME_DIR_.'header.tpl');

?>

 

footer.php

<?php

if (isset($smarty))
{
$smarty->assign(array(
     	'HOOK_RIGHT_COLUMN' => Module::hookExec('rightColumn'),	
	'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'),
	'HOOK_FOOTER' => Module::hookExec('footer')));
$smarty->display(_PS_THEME_DIR_.'footer.tpl');
}

?>

Share this post


Link to post
Share on other sites

Hi,

 

I like this contribution,

 

I try in RC3 stable...

 

Buy

Share this post


Link to post
Share on other sites

Hi,

 

thanks  ;)

 

how to creating on home categories on 3 or 4 columns ?

 

buy...

Share this post


Link to post
Share on other sites

Just use the css provided in the post above & download the latest zip  ;)

if not provide web link & I have a quick look  :)

Share this post


Link to post
Share on other sites

Hi,

 

Thanks & good night from France  :o

 

buy

Share this post


Link to post
Share on other sites

Hi,
How can I get the category description to show in the {foreach} loop with this module? I've tried all the combinations of $category.desc / .description / .description_short - nothing seems to pull out the information - I just get a blank space.

Thanks,

Share this post


Link to post
Share on other sites

Please post you code & I will see if I can help
I have plans to update this module but have a few more requests before going back to this :roll:

Share this post


Link to post
Share on other sites

My homecategories.tpl looks like this:

<!-- MODULE Home categories created by Alpha Media (09 May 2008) -->
{if isset($categories) AND $categories}


{foreach from=$categories item=category name=homeCategories}
{assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)}

                    


{$category.name}


       {$categoryDesc}

More details



{/foreach}

{else}

{l s='No categories' mod='homecategories'}
{/if}
<!-- END MODULE Home categories -->



I need {$categoryDesc} to pull out the relevant description for the category...

Share this post


Link to post
Share on other sites

unfortunately no time to look into this now but briefly all you need is {$category.description}
you may need to define this in homecategories.php something like, but not checked this just a quick guess
this feature does need improving when I get the time :)

$category = new Category(1);
$category->description = nl2br2($category->description);

Share this post


Link to post
Share on other sites

Nope, didn't want to work. =/ Any tips as to where in the hook_home the description hook needs to go?

   function hookHome($params)
   {
       global $smarty;
       $category = new Category(1);

       //adding this here didn't work when referencing {$category.description}
       //$category->description = nl2br2($category->description);

       $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');
   }

Share this post


Link to post
Share on other sites

I am looking for a solution for this module. I have onstalled the module, but i can only get the categories to list in one column???

Any ideas.

Share this post


Link to post
Share on other sites

I will be updating this module hopefully in the next week
v0.5 will include the CSS & a new admin config for this module ;)

Share this post


Link to post
Share on other sites

Heres my css regarding the module, as you posted earlier in this thread.

/*------------------------------------------------Meant to be homepage categories block--------------------*/
#homeCatWrapper {
margin-left: 6px; /* You may not need this unless you want to try to center categories */
}
#homeCat {
float: left;
width: 124px; 
}
#homeCat h5 {
text-align: center; 
}
/*------------------------------------------------Meant to be homepage categories block END--------------------*/



and here is the code of the module template

<!-- MODULE Home categories created by Alpha Media (09 May 2008) -->
{if isset($categories) AND $categories}

{foreach from=$categories item=category name=homeCategories}
{assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)}

                    






{/foreach}

{else}

{l s='No categories' mod='homecategories'}
{/if}
<!-- END MODULE Home categories -->



I think its the way the css is written, but no matter how i write it, i cant get it to list the categories in more than one column.

How would you write the css in the stylesheet in a readable list as all the other classes.
For example:

#header2 img{
   position:absolute;
   left:37px;
   top:0;
   width:274px;
   height:274px;
}
#header2 ul{
   position:absolute;
   left:500px;
   top:46px;
   margin:0;
   padding:0;
}



Or something like.
Thanks for your help in advance, and i think this will be implemented in the prestashop settings eventually.
Davey

Share this post


Link to post
Share on other sites

In IE7 - Display and alignment of all blocks is good. But in Firefox - it looks bad as blocks are not aligned properly.

Share this post


Link to post
Share on other sites

here is an example of the CSS
the key is to use float left ;)

also change the value of the width to suit your template :)

/*** Home Categories Module  ***/
div.home_categories ul {
text-align:center; 
list-style: none;
}
div.home_categories li {
float: left;
margin: 5px;
width: 100px; 
}
div.home_categories h5 a {
font-size: x-small;
color: #999;
}
div.home_categories h5 a:hover {
text-decoration:underline;
color: #444;
}
div.home_categories div {
width: 100px; 
filter:alpha(opacity=70); 
opacity: 0.7;
-moz-opacity:0.7;

border: 1px solid #EFEFEF; 
}
div.home_categories div:hover {
filter:alpha(opacity=100); 
opacity: 1;
-moz-opacity:1;
border: 1px solid #1CA0F9; 
}

Share this post


Link to post
Share on other sites

also here is the template file from the previous sample link
notice I have truncate:15 remove this if you wish.
I just needed this for my own project ;)

<!-- MODULE Home categories -->

   {if isset($categories) AND $categories}

           {foreach from=$categories item=category name=homeCategories}
               {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)}


{$category.name|truncate:15}

           {/foreach}

   {else}

{l s='No categories' mod='homecategories'}
   {/if}

<!-- /MODULE Home categories -->

Share this post


Link to post
Share on other sites

Fantastic, all good!

Dont know what the truncate bit means, but if removed, it breaks the shop.
Thanks alot mate

Share this post


Link to post
Share on other sites

truncate just means you can limit your text to a certain amount of characters, this should not break anything on the page :wow:
a few goodies included in the css, roll over effects etc.

Enjoy, and don't forget to include your link to show more examples for this module ;)

Share this post


Link to post
Share on other sites

bonsoir a tous

j'ai un petit soucis avec ce module je l'ais installer il fonctionne mais dans le bloc categories a gauche les categories ne s'affiche plus , quelqu un a t il eu deja ce probleme ? ou y aurais t il une soluce ?

et ne connaissant pas la langue de " cheque spear " j'ai un peu de mal a tout capter

sam

Share this post


Link to post
Share on other sites

Hello

Bonjour à tous les prestashoppers et tout d'abord merci pour ce superbe outil que je découvre (suite à l'évaluation de Magento que je qualifierai d'usine à gaz et ce à tous les niveaux).

Quelques questions pour faire apparaitre les catégories de 1° niveau sur la home page.

Peut'on le faire nativement avec la V1.1 de Presta ou faut'il utiliser le module homecatégorie.

J'ai installé le module homecatégorie et aprés avoir lu pas mal de post je ne vois pas comment obtenir plusieurs catégories sur la même ligne (colonage) ni comment restreindre le nombre de catégories à afficher avec le paramétre de configuration qui n'a pas fonctionné.

Merci

Share this post


Link to post
Share on other sites

Bonjour

PM78 je suis comme toi. Je cherche à afficher mes catégories les une à coté des autre, comme pour les sous catégories en fait.
Je ne sais plus ou donner de la tete

Share this post


Link to post
Share on other sites

Désolé Ronie59 mais j'ai différé ce besoin, cela dit je pense qu'il faudra adapter le module, dès que je m'y attaque je reviens vers toi

Share this post


Link to post
Share on other sites
Frontpage Categories Module V0.2

3 Column Front Page Category layout  8)

(Make sure you have the category size in the admin set to the same size as your images)

 

here's the css you need to add to global.css within your themes directory

 

#homeCatWrapper {
margin-left: 6px; /* You may not need this unless you want to try to center categories */
}
#homeCat {
float: left;
width: 124px; 
}
#homeCat h5 {
text-align: center; 
}



I don't know where put it in global.css ?
Which line ?

Help please.

Sorry I'm french

Share this post


Link to post
Share on other sites

Bonjour à tous,

Merci pour ce module, je viens de l'installer mais je rencontre quelques petits souci.

Ronie j'ai le même pbme que toi, je voudrais afficher mes catégories sur plusieurs colonnes mais ne comprend pas grand chose à ce post, du moins pas suffisamment pour risquer de modifier mon global.css. As-tu trouvé une solution ? ça m'intéresse ;)

Share this post


Link to post
Share on other sites

Oui marie j'y suis presque.
Là je repart au boulot mais dès que j'ai un peu de temps (peut être ce soir) je t'expliquerais.

Share this post


Link to post
Share on other sites

Bon décidément je n'y arrive pas.

J'ai tenté d'intégrer les quelques lignes du CatWrapper sur mon CSS mais je n'obtiens pas le résultat escompté.

Ronie, as-tu finalement réussi ?

Share this post


Link to post
Share on other sites

Bonsoir Marie,

Je vais essayer de t'aider.
Tout d'abord je suis parti du module homecategories_v0.2
Après j'ai suivi le sujet car je voulais avoir mes catégories sur la même ligne.
J'ai donc ajouté ce qui suit tout à la fin du fichier global.css de mon thème :

/*------------------------------------------------Meant to be homepage categories block--------------------*/
#homeCatWrapper {
margin-left: 0px; /* You may not need this unless you want to try to center categories */
}
#homeCat {
float: left;
width: 185px; 
}
#homeCat h5 {
text-align: center; 
}
/*------------------------------------------------Meant to be homepage categories block END--------------------*/ 
/*** Home Categories Module  ***/

div.home_categories ul {
text-align: center;
list-style: none;
}
div.home_categories li {
float: left;
padding: 0px;
width: 185px; 
}
div.home_categories h5 a {
font-size: x-small;
color: #999;
}
div.home_categories h5 a:hover {
text-decoration:underline;
color: #444;
}
div.home_categories div {
width: 185px; 
filter:alpha(opacity=80); 
opacity: 0.8;
-moz-opacity:0.8;

border: 1px solid white; 
}
div.home_categories div:hover {
filter:alpha(opacity=100); 
opacity: 1;
-moz-opacity:1;
border: 1px solid orange; 
}


Il faut juste adapter la valeur width par rapport à ton thème.
Si les catégories restent les unes au dessus des autres il faut diminuer cette valeur.

Puis j'ai ouvert mon fichier homecategories.tpl, j'ai supprimé son contenu et l'ai remplacé par :

<!-- MODULE Home categories -->

   {if isset($categories) AND $categories}

           {foreach from=$categories item=category name=homeCategories}
               {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)}


{$category.name|truncate:15}

           {/foreach}

   {else}

{l s='No categories' mod='homecategories'}
   {/if}

<!-- /MODULE Home categories --> 



Voila normalement ça dois marcher.
Sinon fais signe sur le forum.

Share this post


Link to post
Share on other sites

Merci Ronie :)

J'ai suivi tes instructions.

A propos de la version de HomeCategories, as-tu la même chose que moi ? Je m'explique, je charge la V0.2 et c'est la V0.1 qui s'affiche dans les modules de mon BO : ceci me semble étrange mais why not. Tu confirmes avoir la même configuration ?

Ensuite, oui après toute ces manip les catégories s'affichent bien sur 3 colonnes MAIS mes images ne s'affichent pas. A la place j'ai le titre de la catégorie.

J'ai fureté un peu dans les différents post sur lesquels tu es intervenu. J'ai ainsi lu quelque part qu'il faut retirer la ligne 71 du global.css (elle correspond chez moi à la ligne 68) => ce que j'ai fait, mais le résultat n'est pas plus probant.

Après toutes ces modifications, même en ré affectant une image à une catégorie, elle n'est pas prise en compte dans "homecategories".

Dommage que le concepteur de ce module soit anglophone, c'est carrément chaud pour lui expliquer tout ça.

Je continue mes recherches et tente de solutionner ce truc qui coince.

Encore merci Ronie de ton aide ;)

Marie

Share this post


Link to post
Share on other sites

oui quand on installe la v0.2 il affiche bien v0.1 dans le bo.
Par contre pour les images je sais pas faut que je regarde.

je le fais dès que possible.

Share this post


Link to post
Share on other sites

Pour ceux qui souhaitent ajouter le module sans mettre le module de liste des categories dans les colones voici le code à ajouter au fichier homecategories.php dans la fonction hookhome


global $link;
$smarty->assign(array(
'categories' => Category::getHomeCategories(intval($params['cookie']->id_lang), true),
'link' => $link
));

Share this post


Link to post
Share on other sites

Ermm...it's all gone french...

where's the turn off french button please?

(that was a poor attempt at a joke...apologies)....

Share this post


Link to post
Share on other sites

hello I would like to enlarge the image in homecategory or changes must thank you.

Bonjour je voudrais agrandir l'image dans homecategory celle présente sur la page d'accueil

Share this post


Link to post
Share on other sites

Salut tous le monde! je trouve ce module vraiment sympa mais je n'arrive pas à le faire fonctionner :(.
j'en profite parce que j'ai vu des français dans le coin :D.

Donc pour revenir au problème j'installe le module, et ca me marque sur la homepage "no categories" alors que y'en a 3 :( (celles par defauts).

Quelqu'un à une idée où se trouve le bug?

PS: je suis partis de la v0.2

merci

Share this post


Link to post
Share on other sites

Bonjour à tous, salut huhamanu,


Pour ceux qui souhaitent ajouter le module sans mettre le module de liste des categories dans les colones voici le code à ajouter au fichier homecategories.php dans la fonction hookhome

global $link;
$smarty->assign(array(
'categories' => Category::getHomeCategories(intval($params['cookie']->id_lang), true),
'link' => $link
));


Je suis très intéressé par cette fonction, car je crée un site sur lequel je ne souhaite pas afficher le module de liste des catégories.
J'ai donc modifié la fonction hookhome comme tu le dis, mais ça ne fonctionne pas ...
Voici ma fonction après avoir ajouté ta modification :

   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');
       global $link;
       $smarty->assign(array(
           'categories' => Category::getHomeCategories(intval($params['cookie']->id_lang), true),
           'link' => $link,
       ));
   }



Où est-ce que je me suis trompé ?
Merci du coup de main !

Share this post


Link to post
Share on other sites

J'ai trouvé comment écrire la fonction. Si ça peut aider certains d'entre vous ...

   function hookHome($params)
   {
       global $link, $smarty;
       $category = new Category(1);
       $nb = intval(Configuration::get('HOME_categories_NBR'));

       $smarty->assign(array(
           'categories' => Category::getHomeCategories(intval($params['cookie']->id_lang), true),
           'link' => $link,
           'category' => $category,
           'lang' => Language::getIsoById(intval($params['cookie']->id_lang)),
       ));
       return $this->display(__FILE__, 'homecategories.tpl');
   }



A votre service M'sieur Dame !

Share this post


Link to post
Share on other sites

Bonjour à tous!

j'ai installé le module Frontpage Categories, qui fonctionne très bien. Seulement, j'ai vraiment fouillé, mais je ne trouve pas le fichier à modifier pour ajouter une image à une catégorie.

Firebug me donne ces infos:



Je souhaite donc modifier

3-Homecategories.jpg



Quelqu'un sait où se trouve le fichier afin que je puisse apporter les modifications?

Share this post


Link to post
Share on other sites

Hello, I've been trying to make the homecategories show a description and some of the more recent products (like this site: http://www.aspli.com/ ) but I can't do things like

{$category.description}



to show the category description, presumably if that doesn't work a foreach on $category.products will not either. Does anyone know how to do this?

Share this post


Link to post
Share on other sites
Salut tous le monde! je trouve ce module vraiment sympa mais je n’arrive pas à le faire fonctionner :(.
j’en profite parce que j’ai vu des français dans le coin :D.
Donc pour revenir au problème j’installe le module, et ca me marque sur la homepage “no categories” alors que y’en a 3 :( (celles par defauts).
Quelqu’un à une idée où se trouve le bug?
PS: je suis partis de la v0.2
merci


Bonjour Richard,
Idem sur mon installation: "No categories"
As-tu résolu le problème de ton coté ?

Share this post


Link to post
Share on other sites
Hi

Just wondering with all the code everyones posting, is this module ready to go?
Or is it hard to configure?

Thanks!


A sense of time would help. I was thinking the same.

Share this post


Link to post
Share on other sites

Works perfectly under PS 1.2.2 .. Have a look to my e-shop (link bellow)
Cheers,

Share this post


Link to post
Share on other sites

Bonjour

Merci pour votre aide tout marche sauf que j'ai les catégories en double .
Auriez vous une idée

Voici mon code

Hi, thanks for the module and your help, but my results is showing the categories in double. Here is my files (.css, .php; . tpl) thanks



.css
/*------------------------------------------------Meant to be homepage categories block--------------------*/
#homeCatWrapper {

margin-left: 0px; /* You may not need this unless you want to try to center categories */

}

#homeCat {

float: left;

width: 185px;

}

#homeCat h5 {

text-align: center;

}
/*------------------------------------------------Meant to be homepage categories block END--------------------*/
/*** Home Categories Module ***/

div.home_categories ul {
text-align: center;
list-style: none;
}
div.home_categories li {
float: left;
padding: 0px;
width: 185px;
}
div.home_categories h5 a {
font-size: x-small;
color: #999;
}
div.home_categories h5 a:hover {
text-decoration:underline;
color: #444;
}
div.home_categories div {
width: 185px;
opacity: 0.8;
border: 1px solid white;
}
div.home_categories div:hover {
filter:alpha(opacity=100);
opacity: 1;
-moz-opacity:1;
border: 1px solid orange;
}


.php
function hookHome($params)
{
global $link, $smarty;
$category = new Category(1);
$nb = intval(Configuration::get('HOME_categories_NBR'));

$smarty->assign(array(
'categories' => Category::getHomeCategories(intval($params['cookie']->id_lang), true),
'link' => $link,
'category' => $category,
'lang' => Language::getIsoById(intval($params['cookie']->id_lang)),
));
return $this->display(__FILE__, 'homecategories.tpl');
}

}

ET FICHIER .TPL

<!-- MODULE Home categories -->


{if isset($categories) AND $categories}

  • {foreach from=$categories item=category name=homeCategories}
    {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)}

  • {$category.name}

    {$category.name|truncate:15}

    {/foreach}

{else}

{l s='No categories' mod='homecategories'}


{/if}

<!-- /MODULE Home categories -->

Share this post


Link to post
Share on other sites

Frontpage Categories Module works great.
How hard would it be to make subcategories on category.php look the same with borders and hover.
I have used and modified slightly the example code from earlier in this thread.
Would it be a mater of css or would I need to work with other files.

Harley Bill :coolgrin:

11987_uJ2voJcXzlfmp5aiMMe2_t

11988_bXoJ1ElmM7TqeecG6Gjx_t

Share this post


Link to post
Share on other sites

Hello! this is a great module and comes perfectly to what I'm trying to do. My problem is that eventhough I read over and over the posts I cannot find a way to display the categories in the front without having the "categories block" hooked to the left column.

What am I missing?
Thank you in advance!

Share this post


Link to post
Share on other sites

I don't believe there is a way.
See post #3 "Make sure you have categories in the left column "

Harley Bill :coolgrin:

Share this post


Link to post
Share on other sites

well, yes, the thing is that i need to get rid of left column, i'm just workin with central and right... so nothing to do about it? :(

Share this post


Link to post
Share on other sites
I will be updating this module hopefully in the next week
v0.5 will include the CSS & a new admin config for this module ;)


Thank you for this module, amwdesign

Is there any news on this Update ?

I got this working with out problems in 1.2.4

Share this post


Link to post
Share on other sites

Hi, Just giving my personal experience.
Got it to work after a while. I did not get to make it work without the left column block. I am trying now to design with the border
Had to change all the pics of the categories in the c file of img, because they were at 500x150 and it was not aligning, so everything had to be resized.

That worked fine, now I have to resize so it is nice and centered and even.

if anyone gets it working without the left cat block, that would be great because right now, my design makes no sense i have categories in the horizontal nav bar, on the left and on the home page :)

I am real newbie so it is doable and the module works, but I was slow to figure it out.. basically had to be bold and try whatever :)

took me a couple hours.

Share this post


Link to post
Share on other sites

Not having much luck with this I'm afraid.

The "Transplant a module" area is completely greyed out, and the module isn't appearing on my front page. I've followed the original posters instructions. Anyone any ideas?

Share this post


Link to post
Share on other sites

Had to change all the pics of the categories in the c file of img, because they were at 500x150 and it was not aligning, so everything had to be resized.

That worked fine, now I have to resize so it is nice and centered and even.

took me a couple hours.


Same here I resized to 150x150 and I had to make special category picture.

This is a nice module but could do with a lift up. Looking forward to seeing next version.

Share this post


Link to post
Share on other sites

Thank all you for sharing experience. Guess we are all waiting for awndesign to help us out here.
Gonna chance design then...

Share this post


Link to post
Share on other sites
Not having much luck with this I'm afraid.

The "Transplant a module" area is completely greyed out, and the module isn't appearing on my front page. I've followed the original posters instructions. Anyone any ideas?


Anyone any idea what's going on here?

Share this post


Link to post
Share on other sites

Hello all,

After trying again I'm one step closer. I've actually installed the module and did so by simply uploading the achieve by adding a new module. Worked straight away. Just need to style it now.

Share this post


Link to post
Share on other sites

Hi, I would like to know how to show categories on subpage not on homepage without any modules like featured products etc. Is it possible with this module?

Share this post


Link to post
Share on other sites
Hi, I would like to know how to show categories on subpage not on homepage without any modules like featured products etc. Is it possible with this module?

@taigherpl An image map might suit your purposes - it ONLY displays on category pages and is ideal for graphical navigation.
HTH

Share this post


Link to post
Share on other sites

What about Prestashop picking up where “amwdesign” left off? A module like this should be a built in module. of course a lot of store owners and designers are going to want to have the categories or sub-categories on their home page? any chance prestashop is going to pick this one up and run with it? :| maybe? I vote yes please.

Share this post


Link to post
Share on other sites

This module is great. thanks amwdesign for developing it. It is working on my site, but it's giving me the categories, not the subcategories. Do you know a way to modify it to show subcategories instead?

thanks much,

james

Share this post


Link to post
Share on other sites

Hi, i ve instaled the module, but i have all this problem. in the pic

i would like to have 3 Categorie per line and 3 line

can someone help me pleaaaaaaaaaaaaaase ?

Tnx

15414_VAFKchUVEqmNt4WsIyJC_t

Share this post


Link to post
Share on other sites

Hi, does anyone know if the download for homecategories AMW design posted back in May 08 is still the version to run with or was there a newer version posted anywhere else?

Cheers

Craig

Share this post


Link to post
Share on other sites

Can someone PLEASE help me with this? I'm sure it's very simple, but I feel as though I've been trying to get this to work forever now. I've implemented everything correctly, but I've one problem. The images won't show up where the categories are, can any one explain why this is? I've included a screen shot to show you the problem.

I've also changed a few things within the homecategories.tpl file to the point where SOME of the images appear, but it appears that the home categories are too big and will leak over on to the new products, specials etc.

Many thanks for anyone who can help me with this!

15965_1eAWL16koVd7nhPEnGda_t

Share this post


Link to post
Share on other sites

Bonjour à tous,

Voici une intégration crossbrowser affichant les éléments côté à côté.

/*** Home Categories Module  ***/
div.home_categories{ margin:5px 0;}
div.home_categories ul {}
div.home_categories li { float: left; width: 180px; margin-right:5px;}
div.home_categories li img{ width: 175px;} /*border: 1px solid white; if you want*/
div.home_categories h5 {text-align:center; margin:5px 0 10px 0;}
div.home_categories h5 a { color: #999; text-decoration:none;}
div.home_categories h5 a:hover { text-decoration:underline; color: #444;}



En revanche, je souhaiterais afficher toutes les sous catégories de chaque catégorie si existante savez vous comment faire ?

Merci

Share this post


Link to post
Share on other sites

Hi,

I test your module and it's great. however, I try to display subcategories for each categories. Indeed, I see in your code

$subCategories = $category->getSubCategories(1);



Is it possible to do so with this variable ? How can you do ?

Thanks in advance for your help.

Bonjour,

J'ai testé votre module et il est également très bien. Cependant, j'essaye d'afficher les sous catégories pour chaque catégorie. En effet, danv otre code je vois :

$subCategories = $category->getSubCategories(1);



Est il possible de le faire via cette variable. Comment vous vous y prendriez ?

Merci d'avance pour votre réponse.

Share this post


Link to post
Share on other sites