kirby-autoid icon indicating copy to clipboard operation
kirby-autoid copied to clipboard

kirbytag

Open flokosiol opened this issue 9 years ago • 4 comments

Hey guys,

Great and very useful little plugin! I've created a kirbytag which allows you to use the autoid inside a mardown textarea as link tag, e.g. (autoid: 5 text: Linktext). If no text is given the targets page title will be used. I've tested it in a multi-language environment and also with c::set('autoid.type', 'hash');

What do you think?

Regards, Flo.

flokosiol avatar Jan 07 '16 07:01 flokosiol

Hey Flo,

that's actually a clever idea and good use case for unique ids! But we also see some challenges here:

  1. You would have to know the id of the page you're referencing to. Unlike with images you can't just drag & drop the pages from the sidebar. But while it's inconvenient, of course it's not a deal breaker.
  2. Kirbytags are supposed to live inside the /site/tags folder as separate .php files. Placing the tag inside the plugin does work, but it's not very clean. In this case it would probably better to split it up into a dedicated kirby tag.

Targoran avatar Jan 12 '16 23:01 Targoran

Thanks for your answer.

Do you want to implement the code in a separate file, so the user can drop it into the site/tags folder? In this case I would create a new pull request.

If you want to keep your plugin clean and don't want to implement it at all – no problem. Just give me a short reply. Thanks.

flokosiol avatar Jan 14 '16 12:01 flokosiol

For now we want to keep the plugin clean, but we're planning on extending the plugin and split it into a plugin and a tag file which will allow us to do more cool stuff. So we might come back to your solution as well :)

Targoran avatar Apr 01 '16 10:04 Targoran

Hey @Targoran,

regarding challenge 1 I might have a solution.

My Enhanced Textarea field has a pagelink button that lists all pages. I could simply add a "data-id" tag to the link so something like (id: 32 text: Contact) could be inserted.

The field is still work in progress, but I think this would make it way easier to link to pages. Especially with an ID.

medienbaecker avatar Apr 26 '16 22:04 medienbaecker