Creating A Plugin

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
User avatar
WineMan
Posts: 106
Joined: Tue Sep 01, 2020 5:03 pm

Creating A Plugin

Post by WineMan » Tue Sep 13, 2022 3:10 pm

I'm having trouble understanding the concept of creating a plugin. How does it work exactly. Do I create a static page (widget) and then upload that to the plugin folder? How do I get it to show in the plugin list so that I can then add it to the right hand panel in the blog? Looking for some guidance.

User avatar
fraenkiman
Posts: 210
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Creating A Plugin

Post by fraenkiman » Wed Sep 14, 2022 7:32 pm

Hello Wineman,

it depends on what your new plugin needs to be able to do - e.g. B. display something in the admin panel or just be present in the FlatPressblog - here it depends on the requirements.

I don't look 100% behind how to create a new plugin+widget. This is due to my lack of PHP knowledge.

Maybe you can tell me what you're up to and what the requirements are.

Then you could look at an existing plugin that is similar and use it as a template for a new one.
As an example, look at the GoTop plugin with an editor. The plugin is very simple and you can see how it works.

It is helpful to know which variables FlatPress supports and what they are for.
Unfortunately the documentation is incomplete. But I'm sure that Arvid will support us with concrete ideas.

I'm still working on the Webshare API myself to create a plugin for it.

Tell us more and together we will see how it can be implemented.

Best regards from Berlin
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

User avatar
WineMan
Posts: 106
Joined: Tue Sep 01, 2020 5:03 pm

Re: Creating A Plugin

Post by WineMan » Wed Sep 14, 2022 9:32 pm

Thanks for your response and glad to see that help is nearby.

What I am looking for is to develop something similar to your Coffee Cash Register (although not as a donation widget)...something that I can add to the right hand panel of a FlatPress site.

Some of the questions I have:
  • How does a static page become a widget
  • How do you add a static page to a blockparser plugin
I look forward to any assistance/clarification and thank you in advance.

User avatar
fraenkiman
Posts: 210
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Creating A Plugin

Post by fraenkiman » Thu Sep 15, 2022 7:49 pm

Hello VineMan.
No new plugin is required for this.

Create a static page in the admin menu in the chosen way - e.g.:

Code: Select all

[list]
[*]Description
[*][html]<img src="fp-interface/themes/leggero/preview.png" alt="preview" style="width:180px">[/html]
[*][url="fp-interface/themes/leggero/preview.png"]Link to Image[/url]
[*][url="static.php?page=about"]Link to Static-Page "about"[/url]
[/list]
Once you've published the page, go to widgets->BlockParser Widgets in the admin center. Here you can then decide which static pages are offered to you as a widget and which are not.

Image

Then you can drag and drop the static page into the right menu in the admin center in the Widgets->Manage Widgets menu.

Image

The result from my example looks something like this

Image

That's it.

Best regards
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

User avatar
WineMan
Posts: 106
Joined: Tue Sep 01, 2020 5:03 pm

Re: Creating A Plugin

Post by WineMan » Thu Sep 15, 2022 8:53 pm

Thanks again for your help, fraenkiman.

"Once you've published the page, go to widgets->BlockParser Widgets in the admin center. Here you can then decide which static pages are offered to you as a widget and which are not."

This sentence in your response has made all the difference for me. I had not seen it in the admin pages. I think I now understand how it all works and look forward to enhancing my site. I will check back if I have any further questions.

User avatar
fraenkiman
Posts: 210
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Creating A Plugin

Post by fraenkiman » Thu Sep 15, 2022 9:19 pm

Great!

I'm looking forward to the finished result. If you like, you can present your finished blog here and here for other people interested in FlatPress.

A restful night
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io


Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests