Open flokosiol opened 8 years ago
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.
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.
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 :)
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.
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 withc::set('autoid.type', 'hash');
What do you think?
Regards, Flo.