Page 1 of 1

Adding server sides includes

Posted: Wed Jul 20, 2022 9:00 pm
by Lee
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?

Re: Adding server sides includes

Posted: Thu Jul 21, 2022 10:07 am
by eagleman

Re: Adding server sides includes

Posted: Thu Jul 28, 2022 1:51 pm
by Arvid

Re: Adding server sides includes

Posted: Fri Aug 19, 2022 6:59 pm
by Lee
Yes, that's it!

Re: Adding server sides includes

Posted: Sun Oct 02, 2022 11:15 am
by Arvid
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