Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by maetmar

  1. Hi @bernhard, I realized that RockFrontend is adding "<div edit=title hidden>title</div>" before the closing body tag, because of line 260 in RockFrontend.module.php (faketag) Is this used for Alfred? And if yes, is there a way to only output this if Alfred is actually used? Thanks for checking
  2. Hi, I have two users. One is an admin (myself) and then a "normal" user, which is my customer using the backend to edit content. In my templates, I have one field "layout_options", which is from type "select options" where I can toggle with checkboxes the visibility of some other fields (headlines, texts, images, etc.). On those other fields I, which I want to toogle with this switch, I simply use this feature described here: https://processwire.com/docs/fields/dependencies/ This all works fine and looks like the following screenshot. I actually use this to prepare the available elements in a repeater matrix block and I also use it in the template files to check if a specific layout option should be dispalyed or not. Later the actual content should be entered by the user, who is not an admin. To avoid that the user changes the "layout options", I want to hide or better just make this "layout_options" field "read-only" for the normal user. This is to prevent he is messing around with the layouts and add stuff, which he is not supposed to do. It also works to do this by using the respsective settings in the access control of the field "layout_options". However, and now I come to my issue, when I do this and hide it or make it read-only, then also the field dependencies donΒ΄t work properly anymore - see below: I played around with all settings in the access control for the field "layout options", but nothing works. Any idea how to solve this? thanks
  3. @bernhard, still the same behaviour. I get the error whenever I am not loged into the backend or I open whenever I open the page in an incognito browser window (tested with chrome). When I am loged in and view the frontend in another tab it works fine. I tried it on two different installations of processwire and both have the same behaviour. ItΒ΄s not a big issue, as I use livereload anyway only during develoment of a new site and it should anyway be turned off once the page is live.
  4. in a nutshell. if you are loged in in the backend as an admin then it works and otherwise you get the error message mentioned above.
  5. this is what I was able to find out, I hope it helps if an admin is loged in the backend and you have another tab open with the frontend --> no issue if an admin is loged in the backend and you have another inqognito window open with frontend --> error if no one is loged intp the backend and you have any session open with frontend --> error
  6. Hi @bernhard, I found an issue with the livereload feature. When enabled, I get the following error message in chrome development console: "EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection." https://stackoverflow.com/questions/53591954/eventsources-response-has-a-mime-type-text-html-that-is-not-text-event-str It is reproducable, as soon as livereload is turned off, the error message is gone. The message is not causing any issues, as far as I can tell, but I was spending now a lot of time just to find out it was caused by livereload. So maybe you can check and make sure it gets fixed.
  7. I got the Formbuilder working now with LATTE. Actually this works fine with latte: {$form} the problem was that I had to put this code into my _init.php: <?php $form = $forms->render('kontaktformular'); ?> in the documentation of the formbuilder it says put it in _init.php or on top of your template file. Firs, I put on top of my template file, which did not work, only after putting it into the _init.php it started producing output. But obviously also what Bernhard suggested worked fine.
  8. I know. My question was more in the direction if LATTE allows to execute somehow native PHP code. the LATTE tags "PHP" or "DO" donΒ΄t really seems to do the job, at least no output is generated when using those. I would like to avoid creating a new PHP file which I need to include, just to run one line of code.
  9. Now I want to add the first time the Formbuilder ProModule from Ryan together with RockFrontend latte files. One option to do this is normally you put these lines of code in your template: <?php echo $form->styles; ?> <?php echo $form->scripts; ?> <?php echo $form; ?> I somehow can not manage to get some output within a latte file. How do I properly run some PHP code within latte? I tried the below and nothing works / produces some output: {$form->scripts} {do $form->scripts} {php $form->scripts} using the tag "echo" is not allowed within latte, at least I get some exceptions. thanks again for any help / input
  10. sorrry but I am not a big help in debugging this. For now I will live with the extra |noesacpe filter. not nice but no show stopper for me.
  11. yes it worked before (Rockfrontend Version 2.1.11) without the noescape filters. When I upgrade to 2.7.1, I need to add them. there is a standard.php that has one line of code: <?= $rockfrontend->render('./standard.latte') ?> and the standard.latte looks like this now (the whole main body HTML content is rendered from ProField repater matrix): {$rockfrontend->render('includes/_head')|noescape} {$rockfrontend->render('includes/_header')|noescape} <!-- Render all Layout Blocks defined in page. Output derived from seperate output files --> {$rockfrontend->render($page->layout_blocks)|noescape} {$rockfrontend->render('includes/_footer')|noescape}
  12. adding "|noescape" fixed it. instead of: {$rockfrontend->render('includes/_head')} I used: {$rockfrontend->render('includes/_head')|noescape}
  13. Hi @bernhard, on an existing page I have upgraded to the latest version of RockFrontend. I went to settings and saved (nothing activated or whatever). Now the output for anything coming from a .latte file is "destroyed". the sourcecode of my page in the browser looks like this: &lt;!DOCTYPE html&gt; &lt;html lang="de"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; &lt;link rel="shortcut icon" href="style/images/favicon.png"&gt; &lt;title&gt;Home - Website Name&lt;/title&gt; &lt;meta name="description" content="Website Description for SEO"&gt; &lt;link rel="stylesheet" href="/processwire/site/templates//assets/css/plugins.css"&gt; &lt;link rel="stylesheet" href="/processwire/site/templates//assets/css/style.css"&gt; &lt;link rel="stylesheet" href="/processwire/site/templates//assets/css/colors/ennemoser.css"&gt; &lt;link rel="stylesheet" href="/processwire/site/templates//assets/css/custom.css"&gt; &lt;/head&gt; ...... so basically all < and > characters have now been escaped to HTML entities. was there some change in between that I missed? I call the .latte files like this: {$rockfrontend->render('includes/_head')} is this call now wrong and I need to change something? thanks
  14. PHP is for me unfortunately something that does not come very inuitive (so, I guess you know now I am by no means a hardcore developer). So itΒ΄s always time consuming with lots of trial and error to find (forum, google) code snippets that do what I want to do. Since I started using LATTE thanks to this thread and thanks to @bernhard and his RockFrontend module, it seems like a gamechanger for me. Processwire has become extremly more usefull and inutitive for me since. Thank you! I am currently rebuilding my code templates I use as starter-kits for new projects and convert them to LATTE. Does anyone have and is willing to share a skeleton template to build a nav-tree menu (mulitlevel) with LATTE? Something that produces similar HTML code like this: <ul class='navbar-nav'> <li class='nav-item active'> <a href='/processwire/' class='nav-link'>Home</a> </li> <li class='nav-item dropdown'> <a href='/processwire/kontakt/' class='nav-link dropdown-toggle'>Kontakt</a> <ul class='dropdown-menu'> <li class='nav-item'> <a href='/processwire/kontakt/kontakt-unterseite-a/' class='dropdown-item'>Kontakt Unterseite A</a> </li> </ul> </li> <li class='nav-item'> <a href='/processwire/seite-b/' class='nav-link'>Seite B</a> </li> </ul>
  15. @bernhard, I was wondering if there is a way to make the main template file understand LATTE as well and not just for the the includes. As a workaround I could move everything into include files, but maybe there is a way around that?
  16. this is one error I can see when activiating your module (I was wrong, its not related to the scripts/css tag), but still something I found: In my main template I have this entry on top: <?php /* Include Header File */ wireIncludeFile("./_header"); ?> when I now activate your module, I see the following error on the very top of the source code that is generated, although it loads and includes _header.php: <br /> <b>Notice</b>: Undefined index: func in <b>/xxxx/xxxx/processwire/wire/core/WireFileTools.php</b> on line <b>1572</b><br /> when I turn off your module, the error is gone. UPDATE: if I use your tag instead it works and I guess that is the whole point of using your module to use your render method. <?= $rockfrontend->render('./_header') ?>
  17. I did watch the video and then started to try it out, because I like what this module is able to do. Don't get me wrong. This is your module and I am not in the position and its not my intention to criticize it in any way. From what I can tell until now is that your module seems to be (or will be soon if further features are added) a bit of a "swiss army knife" for front-end development. So I just thought it would make sense to be able to turn on / off some of the features as not everyone is probably going to use all features at the same time. But again, this is your module and it's your call how it should work!
  18. thanks Bernhard, What is a bit confusing to me is the fact, that if you don't put "$rockfrontend->styles()...." into your template, it still seems to be somehow called and involved (the fact that I got the comment in the HTML for example). In fact I even got some errors because I did not have it in my template. So, If I understand you correctly, in order to not use it or turn it off, I still need to put it into the template with the option autoload = false? Wouldn't it make more sense, to just load/use it if the tag is available at all and in all other cases, it simply is ignored and turned-off by default?
  19. sorry, but I have a bit a stupid question. If I want to disable loading of styles or srcipts or turn-off debug, but how do I actually achieve this? the produced HTML says this (see below): but where do I put this exactly. Can I use the config.php in the site folder and what exactly do I need to put in? I tried a couple of things, nothing worked. <!-- DEBUG enabled! You can disable it either via $config or use $rf->scripts()->setOptions(['debug'=>false]) --> <!-- autoloading of default scripts enabled - disable using ->setOptions(['autoload'=>false]) --> what I want to achieve is to have only the autorelead and the LATTE template engine working for me. So far, I donΒ΄t need to have all other features. Maybe this can be de-/activated in the configuration of the module in the future?
  20. btw, donΒ΄t really need right now, but I realized this has the same issue with sub-folders (same for styles as well): echo $rockfrontend->scripts('body') ->add('site/templates/bundle/main.js') ->render(); ?> the URL added does not consider the sub-folders. you may want to fix this as well in your next release? thanks
  • Create New...