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

Feature Request: Command for getting page title via the block uid #119

Open
MarketHubb opened this issue Jul 13, 2024 · 1 comment
Open

Comments

@MarketHubb
Copy link

Issue:

Several commands, such as <%BLOCKMENTIONS%> and <%CHILDREN%>, have parameters for choosing the output format which includes {page}. However, to my knowledge, no existing command allows you to take a block uid and return the page title it was found on.

Example:

Say I wanted to find all instances of the tag client nested under tag/attribute type in my graph.

I can use <%BLOCKMENTIONS%> to find all instances of client, then <%REPEAT%> to run a callback to query if the <%PARENT%> of the <%ITERATIONVALUE%> contains the tag type.

However, I'm left with a collection of block uids, and no way to return the page titles those block uids were found on.

Current (hacky) solution

Currently, this can be worked around by creating a Query Builder table and returning the column containing the page, but I don't believe this can be done strictly via SB commands.

Proposed solution

The getPageTitleByBlockUid function already exists in the roamjs-components package. A command that hooks into this existing function would return the page title of a given uid

@MarketHubb MarketHubb changed the title Feature Request: Command for getting page title from Block UID Feature Request: Command for getting page title via the block uid Jul 13, 2024
@dvargas92495
Copy link
Collaborator

May be able to do this with <%BREADCRUMBS:+((blockuid))%>. The + before the block uid filters out the non-page title elements of the BREADCRUMBS

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

No branches or pull requests

2 participants