Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsidian Dynamic Data Block - HTML rendered as TEXT instead of as HTML #6195

Closed
2 tasks done
treusch opened this issue Feb 24, 2025 · 2 comments
Closed
2 tasks done

Comments

@treusch
Copy link

treusch commented Feb 24, 2025

Description

The obsidian dynamic data block renders HTML returned in a SQL query as TEXT instead of rendering the HTML. The only choices under "Column Configuration", in the column field types, are Text, Boolean, Currency, Date, Date Time, Number and Person. There needs to be an HTML option and the block needs to render the HTML the same way the original block used to when we couldn't designate the column field types.

Image

I created this page on the demo site containing an example of using the regular dynamic data entry block and how the buttons appear correctly. It that same query is used in a version that contains the obsidian dynamic data block, you'll see that the buttons are just rendered as html text.

NOTE: I had to check the box indicating that I was able to reproduce the issue on a fresh install or on the demo site. I was only able to reproduce on a fresh install because the demo site does not currently have the obsidian dynamic data block available.

Actual Behavior

SQL Query returns HTML that gets rendered as text instead of as HTML. (i.e. when wanting to include a button in the resulting rows)

Image

Expected Behavior

The block would render the HTML the same way the old block did.

Steps to Reproduce

  • Add both the Obsidian Dynamic Data block and the original Dynamic Data blocks to a page.
  • Create a SQL query that returns data including at least one column as HTML that would be for a button to appear in that column.
  • Put that query in both blocks in the SQL Query block setting
  • You will see that the Obsidian block just has the text value of the HTML where the old block will actually have a functioning button in that column.

Example query:

SELECT Id, CONCAT(p.FirstName, ' ', p.LastName) as PersonName
    , '<a class="btn" href="/Person/'  + CAST(p.[Id] AS NVARCHAR(MAX)) + '/contributions" target="_blank" rel="noopener noreferrer"><i class="fas fa-money-bill-alt"></i></a>' AS [ContributionsTab]
    , '<a class="btn" href="/Person/'  + CAST(p.[Id] AS NVARCHAR(MAX)) + '/extendedattributes" target="_blank" rel="noopener noreferrer"><i class="fas fa-info"></i></a>' AS [ExtendedAttributesTab]
FROM Person p

Issue Confirmation

  • Perform a search on the Github Issues to see if your bug or enhancement is already reported.
  • Reproduced the problem on a fresh install or on the demo site.

Rock Version

16.6

Client Culture Setting

en-US

@chead4
Copy link

chead4 commented Feb 24, 2025

@treusch Hi Tina - I am happy to share that an HTML column type has been added to the Dynamic Data obsidian block and will be available in v17 with this commit.

@treusch
Copy link
Author

treusch commented Feb 24, 2025

Thanks @chead4 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants