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

Demo plugin (where lf_stuff field is displayed ?) #2000

Open
bonnebulle opened this issue Jul 3, 2023 · 11 comments
Open

Demo plugin (where lf_stuff field is displayed ?) #2000

bonnebulle opened this issue Jul 3, 2023 · 11 comments
Labels
bug it's broken! help-wanted help-wanted plugin bells and whistles
Milestone

Comments

@bonnebulle
Copy link

bonnebulle commented Jul 3, 2023

Hello, I try the demo_plugin
https://github.com/shaarli/Shaarli/tree/master/plugins/demo_plugin
Am working around render_editlink and edit_link_plugin
https://links.portailpro.net/doc/Plugin-System.html#render_editlink

In the demo_plugin, lf_stuff is well saved
but the demo_plugin dont help me to integrate it !
Where the content of this field lf_stuff is showing up ?

Thanks

@nodiscc
Copy link
Member

nodiscc commented Jul 3, 2023

Where the content of this field lf_stuff is showing up ?

It's not displayed anywhere, as far as I remember. The demo plugin only gives an example of how to add a custom field to the editlink dialog/datastore entries. I agree that it could be improved/include an example of how to render the value of the vield somewhere in the page.

What are you trying to achieve exactly?

@nodiscc nodiscc added plugin bells and whistles documentation tools developer tools support installation and configuration issues labels Jul 3, 2023
@nodiscc nodiscc added this to the backlog to the future milestone Jul 3, 2023
@bonnebulle
Copy link
Author

Yes, you get my point !
Here, in a Demo, the field should be ready to use (showing as final output, maybe in the shaarli description).
A short explanation about how to do the final integration should help.
Me, I can figure how to do this, but not every body !
Thanks, amazing work !

@nodiscc
Copy link
Member

nodiscc commented Jul 4, 2023

Me, I can figure how to do this, but not every body

Feel free to send a pull request that improves the demo plugin/shows how to display the content of lf_stuff somewhere in the linklist.

@bonnebulle
Copy link
Author

bonnebulle commented Jul 16, 2023

Thanks, I will do in the future...
But, for now, my problem is : the demo field doesn't works, not saving.

In past...
I was on Shaarli 0.11.1 and all the demo was ok ; lf_stuff was saved
now...
I am on 0.12.1
When I add some text into the demo field (edit mod) and save it (publish a shaare)...
When I come back the field is empty.

EDIT : I notice, the demo field in /admin/plugins page is working ok (saving)

I try with 2 hosted versions of Shaarli (new ones, different dockers images)
First :
ghcr.io/shaarli/shaarli:latest
Second :
e2jk/shaarli-armhf:latest

What can I do to find the bug, can I help ?
I will try do my own plugin following the rules of the art.
Thanks

@nodiscc nodiscc added the help-wanted help-wanted label Jul 20, 2023
@nodiscc nodiscc modified the milestones: backlog to the future, 0.13.0 Jul 20, 2023
@nodiscc
Copy link
Member

nodiscc commented Nov 15, 2023

Related (or duplicate?) #1808

@bonnebulle
Copy link
Author

Yes, looks the same !
Will maybe fix in the v14 :)
Can I help ?

@nodiscc
Copy link
Member

nodiscc commented Nov 30, 2023

Can I help ?

I think it needs to be reimplemented from scratch, since so much has changed between v0.11.1 and v0.12.2 (457 changed files with 46,990 additions and 17,068 deletions). The Bookmark object was introduced in v0.12 (336a28f) and I think it never implemented saving keys other than the default/built-in ones (id, shorturl, url, title, description, thumbnail, sticky, created, updated, private).

But there is now an additionalContent key for each Bookmark (added in bf8bec3) which could help standardize where plugins save their custom data.

@nodiscc nodiscc added bug it's broken! and removed documentation tools developer tools support installation and configuration issues labels Nov 30, 2023
@SansGuidon
Copy link

Can I help ?

I think it needs to be reimplemented from scratch, since so much has changed between v0.11.1 and v0.12.2 (457 changed files with 46,990 additions and 17,068 deletions). The Bookmark object was introduced in v0.12 (336a28f) and I think it never implemented saving keys other than the default/built-in ones (id, shorturl, url, title, description, thumbnail, sticky, created, updated, private).

But there is now an additionalContent key for each Bookmark (added in bf8bec3) which could help standardize where plugins save their custom data.

Hi @nodiscc I'm trying to make a plugin to change / append tags to links we save, do I understand the tags attribute is no longer editable by plugins? So the online docs related to plugins author is obsolete?

@nodiscc
Copy link
Member

nodiscc commented Nov 14, 2024

do I understand the tags attribute is no longer editable by plugins?

It is still editable. What does no longer appear to work, is adding custom fields such as the lf_stuff field shown in the demo plugin.

@SansGuidon
Copy link

Thank you @nodiscc, not things work for me :-) and it's quite incredible to see what we can build through Shaarli plugin system.
In the end based on the youtube plugin for Shaarli I could see the error in my code. I was treating tags as an array which was big part of my struggle. Maybe some examples would help in the docs.
Also I thought that based #2000 (comment) , the 'tags' attribute was not editable out of the box as it was not in the list.

@nodiscc nodiscc modified the milestones: 0.14.0, 0.15.0 Nov 15, 2024
@nodiscc
Copy link
Member

nodiscc commented Nov 15, 2024

Duplicate of #1808 but leaving this issue opened to have a look at the demo plugin and related docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug it's broken! help-wanted help-wanted plugin bells and whistles
Projects
None yet
Development

No branches or pull requests

3 participants