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>

Comments

fago created an issue. See original summary.

tamarpe’s picture

Thanks 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.

tamarpe’s picture

Status: Active » Needs review
StatusFileSize
new9.24 KB

I 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?

fago’s picture

Yeah, 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?

fago’s picture

I'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.

alexgreyhead’s picture

Hello 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

tamarpe’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.23 KB
new10.11 KB

Thank 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 :)

alexgreyhead’s picture

Hi Tamarpe, glad I could be of help :)

Best wishes

Alex

  • tamarpe committed c4f6e84 on 8.x-1.x
    Issue #3076134 by alexharries, fago, tamarpe: Support entering documents...
tamarpe’s picture

Status: Reviewed & tested by the community » Closed (fixed)