Johan Sundström wrote:
> I thought I had brought up this wish / subject for discussion already,
> but can't seem to find it now, so perhaps I didn't. Either way, more
> ideas have come up since then, so whichever the case:
>
> U(se)C(ase)1) I often encounter use cases where I want to render URL
> type properties as a link, pointing to the URL, but titled something
> else, typically a different property of the item. In other words,
> generating links not laid out as <a ex:href-content=".url"
> ex:content=".url"></a>, but with different exhibit expressions for the
> title/content, and the href attribute. This is presently easy to do in
> lense templates, but impossible in, perhaps most notably, 1a):
> TabularView columns.
>
> UC2) Conversely, I often have titles which I would want linked to some
> URL property, when set, or just presented as text, when not available.
> (This is presently not even possible to achieve with lense templates.)
>
> I mean to find (and implement) solutions to both issues, and I find
> them at least in part related, especially in 1a) the TabularView
> column case, which I aim to address first. My angle on that is thus:
> how would we want to declare that behaviour in our markup?
>
> Two different answers to 1a) have come up so far, both able to achieve
> the same effect, but different in scope. It's not an either/or
> solution; both could be useful in their own right, independently or in
> concert.
>
> Let's assume a context of wanting to set up a meta exhibit of
> exhibits, where we want to link to exhibits by page title rather than
> by page URL. (If you don't wan a meta exhibit like that, feel free to
> assume some other example instead; it's just an example, after all.)
> I'm naming/numbering the solutions below by what use cases above they
> address.
>
> S(olution)1:1) Allow configuring link titles at the property type
> level, throughout the entire exhibit (or at least where Exhibit
> renders the links to that particular valueType:"url" property). In
> Exhibit JSON terms, this could look like:
>
>   { properties:{ pageURL: { valueType:"url", linkTitle:".title" } }
>
> S1a:2) Invent an exhibit expression function for links, which takes
> two expression parameters: an url (expression), and a title
> (expression). An ex:column setup using this could look like:
>
>   ex:columns=".number, link(.pageURL, .title), .creationDate"
>
> Thoughts and inputs on anything covered above appreciated. I might not
> listen much to arguments along the lines of "don't want this", but if
> you feel that Exhibit should remain incapable of the above I would
> prefer input on how or where I should instead intercept page
> rendering, so I could achieve effects like UC1a in my own exhibits
Hi Johan, I have a similar need elsewhere... and I'd propose yet another 
solution specifically for the tabular view: support row templates. E.g.,

    <table ex:role="view" ex:viewClass="Exhibit.TabularView">
          <tr>
             <td ex:content=".foo"></td>
             <td><a ex:href=".url" ex:content=".title"></a></td>
             <td class="foo-bar"><span ex:content=".first-name"></span> 
<span ex:content=".last-name"></span></td>
          </tr>
    </table>

David

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to