Vous n'êtes pas identifié(e).
13 février 2024 Sortie de Dotclear 2.29
Bonjour
Dotclear 2.19 sortira bientôt. Pour les concepteurs de thèmes, j'ai trouvé utile de signaler ici de nouveaux behaviors que vos réalisations peuvent utiliser dans un configurateur.
Par exemple, jusqu'à présent, un configurateur de thème ne pouvait utiliser la popup de la médiathèque pour proposer de choisir une image, pour une bannière ou un logo, ce qui obligeait l'utilisateur à modifier les fichiers du thème pour remplacer une image.
C'est désormais possible grâce à l'ajout de la prise en compte du behavior adminPopupMedia. Vous trouverez un exemple simple de ce que l'on peut faire avec le thème Freelancer que j'ai publié récemment sur Dotaddict. J'espère que la lecture du code suffira, pour ceux qui souhaitent l'implémenter, mais je reste à votre disposition si vous avez des doutes ou des questions
D'autres behaviors sont aussi implémentés comme adminPopupPosts, qui permet de récupérer l'url d'un billet, à la manière de ce qui est fait dans la configuration du blog pour afficher une publication comme page d'accueil statique.
À vous les créateurs de thèmes !
Hors ligne
Hello Philippe
Do you have a link for the new 2.19? Or is it the last nightly build?
Avez-vous un lien pour la nouvelle 2.19? Ou est-ce la dernière nightly build?
I ♥ Dotclear.
Hors ligne
The 2.19 version I am using is the latest nightly build on the unstable channel. I use it locally for testing (and also on my profile's website).
Hors ligne
Hello Philippe
I just had a look at this new possibility, but as usual, I struggle where to start. Do you have a sample theme where I can see how this works?
I would think that it needs a change in the _top.html and config.php.
Many thanks!
Je viens de jeter un coup d’œil à cette nouvelle possibilité, mais comme d’habitude, je me bats par où commencer. Avez-vous un exemple de thème où je peux voir comment cela fonctionne?
Je pense qu’il faut changer le _top.html et la configuration.php.
Merci beaucoup!
I ♥ Dotclear.
Hors ligne
Hello Ben
As I stated in my first message, a simple theme you could check is Freelancer. It allows to change one image, and replace it with any other from your media manager.
Start from _prepend.php : this file loads the necessary js and css files:
- /js/admin.js and /css/admin.css for use in theme's configuration page. /js/admin.js opens the popup and listens to clicks on the two buttons "Change" and "Cancel"
- and /js/popup_media.js on call of Behavior adminPopupMedia by the media manager popup. It listens on the clicks on the popup and, on close, adds the chosen image to the theme's configuration page
After _prepend.php look at config.php, and finally _public.php
For the most, you can copy the files in your theme and replace the string freelancer everywhere by your theme's folder name ;)
If you have any question, I will gladly help :)
Hors ligne
Thanks Philippe. I will have a look in the coming winter weeks :-)
I ♥ Dotclear.
Hors ligne
Vous n'êtes pas identifié(e).