Web based family history software

This Help forum is for issues relates to the latest release (1.7.7). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

Question [SOLVED] Default tree

More
7 years 7 months ago #1 by jelo
Default tree was created by jelo
I have two family trees, where tree 1 is set as default.

When you logout of tree 2 then webtrees switches to tree 1.

Is it possible to have none as default, or is it possible to prevent this behavior?

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

  • bertkoor
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
7 years 7 months ago - 7 years 7 months ago #2 by bertkoor
Replied by bertkoor on topic Default tree
No, webtrees is very eager to show a tree. I don't think you can have no tree as the default tree. You can have all trees private, but that has some side-effects.

What you can try though: create a third tree and make that the default tree of your site.
Create a html block on it's Home page where you put links to both your "real" trees and some generic information about it.
Then disable access in that dummy tree (with only a landing page) to all the usual lists, diagrams & reports.

Would that be more to your liking?

stamboom.BertKoor.nl runs on webtrees v1.7.13
Last edit: 7 years 7 months ago by bertkoor.

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

More
7 years 7 months ago #3 by jelo
Replied by jelo on topic Default tree
I would prefer that you stayed in the tree that you logged out of.

Would that be difficult to change in the webtree code?

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

More
7 years 7 months ago #4 by fa10175
Replied by fa10175 on topic Default tree
a user must be a member to access the tree (access living people) and visitor to the other.

if you configure webtrees with mandatory connection, it works very well.

if you do not configure webtrees like this, the two trees are accessible to visitors and I think you can switch from one tree to another as visitors.

- Nginx 1.22.1
- PHP 8.2.7
- MariaDB 10.11.6
- Webtrees 2.1.19
- Raspberry Pi 5
Modules : jc-fancy-imagebar, jc-fancy-treeview, vesta, faces, fan-chart, pedigree-chart, descendants-chart, hh_extended_family

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

More
7 years 7 months ago #5 by fisharebest
Replied by fisharebest on topic Default tree
> Is it possible to have none as default, or is it possible to prevent this behavior?

It is not possible to have "no tree" as a default.

Each tree can have a different theme, menus, etc., We need to have a tree before we can display any page.

When you arrive at the site as a new user (or logout), webtrees will choose a tree. You can choose a preferred/default tree. If you don't, the first tree (with puhblic access) will be used.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

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

More
7 years 7 months ago #6 by jelo
Replied by jelo on topic Default tree
I can see why you must have a default tree on arrival to webtrees.
But when you have arrived and have selected your tree you should stay in that tree until you select otherwise (also on logout).

Think about it: You come home from work an lock up your frontdoor. Later in the evening you want something to eat and order a taxi to drive you to a restaurent. When the taxa arrive you open the frontdoor an lock yourself out. But you can't find the taxi because you are standing before another door than your own!

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

  • thomas52
  • Offline
  • Premium Member
  • Premium Member
  • Western North Carolina
More
7 years 7 months ago #7 by thomas52
Replied by thomas52 on topic Default tree
There are many other ways to address your issue.
You can enter the entire address, as www.adkins.ws/index.php?ctype=gedcom&ged=Adkins.GED
You can create a bit.ly shortcut, as bit.ly/adkinsfamily
webtrees, and before that it's predecessor, PhpGedView, has been is design by it's USERS for a good 20 years or more.
We have made many changes & upgrades, and every aspect of the code is for a reason that we, the users, have chosen.
Think about it.

"Failure is an amazing teacher." (L'échec est un professeur extraordinaire.)

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

More
7 years 7 months ago #8 by fisharebest
Replied by fisharebest on topic Default tree
> But when you have arrived and have selected your tree you should stay in that tree until you select otherwise (also on logout).


This is what happens - and what is designed to happen.

If you're seeing something different, then the more detail you can give, the easier it will be to understand what is happening on your site.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

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

More
7 years 7 months ago #9 by jelo
Replied by jelo on topic Default tree
>If you're seeing something different, then the more detail you can give, the easier it will be to understand what is happening on your site. <

It is very simple to describe what happens.
The webtree installation consists of two separate trees: Tree1 and Tree2.

You are still i Tree1 when logging out of Tree1 (thats OK).
But when you log out of Tree2 you suddenly find yourself in Tree1 (should have been Tree2).

Webtree tells you that you have logged out and show the start page for Tree1 in both cases.

That is what happens. I can not be more detailed.
I could, if you like, create a user so you can see it for yourself.

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

  • bertkoor
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
7 years 7 months ago - 7 years 7 months ago #10 by bertkoor
Replied by bertkoor on topic Default tree
If all you need is change of behaviour of logout, try this...

The last line of logout.php is currently:
Code:
header('Location: ' . WT_BASE_URL);

Change that to:
Code:
header('Location: ' . WT_BASE_URL . 'index.php?ged=' . $WT_TREE->getNameUrl());

But at the front (inbetween line 16:namespace and line 18:define) you also need to insert this line:
Code:
global $WT_TREE;


And the next thing you might want is not to be thrown back to the index page, but stay on the very same page (make it completely consistent with login ;-)
That can be done as well. Last line in logout.php then needs to be:
Code:
header('Location: ' . WT_BASE_URL . $url);

but the previous page url needs to be determined first, just after line 19:require :
Code:
$url = Filter::post('url'); if (!$url) { $url = Filter::get('url'); }

and this page url must be specified in the same way as it is for login. This requires a small change in \app\Theme\AbstractTheme.php
Line 1572 (within function menuLogout) becomes:
Code:
return new Menu(I18N::translate('Sign out'), 'logout.php' . '?url=' . rawurlencode(Functions::getQueryUrl()), 'menu-logout');


There are some downsides to this:
1. if you were on a private page, you will get an "unauthorised" message, while previously you'd land on a guaranteed public page.
2. manual patches like this will be undone whenever you perform an upgrade.

stamboom.BertKoor.nl runs on webtrees v1.7.13
Last edit: 7 years 7 months ago by bertkoor.

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

More
7 years 7 months ago #11 by jelo
Replied by jelo on topic Default tree
Thank you for the two corretions to the software :-)

I tried the first part of your correction and it worked as I think webtrees should.

The only downside is that I have to change logout.php every time there is an update to webtrees.

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

More
7 years 7 months ago #12 by jelo
Replied by jelo on topic [SOLVED] Default tree
Problem solved.

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

  • thomas52
  • Offline
  • Premium Member
  • Premium Member
  • Western North Carolina
More
7 years 7 months ago #13 by thomas52
Replied by thomas52 on topic [SOLVED] Default tree
Just as a thought, each user can be designated a "default individual" even if the default individual happens to be several hundred years older than the user (perhaps 5th great-grand.)
In such a case, might the preferred tree default to that of the default individual? (I have everyone on the same tree, so I cannot test the effect.)

"Failure is an amazing teacher." (L'échec est un professeur extraordinaire.)

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

  • bertkoor
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
7 years 7 months ago #14 by bertkoor
Replied by bertkoor on topic [SOLVED] Default tree

thomas52 wrote: Just as a thought, each user can be designated a "default individual" even if the default individual happens to be several hundred years older than the user (perhaps 5th great-grand.)
In such a case, might the preferred tree default to that of the default individual? (I have everyone on the same tree, so I cannot test the effect.)

Thanks for the idea, but you can specify a 'default' individual for each (and every) tree.

I'd rather see that webtrees at logout keeps you on the same page. That would be consistent with the login action, and with a simple philosophy behind it: the login status changes and nothing else.

stamboom.BertKoor.nl runs on webtrees v1.7.13

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

More
7 years 7 months ago #15 by JustCarmen
Replied by JustCarmen on topic [SOLVED] Default tree

I tried the first part of your correction and it worked as I think webtrees should.

The only downside is that I have to change logout.php every time there is an update to webtrees.


I've created a pull request at github to add this to the core. Hopefully Greg will accept this change.

github.com/fisharebest/webtrees/pull/1092


Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2


Check my website at www.justcarmen.nl

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

  • thomas52
  • Offline
  • Premium Member
  • Premium Member
  • Western North Carolina
More
7 years 7 months ago #16 by thomas52
Replied by thomas52 on topic [SOLVED] Default tree
Yes!, please. Sometimes I have to go to 'My Page' to check recent changes to find where I left off.

"Failure is an amazing teacher." (L'échec est un professeur extraordinaire.)

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

Powered by Kunena Forum
}