I have been sitting at a custom tag to somewhat simplify and customize some internal linking towards related pages to reference in blog articles for example…
while trying to access the site() object within the tag, i found myself that my local server became very unresponsive thus not loading pages anymore until i changed the code…
I have taken the approach linked there using
$var = kirby()->site();
as well as somewhat accessing
<?php
kirbytext::$tags['relate'] = array(
'html' => function($tag) {
$output = null;
$s = kirby()->site();
// UID = $Tag
if($s->find($tag)){
$p = $s->find($tag);
// ... some more other stuff...
but my browser window, as well as the actual loading seems weird. Firefox Developer Edition is somewhat “flashing up” at the top bar and becoming unresponsive. Chrome says site is not reachable instead of giving any kind of whoops error.
yeah. the refinement won’t stop there. i just happened to run into the problem so i focused on fixing it leaving everything super dirty with some dummy code. makes it easier to understand and debug (for me)