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

Pass url params to defineObjectMarker #71

Open
smelukov opened this issue Nov 3, 2020 · 1 comment
Open

Pass url params to defineObjectMarker #71

smelukov opened this issue Nov 3, 2020 · 1 comment

Comments

@smelukov
Copy link
Member

smelukov commented Nov 3, 2020

Want to use defineObjectMarker like:

defineObjectMarker('package', {
        page: 'package',
        ref: 'id',
        title: 'name',
        params: { instance: 'instance.path' }
})
@lahmatiy
Copy link
Member

lahmatiy commented Nov 3, 2020

To solve this problem, I thought to use a special parameter href, which allows you to set the link generation function like so:

defineObjectMarker('package', {
        page: 'package',
        ref: 'id',
        title: 'name',
        href: (page, ref, object) => `#${page}:${ref}&instance=${instance.path}`
})

On the other hand, I see it's a source of bugs, e.g. all the values need to be escaped.

Also I not sure you use this feature right. Let's take a closer look at what you have and what you want to get?

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