Web based family history software

Question New module for webtrees: enhanced news with images, comments and reactions

More
1 year 2 months ago - 1 year 2 months ago #1 by Tywed
Hello everyone! Before moving on to the main topic, I wanted to share my experience of using webtrees. A year after installing webtrees, we filled in information about 167 members of our family and traced its history back to 1644. I use a closed tree, accessible only to registered relatives, and I really like how the developers of webtrees ensured data confidentiality. I also use the following modules: Custom CSS - by makitso, Extended Family - by Hartenthaler, Faces - by UksusoFF, Reminder - by UksusoFF, Fancy Image Bar - by JustCarmen, Family Tree Home Page – by miqrogroove. I also liked these modules very much – thank you very much to their creators.

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:
Code:
public function boot(): void   { app(MigrationService::class)>updateSchema('Tywed\webtrees\Module\NewsMenu\Migrations', self::SETTING_SCHEMA_NAME, self::SCHEMA_VERSION);    }

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.
Attachments:
Last edit: 1 year 2 months ago by Tywed.

Please Log in or Create an account to join the conversation.

More
1 year 2 months ago #2 by hermann
I don't have a solution for your problem, but I installed your module in a test environment and I like it! It is easy to use it. Some webtrees users are operating an additional Joomla or WordPress system. In my opinion, your module will allow more users of webtrees similar functionality without operating and integrating such a large publishing system.

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.

More
10 months 2 weeks ago #3 by Luc C
Hi Tywed!
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!
 
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #4 by Tywed
Thanks for your feedback. I made displays specifically for horizontal images. Now I changed cropping mode from 'crop' to 'contain' ( github.com/Tywed/news-menu/commit/3b10bc...bcd9a353860c9f1379b2 )

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.

More
10 months 2 weeks ago #5 by Newbie67
I really like the idea, so thanks for your work so far !
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.

More
10 months 2 weeks ago #6 by Tywed
Do you mean posting a news item with a date for 1925? An interesting idea, if I understand you correctly.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago - 10 months 2 weeks ago #7 by Luc C
Many thanks Tywed; this was the solution to my problem indeed.. The portrait sized images show correctly now.
Thanks again, and keep creating! ;-)
Last edit: 10 months 2 weeks ago by Luc C.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago - 10 months 2 weeks ago #8 by Bernat
  Qué significa aquest error. És l'únic que no em funciona en el teu  estupendo.menú

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
Last edit: 10 months 2 weeks ago by Bernat.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago - 10 months 2 weeks ago #9 by Tywed
Can you please tell me the version of webtrees and the theme used? The module was tested on standard themes and works on webtrees versions 2.1.17, 2.1.18. Now I have definitely checked the work on the themes indicated in the screenshot.
Attachments:
Last edit: 10 months 2 weeks ago by Tywed.

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #10 by Bernat
webtrees 2.1.18 y módulo Rural

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.

More
10 months 2 weeks ago #11 by Tywed
Try switching to one of the standard themes, for example webtrees, if the images appear, it means my module is not compatible with the Rural theme (I don’t have it, maybe I can install it this weekend and see what’s the reason).

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #12 by Bernat
Gràcies pels teus esforços en ajudar-me.Efectivament, he provat el mòdul en diferents temes i en tots apareix el mateix error. (Te mando una captura de la presentaión webtrees). M'agradaria col·laborar en art major explicacions, però la meva formació és molt limitada. El lloc.De tots els modes. Insisteixo. El teu mòdul és molt bo!

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
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 2 weeks ago #13 by Bernat
Ampliant la meva resposta anterior, em acabo de donar compte que el text de l'error és en realitat un enllaç que, si clico en el, em presenta la següent pantalla... (veure imatge adjunta)

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
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #14 by Tywed
I installed the Rural theme, the only visible problem is the lack of an icon in my module with this theme. Added it. Also combined main with develop. Try deleting the folder with the module news-menu and downloading it again from the link: github.com/Tywed/news-menu/releases/tag/v0.2.1
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago - 10 months 1 week ago #15 by webtreesFUN
This promising nice functionality.. I looked this type before You posted..
But.. hove troubles around; "Module _NewsMenu_ does not exist" after "Add new article"


Last edit: 10 months 1 week ago by webtreesFUN.

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago - 10 months 1 week ago #16 by Tywed
Rename the folder of module to NewsMenu. This folder should contain the files shown in the screenshot.
Attachments:
Last edit: 10 months 1 week ago by Tywed.

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago - 10 months 1 week ago #17 by webtreesFUN

Rename the folder of module to NewsMenu. This folder should contain the files shown in the screenshot.


 
Thx, solved.
But now find a exception when not images/media selected coz not exist in pure new installation.

 

Also after posts comments
 
Last edit: 10 months 1 week ago by webtreesFUN.

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #18 by Tywed
I can’t reproduce this problem either on my test server or on hosting. This also originated from Bernat.

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago - 10 months 1 week ago #19 by webtreesFUN
Also when I edited and added media no changes around. Looks like wrong conversion around template in "NewsMenu\resources\views\page-news.phtml", eg. " echo $article->media_id->displayImage(400, 267, 'contain', );"

must be <?php - missed word, thats echo is with error : )

 
Code:
                                <?php  if (isset($article->media_id)) {                                     echo $article->media_id->displayImage(400, 267, 'contain', ['class=' => 'img-fluid shadow-2-strong rounded-2 w-100']);                                 }

Also in NewsMenu\resources\views\show.phtml
Code:
          <div class="bg-image hover-overlay ripple rounded-0" data-mdb-ripple-color="light">             <? if (isset($news_media)) {               echo $news_media->displayImage(1000, 667, 'contain', ['class' => 'w-100 me-3']);             }             ?>
Code:
          <div class="bg-image hover-overlay ripple rounded-0" data-mdb-ripple-color="light">             <?php if (isset($news_media)) {               echo $news_media->displayImage(1000, 667, 'contain', ['class' => 'w-100 me-3']);             }             ?>

And more.. You must check this all. There is many cases where <?php is not indicated

Also take care about this: "<?= csrf_field() ?>" where =
Last edit: 10 months 1 week ago by webtreesFUN.

Please Log in or Create an account to join the conversation.

More
10 months 1 week ago #20 by Tywed
Did this solve your problem with displaying images?

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum