zoeck Posted January 9, 2023 Share Posted January 9, 2023 Hello @bernhard, as posted in the other thread, I tried adding the Latte Tracy Bar to RockFrontend. Just Added this to the RockFrontend.module.php: // Top of the Module add the LattePanel Class use Latte\Bridges\Tracy\LattePanel; // Add inside the "protected function renderFileLatte($file, $vars)" // After "$latte = new Engine();" add this to initialize the LattePanel if($this->modules->isInstalled("TracyDebugger")) LattePanel::initialize($latte); After that you have the LattePanel in Tracy ? I have not been able to detect any problems so far. 1 1 Link to comment Share on other sites More sharing options...
bernhard Posted January 9, 2023 Share Posted January 9, 2023 Hey @zoeck thx! I've added it to the latest version ? Only thing to mention is that this: Will result in only showing "header.latte" in the bar: In order to make it work you need to render default.latte instead of default.php: Nice! The problem here is though that we are losing nice RockFrontend features like "renderIf(...)" and there is no early exit feature in latte at the moment ? 1 Link to comment Share on other sites More sharing options...
bernhard Posted January 9, 2023 Share Posted January 9, 2023 @zoeck I wonder if it could make sense to make our own debug panel for RockFrontend that keeps track of all $rockfrontend->render() calls (and also renderIf)?! Is the latte debug panel helpful for you as is? I think for me it has more drawbacks than benefits. What are actually the benefits other than to get a list of rendered latte files? 1 Link to comment Share on other sites More sharing options...
zoeck Posted January 10, 2023 Author Share Posted January 10, 2023 10 hours ago, bernhard said: What are actually the benefits other than to get a list of rendered latte files? The panel is quite interesting if you have a latte project, with layouts, different sections etc. - This makes it easy to see which files are being used. I think I use RockFrontent differently than you do ? Actually, I mainly use the standard functions of Latte as described in the documentation, without "extensions" of RockFrontend (But I use the styles/script functions ?). Of course, this may also have something to do with the fact that I'm still using latte for the first project. What real drawbacks do you see in the panel? Apart from the fact that it doesn't fit so well with your workflow I think I need to take a closer look at the panel again Link to comment Share on other sites More sharing options...
bernhard Posted January 10, 2023 Share Posted January 10, 2023 2 hours ago, zoeck said: The panel is quite interesting if you have a latte project, with layouts, different sections etc. - This makes it easy to see which files are being used. Yeah I understand that and I agree, but I was asking for benefits other than that? I thought there are maybe other benefits as well ? 2 hours ago, zoeck said: I think I use RockFrontent differently than you do ? Actually, I mainly use the standard functions of Latte as described in the documentation, without "extensions" of RockFrontend (But I use the styles/script functions ?). I'm always happy to hear that (1) anybody is using my modules at all and even better (2) if they are using it differently and (3) share their findings so that I can see other approaches ? I could use {include ...} instead of $rockfrontend->render(...), but the non-existing early exit is really a show-stopper for me. Do you have any other approach to that? 2 hours ago, zoeck said: What real drawbacks do you see in the panel? Apart from the fact that it doesn't fit so well with your workflow I don't see a drawback with the panel (that's why I added it). It's just the missing renderIf() or early exit feature that I lose when using {include ...}. But using {include ...} is necessary to get a meaningful latte panel. 2 hours ago, zoeck said: I think I need to take a closer look at the panel again I'm looking forward to hearing what you find out ? 1 Link to comment Share on other sites More sharing options...
zoeck Posted January 10, 2023 Author Share Posted January 10, 2023 55 minutes ago, bernhard said: I could use {include ...} instead of $rockfrontend->render(...), but the non-existing early exit is really a show-stopper for me. Do you have any other approach to that? I honestly haven't even been thinking about it, but I actually had a case where I used this - without "renderIf". But this is actually more of a workaround, as I simply include an empty latte file (the "blank.latte" file is displayed in the Tracy Panel) {include $pages->find("template=test")->count() ? "test.latte" : "blank.latte"} I think that is "a bit renderIf" in latte syntax ? Two templates have to be specified at all times, otherwise an error will be displayed. It would be very cool if it would also work with a single template... 1 hour ago, bernhard said: but I was asking for benefits other than that? I think currently you only have this benefit ? 1 Link to comment Share on other sites More sharing options...
bernhard Posted January 10, 2023 Share Posted January 10, 2023 Thx @zoeck https://github.com/nette/latte/issues/287#issuecomment-1377083605 1 Link to comment Share on other sites More sharing options...
zoeck Posted January 12, 2023 Author Share Posted January 12, 2023 On 1/10/2023 at 10:27 AM, bernhard said: It's just the missing renderIf() or early exit feature that I lose when using {include ...}. But using {include ...} is necessary to get a meaningful latte panel. Looks like there is an exitIf node now ? But it seems there will be no include with condition and only one template ? {if $foo == 'bar'}{include 'somefile.latte'}{/if} 1 Link to comment Share on other sites More sharing options...
bernhard Posted June 6, 2023 Share Posted June 6, 2023 Hey @zoeck I've updated an older site to the latest version of RockFrontend (+116 commits ? ) and got this error, which is caused by the LattePanel: The API docs say that ::initialize is deprecated: https://api.nette.org/latte/master/Latte/Bridges/Tracy/LattePanel.html But no idea why this is a problem on this installation since all other projects are also running on php8.1 and don't complain? Any ideas? Link to comment Share on other sites More sharing options...
zoeck Posted June 7, 2023 Author Share Posted June 7, 2023 23 hours ago, bernhard said: Any ideas? Currently, I barely use Processwire for the frontend, since I am implementing a larger project with vue.js when i have some time, i will have a look at the problem with the tracy panel. 1 Link to comment Share on other sites More sharing options...
bernhard Posted June 7, 2023 Share Posted June 7, 2023 It's already fixed on the dev branch, I asked for help in the nette forum, thx ? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now