rss-bridge icon indicating copy to clipboard operation
rss-bridge copied to clipboard

Custom header / footer

Open JohnDarkhorse opened this issue 6 years ago • 4 comments

I am trying to figure out how to add an analytics tracker to the code, but all attempts end with the site not loading any more.

Could a facility for a custom header & footer be added so those of us who are not so sharp with the PHP could add our custom code?

TIA

If no, maybe a wiki page could be written that explains how to do it with the current code.

JohnDarkhorse avatar Aug 24 '19 18:08 JohnDarkhorse

For the moment, there is indeed no way to include custom values in RSS-Bridge other than modifying the source code yourself.

teromene avatar Sep 07 '19 16:09 teromene

I made a PR to add support for Google Analytics to the main page and HTML format. Please have a look and let me know what you think.

logmanoriginal avatar Dec 04 '19 18:12 logmanoriginal

There is currently no support for this. So we should reconsider this. Multilines in config.ini seems bad but perhaps a config customer_header = custom_header.html?

dvikan avatar Mar 27 '22 00:03 dvikan

You can find a reference implementation for Google Analytics in #1382. This can be made an abstract interface to support different analytics APIs and to avoid issues related to GDPR and ePrivacy regulations (which I believe we are not fully compliant with right now).

That said, the benefit of this is very questionable as it only works on HTML pages while most of the requests are processed in PHP and returned in the form of feeds. If you want insight into the actual feeds being requested, a more elaborate solution is needed.

logmanoriginal avatar Mar 27 '22 07:03 logmanoriginal

this can now be solved like this:

diff --git a/templates/base.html.php b/templates/base.html.php
index ca31823d..25c6bc5f 100644
--- a/templates/base.html.php
+++ b/templates/base.html.php
@@ -25,6 +25,10 @@
 
         <?= raw($page) ?>
     </div>
+
+    <footer>
+        <!-- insert custom code here -->
+    </footer>
 </body>
 </html>

dvikan avatar Jul 06 '23 19:07 dvikan