- Posts: 16
Question New module for webtrees: enhanced news with images, comments and reactions
- Tywed
- Topic Author
- Offline
- New Member
And now to the topic. Having little experience with webtrees, I felt a lack of interaction between users on the portal. Therefore, I decided to write my own module that extends the functionality of the news block. First, I wrote a simple module that adds a link to the news section in the menu, using the modules jp-main-menu-manual and simple-menu-module as an example. Then I figured out the structure of the modules and added new features to my module: attaching images to news posts, delayed publication (or choosing a publication date), commenting on news (only for registered users, comments are hidden from visitors) and adding reactions to posts.To implement this functionality, I had to change the database. But I ran into a problem that does not interfere with the work of the module, but causes me discomfort. To run migrations, I use the following code:
When running the module for the first time, an error PDOException: There is no active transaction appears, although all tables are created normally. If you refresh the page several times, the error disappears. I searched the Internet for a similar problem and found this link , but I did not understand if it was resolved. Therefore, I ask for help from the community. You can view the current develop code of the module at this link . Sorry for the long text and possibly bad translation. )
webtrees‑2.1.17, Php 8.1, MySql 5.7.
Please Log in or Create an account to join the conversation.
- hermann
- Offline
- Elite Member
Hermann
Designer of the custom module "Extended Family"
webtrees 2.1.21 (all custom modules installed, PHP 8.3.12, MariaDB 10.6) @ ahnen.hartenthaler.eu
Please Log in or Create an account to join the conversation.
- Luc C
- Offline
- New Member
This is the kind of module that more people want I guess; it allows and stimulates interaction with other family members.
I installed your module, but there seems to be a problem with the picture; it doesn't show up like it should (with me anyway -please see screenshot attached; the family shield I want to appear only appears partly, like it's zoomed in to much).
And: is there a way I can adjust the position and sizes of the added pics?
Keep up the good work!
Please Log in or Create an account to join the conversation.
- Tywed
- Topic Author
- Offline
- New Member
- Posts: 16
If you wish, you can resize the images in the files:
resources/views/page-news.phtml
resources/views/show.phtml
Please Log in or Create an account to join the conversation.
- Newbie67
- Offline
- New Member
I played with such an idea as well, but then to include historical events from a specific event category.
For example I have added some historical newspaper articles added as an event and wanted to show them as a what happened in for example 1925 including references to the individual which holds the event.
Would that something you consider as well ?
www.onsverleden.eu | Running on webtrees 2.1.18 and makes use of the great modules Vesta and MagicSunday on top of the JustLight theme
Please Log in or Create an account to join the conversation.
- Tywed
- Topic Author
- Offline
- New Member
- Posts: 16
Please Log in or Create an account to join the conversation.
- Luc C
- Offline
- New Member
Thanks again, and keep creating!
Please Log in or Create an account to join the conversation.
- Bernat
- Offline
- Junior Member
media_id)) { echo $article->media_id->displayImage(400, 267, 'contenir', ); } ?>
www.quiesquiacalp.es
webtrees 2.1.20
Servidor MySQL 8.0.36
Servidor web: nginx/1.18.0
Versión PHP 8.3.3.
Hosting a webtrees.net
Please Log in or Create an account to join the conversation.
- Tywed
- Topic Author
- Offline
- New Member
- Posts: 16
Please Log in or Create an account to join the conversation.
- Bernat
- Offline
- Junior Member
www.quiesquiacalp.es
webtrees 2.1.20
Servidor MySQL 8.0.36
Servidor web: nginx/1.18.0
Versión PHP 8.3.3.
Hosting a webtrees.net
Please Log in or Create an account to join the conversation.
- Tywed
- Topic Author
- Offline
- New Member
- Posts: 16
Please Log in or Create an account to join the conversation.
- Bernat
- Offline
- Junior Member
www.quiesquiacalp.es
webtrees 2.1.20
Servidor MySQL 8.0.36
Servidor web: nginx/1.18.0
Versión PHP 8.3.3.
Hosting a webtrees.net
Please Log in or Create an account to join the conversation.
- Bernat
- Offline
- Junior Member
www.quiesquiacalp.es
webtrees 2.1.20
Servidor MySQL 8.0.36
Servidor web: nginx/1.18.0
Versión PHP 8.3.3.
Hosting a webtrees.net
Please Log in or Create an account to join the conversation.
- Tywed
- Topic Author
- Offline
- New Member
- Posts: 16
Please Log in or Create an account to join the conversation.
- webtreesFUN
- Offline
- New Member
- Posts: 92
Please Log in or Create an account to join the conversation.
- Tywed
- Topic Author
- Offline
- New Member
- Posts: 16
Please Log in or Create an account to join the conversation.
- webtreesFUN
- Offline
- New Member
- Posts: 92
Thx, solved.Rename the folder of module to NewsMenu. This folder should contain the files shown in the screenshot.
But now find a exception when not images/media selected coz not exist in pure new installation.
Also after posts comments
Please Log in or Create an account to join the conversation.
- Tywed
- Topic Author
- Offline
- New Member
- Posts: 16
Please Log in or Create an account to join the conversation.
- webtreesFUN
- Offline
- New Member
- Posts: 92
must be <?php - missed word, thats echo is with error : )
Also in NewsMenu\resources\views\show.phtml
And more.. You must check this all. There is many cases where <?php is not indicated
Also take care about this: "<?= csrf_field() ?>" where =
Please Log in or Create an account to join the conversation.
- Tywed
- Topic Author
- Offline
- New Member
- Posts: 16
Please Log in or Create an account to join the conversation.