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: 175
Joined: Sat Mar 02, 2019 12:10 pm

Re: Adding server sides includes

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



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: 558
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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 39 guests