MathHubInfo / Legacy-planetary

Legacy: Planetary System is a math-enabled Web 3.0 information portal.
http://trac.mathweb.org/planetary/
79 stars 25 forks source link

images should link back to their gallery pages #355

Open holtzermann17 opened 11 years ago

holtzermann17 commented 11 years ago

In #79 which we closed, we actually skipped one important part:

Images, as included in articles, should link back to their page in the gallery.

The problem: this is not just as simple as adding

<a href="PATH TO IMAGE"> ... </a>

around the current <img ... /> tag -- because as things currently stand, image nodes can have a completely arbitrary name, and, moreover their URLs aren't based on any sort of "canonical name" aliases, but just raw node numbers.

For example: http://planetmath.org/node/87367 is an image named MSCBrowsing and the actual image filename is MSCBrowsing.png (accessed at http://planetmath.org/sites/default/files/pictures/MSCBrowsing.png).

I'm not sure how best to solve this, actually -- it probably points to the need to rethink the gallery system completely, cf. #47. @dginev: any ideas would be appreciated, and the <a href="PATH TO IMAGE"> ... </a> partial solution would certainly be "good enough for now". Deferring this to a later milestone.

dginev commented 11 years ago

around the current <img ... /> tag -- because as things currently stand, image nodes can have a completely arbitrary name, and, moreover their URLs aren't based on any sort of "canonical name" aliases, but just raw node numbers.

Well, annotation-wise it _is_ as simple as adding an anchor around an image element. Figuring out the href for the anchor might indeed be complicated as you suggest, but let's not mix issues here.

From what I understand, the real problem is that you want to point to images, as hosted by Drupal's file server, while the Gallery serves nodes (as anything else in Drupal), the nodes themselves also pointing to those same images on the file server. So you have 2 resources you care about that you need to tie together.

Various solutions come to mind, based on what perspective you take:

Having a good conceptualization of what the Gallery is and how users should interact with it will help guide the selection of an approach, or the invention of a new one. But the markup end of affairs is simple - wrap the <img> with an <a> and you're done.

holtzermann17 commented 11 years ago

One of these two seems good (and they are similar).

Gallery's responsibility - put in place a canonical naming scheme that makes it possible to relate the image to its Gallery node, then LaTeXML can easily generate the right markup.

Planetary's responsibility (v3) - have aliases for Gallery nodes, using the canonical names of the images, similarly to the way aliases are handled for articles

The surrounding a href markup produced by LaTeXML could then be something like: http://planetmath.org/image/MSCBrowsing.png

Planetary can then sort out what to do with that.