PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

[Module] Module News très simple

91 replies to this topic
#1
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts
Bonjour à tous,

Je vous propose un module qui affiche des news (en nombre souhaité) sur la page d'accueil, bien sûr le texte affiché est tronqué afin de limiter une ligne par news.
En BO on peu ajouter, modifier ou supprimer une news ainsi qu'inscrire le nombre de news a affiché dans la page d'accueil.
Ce module n'a rien avoir avec le module PrestaNews ou ModernNews, bien plus complet que celui-ci.

Pour l'installation il y a un Readme à l'intérieur du zip

Mise à jour V.05:
Meilleur gestion des XML.
L'ordre des news/notes sont trier (la plus récente en haut).
Détails d'affichage (decode_utf8) => à confirmer.
Affichage liste de toutes les news si pas de paramètre (lien externe vers notes.php).
Résumé des news/note en dessous de chaque news/note afin de s'y retrouver plus facilement => sera améliorer

Mise à jour V.06:
Remplacement de notes par news (plus intuitif).
UTF8 des XML mieux gérer.
Dernier point de la V.05 améliorer.
Possibilité de changer le texte en BO si le paramètre n'existe pas.



Voir exemple sur le site : http://www.coway-filtres.eu/

Dites-moi ce que vous en pensez :)

Attached Files


Webdeveloper

#2
marijon

    PrestaShop Newbie

  • Members
  • Pip
  • 14 posts
BONSOIR ? COMMENT FAIRE POUR AJOUTER UN MODULE
MERCI DE M'AIDER CORDIALEMENT

#3
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts
Bonsoir un readme se trouve a l'interieur du zip afin d'expliquer toute la marche a suivre, mais étant donné mon âme charitable d'aujourd'hui j'explique également ici :)

Pour installer ce module:
- uploader le fichier notes.php sur votre serveur a la racine de votre site
- uploader ensuite le fichier notes.tpl à la racine de votre thème
- Uploader le dossier blochomenews dans le dossier de vos modules et installer-le via le BO de votre site en allant a la rubrique Tools et en cliquant sur installer.

Voila. Tenez-moi au courant :coolsmirk:
Webdeveloper

#4
marijon

    PrestaShop Newbie

  • Members
  • Pip
  • 14 posts
j'ai regarde ton site ,il est super j'en suis loin
J 'adorais mettre le logo de paypal avec les C B , car mes clients sont un peu perdus avec paypal
comment faire merci bonne soirée www.nospetitszazous.com

Attached Files



#5
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts
Merci beaucoup pour le site,

pour installer des images avec des liens il existe plusieurs possibilité. Soit recopier un module tel que blocpaymentlogo en prenant bien soin de modifier tous les noms (liens vers fichiers du module interne), mais que je déconseil pour les personnes ni connaissant pas grand chose en php. L'autre méthode que j'appelle méthode bûcheron consiste à ouvrir le fichier tpl du module au-dessus ou en-dessous duquel l'on a envie d'insérer une image et d'y mettre le lien vers son image tel que p.ex.: nom_img en sachant que la variable {$img_dir} pointe vers le dossier img de ton thème par défaut.

Voilou
Webdeveloper

#6
jolvil

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2706 posts
Sympa :-)
Par contre les url des articles ne sont pas réecrites: http://www.coway-fil...u/notes.php?n=1

Il y a un module qui utilise l'outil CMS de prestashop qui pourrait peut etre permettre de faire la même chose:
http://www.prestasho...iewthread/42908 avec les avantages: install auto, utilisation cms, url réécrites.

#7
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts
Merci pour votre réaction,

C'est vrai que les deux modules peuvent paraître semblables, néanmoins je souhaitai réellement avoir un module indépendant, donc aucun rattachement au cms etc, je compte développer ce module bien plus loin (surement grâce à l'aide de tout le monde ici %-P) en y ajoutant la possibilité d'ajouter des images p.ex. et rendre le tout bien plus automatique, (les fichiers notes.php et notes.tpl copier automatiquement à l'installation du module).

Merci pour vos feedback :-)
Webdeveloper

#8
yaya

    PrestaShop Apprentice

  • Members
  • PipPip
  • 294 posts
Actuellement ce module s'installe sur la page d'accueil, y aurait-il moyen de l'installer sur la fiche produit car cela pourrait etre utile pour inscrire certaines conditions telles que vente taille....

#9
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts
Oui il y a moyen, il faut juste changer le hook dans le fichier blockhomenews.php.

Je vous donne le fichier déjà changer, afin que vous puissiez travailler dessus. Bien-sûr il faut encore modifier un peu les feuilles de style. Mais voila, en espérant avoir pu vous aider. ;-)

Attached Files


Webdeveloper

#10
Radu

    PrestaShop Addict

  • Moderators
  • 572 posts
Thank you very much for the module!!! it was exactly what I was looking for

#11
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts
I'm glad to make someone happy ;-)
Webdeveloper

#12
Stefanoz

    PrestaShop Newbie

  • Members
  • Pip
  • 11 posts

From 1266862347:

I'm glad to make someone happy ;-)


Hello,

many thank for this great module!!!
Really a good work!

I have now installed the version 1.2.5 because before i have had the 1.2.2 but unfortunately on the hope page the module.

I have followed these instruction and i have update the new php file to the folder:
Pour installer ce module:
- uploader le fichier notes.php sur votre serveur a la racine de votre site
- uploader ensuite le fichier notes.tpl à la racine de votre thème
- Uploader le dossier blochomenews dans le dossier de vos modules et installer-le via le BO de votre site

i have created a demo new but nothing on the first page :-((

You can look the module position in the attachment..

please can you have a look to my situation?

Attached Files



#13
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts
Did you tried to uninstall it and reinstall at the BO? I have the version 1.2.5 also (it should normally work).
Do you have anything at the home page, an error, a warning or something else?
Did you try to add a news and see what happens?
Webdeveloper

#14
Stefanoz

    PrestaShop Newbie

  • Members
  • Pip
  • 11 posts
hello, its not on the first page but just under each product description.

look here to have a better idea.......






thx very much

Attached Files



#15
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts
Yes, this is because you download the file blochomenews.php. Don't download it if you want it in the first page. Just download the zip file at my first post to have it on the first page.

Now that the module is installed in your shop, you can replace the blochomenews.php file with the one on the zip.

Did it work?
Webdeveloper

#16
Stefanoz

    PrestaShop Newbie

  • Members
  • Pip
  • 11 posts
Dear Mr. Blackpanther,

it works!i love it!

Best regards,
many thanks!!!!

#17
Stefanoz

    PrestaShop Newbie

  • Members
  • Pip
  • 11 posts
Hello,

im sorry but the module have a little problem, i have given a title and a short text, i got an error and on the first side the module display not the title but the text in the note.

look the attachment.

regards,
good job!

Attached Files



#18
Blacktiger85

    PrestaShop Newbie

  • Members
  • Pip
  • 23 posts

From 1266965157:

Hello,

im sorry but the module have a little problem, i have given a title and a short text, i got an error and on the first side the module display not the title but the text in the note.

look the attachment.

regards,
good job!


Try to change at line 244 from functions.php this
    if ($modify){
$dom->load('../modules/blockhomenews/XML/news'.$id.'.xml');
}

against this
    if ($modify){
unlink('../modules/blockhomenews/XML/news'.$id.'.xml');
}


You should behave the error.

At homepage the text appear and not the title. To make the title visible replace at line 11 from blockhomenews.tpl file this
{$nws[$i]}

against this
{$tit[$i]}


Tell me if it works.

Thank you
Webdeveloper

#19
Stefanoz

    PrestaShop Newbie

  • Members
  • Pip
  • 11 posts
it works really good!

Thx much!

Great job!!!

;-)))))

#20
Stefanoz

    PrestaShop Newbie

  • Members
  • Pip
  • 11 posts
a question, how to invert the order of the news?

i mean, the recent on the high of the banner and the latest down...

regards