Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - Allow to have multiple blocks on the same page #59

Merged
merged 1 commit into from Jun 14, 2023

Conversation

papjul
Copy link
Contributor

@papjul papjul commented Mar 20, 2023

Currently, the chart is inside a container with the same ID.
If we add multiple block charts on the same page, only one block is able to load, the others fail with "redeclaration of variable" error.

This pull request creates an unique ID for this container, to fix the issue.

@magicsunday
Copy link
Owner

Hi. How do you add multiple charts to a page? That doesn't mean anything to me now, but I don't know all the features of Webtrees either. Can you please provide me with a corresponding UAT that I can use to test your changes?

@papjul
Copy link
Contributor Author

papjul commented Apr 23, 2023

Step-by-step to reproduce the issue:

  1. Disable default ancestor chart in Control Panel > All modules => This will allow blocks to default to Webtree Pedigree Chart instead
  2. Customize your page. Add two blocks of type "Chart".
  3. Configure each block to be Pedigree, with a different person for each.
  4. Only one of the two blocks will be shown at the same time on the same page due to having the same ID for each block.

It is currently hardcoded in Webtrees to be left to right layout with 3 generations. I have a pending PR that will allow more customization for this: fisharebest/webtrees#4796

(the two PR are not dependent on each other)

@magicsunday
Copy link
Owner

Sorry. Can't find the "Charts" block.

grafik

@06Games
Copy link
Contributor

06Games commented May 7, 2023

For some reason, the Charts block is only available in the home page of the tree and not in the "My page"

@papjul
Copy link
Contributor Author

papjul commented May 7, 2023

@06Games is correct, I wasn't specific enough, and didn't know that the private page didn't allow Charts blocks.

My use case is to show multiple small charts on the public page (homepage of the family). Because I have origins from different countries, I want to be able to tell the story of different branches along with a small chart each time.

Basically, my page is configured like this:
HTML
Charts
HTML
Charts
HTML
Charts
etc

@magicsunday magicsunday merged commit 55a4c69 into magicsunday:master Jun 14, 2023
1 check passed
@papjul papjul mentioned this pull request Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants