Adding server sides includes

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
Lee
Posts: 16
Joined: Tue Jul 05, 2022 1:59 am

Adding server sides includes

Post by Lee » Wed Jul 20, 2022 9:00 pm

Is it possible to add server side includes in FlatPress? I want to add some social media buttons. I couldn't find a plugin for this. Any suggestions?

eagleman
Posts: 92
Joined: Sat Mar 02, 2019 12:10 pm

Re: Adding server sides includes

Post by eagleman » Thu Jul 21, 2022 10:07 am


User avatar
Arvid
FlatPress Coder
Posts: 414
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: Adding server sides includes

Post by Arvid » Thu Jul 28, 2022 1:51 pm

Helpful FlatPress links: Project blog ๐Ÿ“ - FlatPress wiki ๐Ÿ“– - FlatPress@Twitter ๐Ÿฆ - FlatPress@Mastodon ๐Ÿ˜
Stay up to date with our feeds: Forum RSS feed ๐Ÿ“œ - Project blog RSS feed ๐Ÿ“œ
Feel free to say Thank you: Donate โค๏ธ

๐Ÿ‡ฉ๐Ÿ‡ช Fรผr meinen Arbeitgeber in Bochum habe ich zwei Stellen zu besetzen: Junior-Systemadministrator, Ausbildung zum Fachinformatiker Systemintegration ๐Ÿ‡ฉ๐Ÿ‡ช

Lee
Posts: 16
Joined: Tue Jul 05, 2022 1:59 am

Re: Adding server sides includes

Post by Lee » Fri Aug 19, 2022 6:59 pm

Yes, that's it!

User avatar
Arvid
FlatPress Coder
Posts: 414
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: Adding server sides includes

Post by Arvid » Sun Oct 02, 2022 11:15 am

I do not think SSI will work with FlatPress. In FlatPress, the HTML of the page is contained in template files (.tpl) that are being processed by the Smarty engine (which itself is a PHP program). So the web server isn't serving any HTML files directly to the client; technically, it just serves the output FlatPress' index.php is creating (which, with the help of Smarty, reads the template files and fills them with dynamic content).

But: I never tested this. If your web server has SSI activated, just give it a try, and simply add some SSI code to a template file, for example fp-interface/sharedtpls/login.tpl:

Code: Select all

<!-- some SSI: -->
<!--#echo var="DATE_LOCAL" -->
<!-- SSI end -->
{include file=shared:errorlist.tpl}

<form id="login" method="post" action="{$smarty.const.BLOG_BASEURL}login.php" enctype="multipart/form-data">
	<fieldset><legend>{$lang.login.fieldset1}</legend>
	<p><label for="user">{$lang.login.user}</label><br />
(...)
Then proceed to your Admin Area login: If the current date is being displayed above the login form, you're good to go! :)

All the best,
Arvid
Helpful FlatPress links: Project blog ๐Ÿ“ - FlatPress wiki ๐Ÿ“– - FlatPress@Twitter ๐Ÿฆ - FlatPress@Mastodon ๐Ÿ˜
Stay up to date with our feeds: Forum RSS feed ๐Ÿ“œ - Project blog RSS feed ๐Ÿ“œ
Feel free to say Thank you: Donate โค๏ธ

๐Ÿ‡ฉ๐Ÿ‡ช Fรผr meinen Arbeitgeber in Bochum habe ich zwei Stellen zu besetzen: Junior-Systemadministrator, Ausbildung zum Fachinformatiker Systemintegration ๐Ÿ‡ฉ๐Ÿ‡ช

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest