This might be a silly question since I don’t have a lot of experience, but is there a way to insert a line break to a text property that acts as link in Dataview? The idea is to display titles in the top line and subtitles in the bottom line. To clarify, here’s what I have…
… and here’s what I want to achieve.
I’ve asked ChatGPT, but none of its suggestions work, and I couldn’t find anything about this topic in the forum.
How do you use this property? What generated the cards that we see in your example?
I’m thinking that if that’s a link you could possibly rebuild the link and split the display text of the link on the colon or similar. The solution would however be dependent on your actual setup, so please share a little bit more on that.
This an untested query, but does it produce anything usable?
```dataview
TABLE WITHOUT ID
("![](" + game_art + ")") as Art,
parts[0] + "<br>" +
link(file.name, slice(parts, -1)) as Title
FROM "Media Library/Games"
FLATTEN list(split(game_title, ":")) as parts
SORT game_code asc
```
The idea is to split the game_title on the colon into a separate parts list, and then assume that the first part is the “series” name, and present that on the first line, add a line break, and then the link to the “episode” name using the remaining parts. If you’d like to link the first one you could repeat the link( .... ) stuff around that part as well.
I just tested your query and it’s almost what I want. It has the downside of duplicating the titles of objects with no subtitle.
However, after tinkering with it a bit, I’ve reached a solution. Replacing parts[0] + "<br>" + link(file.name, slice(parts, -1)) with link(file.name, slice(parts, 0)), I obtain the following, which is exactly what I want.
I preserved the colon in the title by using a special white space character (U+2800) instead as the separator.
You could have circumvented the duplication with doing something like choice(length(parts) = 1, ..., ...) too presenting two different links depending on the presence of the colon or not. In any case, happy you found a way to solve your issue!