JustCarmen/webtrees-fancy-treeview

Link "create link to descendants page" shows ancestors instead of descendants

hartenthaler opened this issue · 5 comments

The link is generated correctly. But the opening view shows the ancestors instead of the descendants.

I cannot find the error. Can you give me the steps you took to get this result?

When I'm creating a link to a descendants page:
Screenshot (402)

the link is generated correctly. But I would expect to see the descendants page and not the ancestors page in the tab of your module:
Screenshot (403)

Aha, I understand. But it was never designed that way.

The links in the edit menu on the individual page are meant to create links to the Fancy Treeview page. Those links are placed in the menu as a new item or in the Fancy Treeview block on the home page. The latter is in the latest development version, to be released soon.

For user convenience, both link creation is offered (descendants and ancestors) and offered both from the individual page and from the Fancy Treeview page, to minimize the number of clicks to create a link.

After a link is created, the page is refreshed. In the case of the individual page, the page is opened on the last opened tab in the default position. If you have set the default list type to "ancestors," the ancestor tab will open despite the link you just created. The new links can be found in the Fancy Treeview menu or in the home page block and lead to the full Fancy Treeview page, not the tab.

To achieve what you would like, I would have to remember which link the user just made and implement that choice after a page refresh, which can only be done by remembering the choice with a cookie or something. I don't think we should want that for this purpose.

When I implemented the menu option I was looking for a convenient way to create the links. I didn't want to use the configuration page with a search field like in version 1. Now you can create links from each individual on their individual page or on the Fancy Treeview page, which is much easier. But if this gets too complicated to understand, I may have to remove the option from the edit menu and keep it only on the Fancy Treeview page.

I understand now how it is designed. This design is good, I like it, so do not change it. I have one small point to mention.

After a link is created, the page is refreshed. In the case of the individual page, the page is opened on the last opened tab in the default position.

Are you sure? When I'm on the tab "Media" of the Individual page for example and create a link using the option in the edit menu, the page is refreshed, but the page is then not opened in the "Media" tab. The page is opened in the tab "Ancestors and descendants" using the default view for ancestors or descendants (in my case: ancestors). That is the reason I was wondering about it. I would prefer that the page is refreshed with the "Media" tab instead of changing the tab when generating a new link.

You're right. After creating a link, the page always returns to the Fancy Treeview tab instead of the current tab, which can be confusing. However, returning to the current tab is not easy to implement because no page fragment (the hashtag) is sent to the server. We need javascript and a cookie to determine which tab we are on before creating a new link (and refreshing the page when saving).

The default in webtrees is to go to the first tab after saving an edit form from the edit menu. I will follow that.