bernhard Posted September 9, 2023 Share Posted September 9, 2023 I'm thinking of removing ALFRED from RockFrontend. Is anybody at all using it in any projects?? Link to comment Share on other sites More sharing options...
MarkE Posted September 9, 2023 Share Posted September 9, 2023 I'm using it in a couple of places on one site, but I guess I could revise to the usual FEE. 1 Link to comment Share on other sites More sharing options...
gornycreative Posted September 21, 2023 Share Posted September 21, 2023 I use functions from it all the time to provide pop-up access to matrix fields from the front-end. 1 Link to comment Share on other sites More sharing options...
imandreas Posted October 25, 2023 Share Posted October 25, 2023 Hi, I'm just starting trying to use Alfred, it looks like, as it is the only way to provide frontend editing using the HTML markup of the fields from backend. Right now it is working as logged in with admin, but it should work also for editors on frontend. I hope to have it ready soon. Since it is not working on frontend with editor permissions, I'll just post here my problems: In console of the browser there is the log console.log("Loading jQuery..."); jQuery not found The access / Role is already granted to "rockfrontend-alfred". By the way, it is fantastic, that alfred is so flexible and can be limited to specific fields of a template!!! Link to comment Share on other sites More sharing options...
imandreas Posted October 25, 2023 Share Posted October 25, 2023 It is working now for admin on frontend as well as for editors with granted access. But for any reason for the admin is showing in modal view, for editor it is opening the PW backend. Is there a way to configure this behaviour ? Link to comment Share on other sites More sharing options...
bernhard Posted October 25, 2023 Author Share Posted October 25, 2023 Ok so ALFRED will stay in RockFrontend, thx for letting me know @gornycreative and @MarkE 47 minutes ago, imandreas said: But for any reason for the admin is showing in modal view, for editor it is opening the PW backend. Is there a way to configure this behaviour ? That's not intentional behaviour and I've never experienced something like this. If you provide instructions on a fresh installation with step by step guide to reproduce the issue I can have a look into it. 1 Link to comment Share on other sites More sharing options...
imandreas Posted October 26, 2023 Share Posted October 26, 2023 I'm trying to check it out on a clean installation @bernhard, but unfortunately the linked documentation from the module is not available anymore: https://www.baumrock.com/modules/rockfrontend/docs Maybe you can restore it? Link to comment Share on other sites More sharing options...
bernhard Posted October 26, 2023 Author Share Posted October 26, 2023 Thx @imandreas the docs are restored here: https://www.baumrock.com/en/processwire/modules/rockfrontend/docs/ 1 Link to comment Share on other sites More sharing options...
netcarver Posted April 9 Share Posted April 9 @bernhardI've been trying to get Alfred working on my local ddev stack - but have failed so far. I've added the needed {alfred($page, 'fieldname')} code to the latte template to trigger alfred inclusion on the page render - and the script is being included, and is download from the server. I view site, while I'm logged in as superuser (ddevadmin). Just like iamandreas, I get the following... I've checked the role rockfrontend-alfred is present, and the ddevadmin is a superuser. I've now tried this with a PW dev & PW master codebase, in three separate ddev installs - one with the default docroot - and have had the same result on each one. Setup was super easy with ddev and then rockshell, and they all had your RockFrontend site profile installed. So, it looks like jQuery isn't being included in the scripts when needed maybe?? Anyway, will dig some more. Link to comment Share on other sites More sharing options...
imandreas Posted April 9 Share Posted April 9 Hi, it is almost 6 months, since I worked on this, but I remember, that you have to use the jquery version from PW admin. You should see the magic lines "ALFRED is ready :)" in console, if you include the PW jquery, which is loaded by alfred Maybe that helps Link to comment Share on other sites More sharing options...
imandreas Posted April 9 Share Posted April 9 We made like this, in the header PHP template we checked, if the user is able to edit the page if ( wire('page')->template == "user-item-template" and (wire('user')->hasRole('frontendeditor') ) ) { echo "<!-- skip jquery -->"; } elseif ( wire('page')->template == "user-content-template" and (wire('user')->hasRole('frontendeditor') ) ) { echo "<!-- skip jquery -->"; } else { ?> <script src="<?php echo $config->urls->templates;?>js/jquery-3.7.0.min.js"></script> <? } Then it was possible to call the alfred: <div class="btn btn_default" <?= alfred($item, "title,text,content") ?>> <i class="fa-solid fa-pen-to-square"></i> Edit </div> It was opening the edit mode in a modal view with some administration header stuff. 1 Link to comment Share on other sites More sharing options...
netcarver Posted April 9 Share Posted April 9 Hi @imandreas Yes, I changed this in _init.php and Alfred now runs as expected. My point is that I think this should be included automatically within the RockFrontend site profile, or be in the RockFrontend documentation for Alfred. Or perhaps the code for Alfred could pop up a JS alert box indicating the need to load JQuery - which would save having to look at the console. $rf->scripts() // load uikit ->add('/site/templates/uikit/dist/js/uikit.min.js', 'defer') // load custom javascript of this project ->add('/site/templates/scripts/main.js', 'defer') // load jQuery from /wire to allow ALFRED testing ->add('/wire/modules/Jquery/JqueryCore/JqueryCore.js', 'defer') // <<< Added // minify on production ->minify($config->debug ? false : true); This is just to get things running for testing - would need to conditionally include it only if alfred is needed. 1 Link to comment Share on other sites More sharing options...
netcarver Posted April 9 Share Posted April 9 Ok, everything seems to work out of the box if you first install PWs PageFrontEdit module (which I didn't do as they were all fresh installs!) I guess this is what fulfills Alfred's JQuery dependency without the need to edit the _init.php file. @bernhard Could the code catch this by default? So if the need for alred is detected server side, but PageFrontEdit is not installed, add a message about installing it? Could also be added to the alfred script so it pops up an alert about installing PageFrontEdit? Link to comment Share on other sites More sharing options...
bernhard Posted April 9 Author Share Posted April 9 Hi @netcarver thx for helping to improve RockFrontend ? 53 minutes ago, netcarver said: Could also be added to the alfred script so it pops up an alert about installing PageFrontEdit? Done in the latest commit on the dev branch ? This pops up as soon as you add {alfred(...)} somewhere in your markup and the module is not installed. I've also added a note in the docs. 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