Static Page Usage
Static Page Usage
I have gone through the Wiki and can't seem to find the answer to my question which is...can php be used in static pages and if so how. I tried it with the code tag but all that does is show the php code. Thanks in advance.
Re: Static Page Usage
Hi,
the code tag is indeed not for executing code, just for displaying it.
Take a look at the Inline PHP plugin - but make sure to read and understand the red warning box carefully.
The better (although more complex) way is always to embed your custom PHP code into a dedicated FlatPress plugin and/or custom BBCode tags.
All the best,
Arvid
the code tag is indeed not for executing code, just for displaying it.
Take a look at the Inline PHP plugin - but make sure to read and understand the red warning box carefully.
The better (although more complex) way is always to embed your custom PHP code into a dedicated FlatPress plugin and/or custom BBCode tags.
All the best,
Arvid
Project blogββ Docsββ Twitterββ Mastodonββ Forum RSS feedββ Project blog RSS feedββ Donate
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
Re: Static Page Usage
Thank you Arvid...perhaps it will be better to generate my own plugin once I find out how to make my own plugin. Baby steps...
Re: Static Page Usage
Don't worry, it's no rocket science, not at all
Start with the custom BBCode example, it's basically all you need to have a) your first own plugin that comes b) with your first own BBCode tag.
In the plugin_custombbcode_acronym() callback function that is called whenever a "acronym" tag is being parsed, you can return anything you like - for example, the output of the PHP code you wish to include.
If that works out, change the tag name from "acronym" to something more fitting, and play around with the other options in plugin_custombbcode_tags(). This is exactly how I started coding for FlatPress back in the days
All the best,
Arvid
Start with the custom BBCode example, it's basically all you need to have a) your first own plugin that comes b) with your first own BBCode tag.
In the plugin_custombbcode_acronym() callback function that is called whenever a "acronym" tag is being parsed, you can return anything you like - for example, the output of the PHP code you wish to include.
If that works out, change the tag name from "acronym" to something more fitting, and play around with the other options in plugin_custombbcode_tags(). This is exactly how I started coding for FlatPress back in the days
All the best,
Arvid
Project blogββ Docsββ Twitterββ Mastodonββ Forum RSS feedββ Project blog RSS feedββ Donate
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
Who is online
Users browsing this forum: No registered users and 98 guests