viresh-ratnakar / exolve

Online interactive crossword software in JavaScript
MIT License
74 stars 15 forks source link

Placing multiple widgets in specific HTML elements on the same page #59

Closed Sp3000 closed 3 years ago

Sp3000 commented 3 years ago

Hi there! Thanks for creating exolve -- it looks like a very useful tool!

I have a long explanatory page which I want to add multiple small crosswords to, with various text in between. From reading the docs, I see that:

By default, the puzzle content gets created as a new last element in the HTML Dom. But you can direct it to be placed at different spot by creating an empty element (typically a DIV) with id="exolve" anywhere in the HTML file. The puzzle content will then be added inside this element.

Since the id is static, does this mean that I can only add one crossword widget into a specific HTML element per page? Is it possible to make it so that I can specify the HTML element to add each puzzle to?

Sp3000 commented 3 years ago

Nevermind I think I found it -- it looks like containerId in createExolve(). I guess in that case maybe the docs for "Placing the puzzle in a specific HTML element" should be updated?

viresh-ratnakar commented 3 years ago

Indeed, you can pass a containerId in createExolve() and set up multiple puzzles within a single page, as you found.

I've updated the "Placing the puzzle..." documentation now--thanks for catching that!