No internet connection
  1. Home
  2. Ideas

Embedded forums: Make Talkyard work in an <iframe>

"Too many" people want Talkyard forums to work in <iframe>s. (Not just for blog comments, but a whole forum.) Turns out, it's not that much to do (or at least that's how it looks, right now) — all the complicated things have been handled already, as part of Talkyard blog comments. Left to do:

Phase 1:

  • Sending the session id and XSRF token via headers, in some more places, in addition to where this is already done because of blog comments. (Cookies usually don't work, in iframes.)
  • Allow more API endpoints, when embedded. E.g. listing topics, creating topics.

Phase 2:

  • Remember session id parts 1 and 2 in the embedding page. For this, a new script like embedded-forum.js is needed on the embedding page. (It'll be pretty similar to blog-comments.ts, but simpler, since no separate editor <iframe>.) — Otherwise one gets logged out, if navigating away and back, or if one reloads the page.
    (But to do any more important things, more parts of the session ID are needed — then, one will always need to navigate to the not-embedded forum. E.g. if an admin wants to change forum settings.)

Phase 3:

  • Maybe deep links? How do you deep link to a discussion in an <iframe>? One way could be the URL hash fragment: /embedded/foum/#talkyard-page-1234 (where 1234 is a page id).
  • Maybe if the <iframe> is placed in the middle of a page, other things above and below, then, its height should adjust, based on the device height (and orientation). But this might not be needed, if the iframe is at the end of the page — then, can let the forum use all the height it wants.

***

Related, but let's not do now: Embedded forum categories. And, might be nice to fix: Blog comments don't switch from old test URL to new real URL (happens when testing but can be confusing).

  • 0 replies
  1. Progress
    with doing this idea
  2. @KajMagnus marked this topic as Started 2025-04-19 03:57:52.639Z.