Skip to content

Allow pre-filling tags in new bookmark form#1060

Merged
sissbruecker merged 2 commits into
sissbruecker:masterfrom
dasrecht:feat-allow-tag-querystring
May 17, 2025
Merged

Allow pre-filling tags in new bookmark form#1060
sissbruecker merged 2 commits into
sissbruecker:masterfrom
dasrecht:feat-allow-tag-querystring

Conversation

@dasrecht

@dasrecht dasrecht commented May 8, 2025

Copy link
Copy Markdown
Contributor

Hi there 👋

I'm moving from another comparable system to linkding and realized that I can't set the bookmarks in custom bookmark snippets. This PR reads tag_string from the GET requests, allowing to pre-fill tags.

Hope that is ok to add it like I've done in the PR. Let me know if there's also some documentation that needs to be amended.

/dasrecht

@sissbruecker sissbruecker changed the title feat - Allow tag_string as query for BookmarkForm in order to set tags via bookmark snippets Allow pre-filling tags in new bookmark form May 17, 2025
@sissbruecker

Copy link
Copy Markdown
Owner

Makes sense, changed the parameter name to tags though.

@sissbruecker sissbruecker merged commit f2800ef into sissbruecker:master May 17, 2025
@jk

jk commented May 21, 2025

Copy link
Copy Markdown

By the way, I've modified the bookmarklet to also pre-fill a couple of the other fields:

javascript:(function () {
    let w = 580;
    let h = 780;
    let l = Math.floor((screen.width - w) / 2);
    let t = Math.floor((screen.height - h) / 2);
    let u = encodeURIComponent(location.href);
    let s = encodeURIComponent(getSelection().toString());
    let ti = encodeURIComponent(document.title);

    let lnk = `https://linkding.example.tld/bookmarks/new?url=${u}&description=${s}&title=${ti}&auto_close#id_tag_string`;

    window.open(lnk, "Bookmarklet", `width=${w},height=${h},left=${l},top=${t}`);
})();

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

Successfully merging this pull request may close these issues.

3 participants