Skip to content

Not returning to parent folder #1147

Answered by Zachatoo
OofMon2301 asked this question in Help
Discussion options

You must be logged in to vote

So instead of getting the parent folder, you want to go two levels up, correct?

Instead of

<% tp.file.folder(true).split('/').pop() %>

you can do

<% tp.file.folder(true).split('/')[2] %>

The [2] will get the third folder from the root of the vault, since JavaScript arrays have zero based indices. You can do whatever level folder you want, just minus one to get the level you want.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by OofMon2301
Comment options

You must be logged in to vote
3 replies
@Zachatoo
Comment options

@OofMon2301
Comment options

@Zachatoo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants