Is it possible to line break a text property?

Hey everyone.

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…

image

… and here’s what I want to achieve.

image

I’ve asked ChatGPT, but none of its suggestions work, and I couldn’t find anything about this topic in the forum.

Thanks in advance.

When I need line breaks, I use the html <br> tag. Just place it wherever you want the break. For example…

---
title: THE DARK SIDE DETECTIVE:<br>A FUMBLE IN THE DARK
---

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 how I obtain a gallery view of objects:
image

And these are the properties of one of the objects used as an example:
image

The title doesn’t require quotation marks because I use modifier letter colons.

I can insert a line break using Shift + Enter on the file properties side panel, but in doing so, the link to the object breaks:
image

This doesn’t seem to work on my end :confused:

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.

1 Like

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.

image

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.

image

I preserved the colon in the title by using a special white space character (U+2800) instead as the separator.

Thank you so much for your help! Happy holidays!

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!

1 Like