Issuu documents are identfied by name + user as well as docmented here:
https://developer.issuu.com/managing-your-publications/documents/list
It seems the document ID is not easily grabable from the issuu UI, thus I think the module should support pasting the URL like https://issuu.com/USER/docs/NAME and keep the reference like that.
Thus, the module could either grab the document ID via the API on submission or just store the URL, since embeds can be generated as well via the format
<iframe src="//e.issuu.com/embed.html?d=NAME&u=USER" </iframe>
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3076134-7-issuu-viewer-allow-urls.patch | 10.11 KB | tamarpe |
| #7 | interdiff-6_7.txt | 4.23 KB | tamarpe |
| #6 | DD-519-issuu-viewer-allow-urls-3076134-3--altered-to-allow-any-url.patch.txt | 10.69 KB | alexgreyhead |
| #3 | 3076134-3.patch | 9.24 KB | tamarpe |
Comments
Comment #2
tamarpe commentedThanks for the issue!
That would be a great idea since they stopped lately to use config IDs to render the ISSUU viewer.
From the Issuu documentation:
'Unfortunately, it is not possible to fetch Embed Config Ids anymore. '
https://help.issuu.com/hc/en-us/articles/360025931034-iFrame-Embed-Code
Since some websites still are using the legacy with document ID - I think it would be best to allow wether to use the legacy with document ID - or with a URL.
Comment #3
tamarpe commentedI extended the existing document ID field to support URL as well, I think there is no need to add an extra one to define whether is ID or URL.
What do you think?
Comment #4
fagoYeah, this makes sense to me. The view-mode actually was confusing before, so +1 on removing it.
Idea: Some helper function for getting the right embed url seems useful now, so that logic is kept out of the twig template.
Should this get a 2.x version then since it's backwards incompatible changes?
Comment #5
fagoI'm not sure about storing the ID + the URL in the same attribute though.
Why not make a field with multiple columns instead:
- id, name, user
So the widget can set name + user from the URL + show that for editing and provide an alternative textfield for entering the ID. But then the data is there for proper API usage as well.
Comment #6
alexgreyhead commentedHello all, the patch in #3 largely worked for me but I wanted to contribute back a tweak I made to allow editors to enter either the e.issuu.com embed URL, or just the regular issuu.com document URL.
This was driven because our editors don't always have access or the training to know how to get the embed URL - for example https://e.issuu.com/embed.html?u=redactive&d=act_apr20_full - but the regular "view" URL - such as https://issuu.com/redactive/docs/act_apr20_full can be used to create the embed URL.
So, the patch attached allows users to enter an Issuu document's regular "view" URL, or its embed URL, and will adjust the output accordingly.
Hopefully this proves useful for someone as it has done for us :)
Alex
Comment #7
tamarpe commentedThank you very much @alexharries ! It works great.
A small remark - it would be great if you could provide interdiff next time, otherwise it's hard to follow the changes.
I think we still need to support embedding documents by a document ID since some websites are still using this legacy way.
I made it work for legacy documents ID's as well and cleaned it up - I removed an unused use statement and refactored the checks for the prefix via a loop. I mark is as RTBC :)
Comment #8
alexgreyhead commentedHi Tamarpe, glad I could be of help :)
Best wishes
Alex
Comment #10
tamarpe commented