discovery icon indicating copy to clipboard operation
discovery copied to clipboard

Pass url params to defineObjectMarker

Open smelukov opened this issue 5 years ago • 1 comments

Want to use defineObjectMarker like:

defineObjectMarker('package', {
        page: 'package',
        ref: 'id',
        title: 'name',
        params: { instance: 'instance.path' }
})

smelukov avatar Nov 03 '20 09:11 smelukov

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?

lahmatiy avatar Nov 03 '20 22:11 lahmatiy