
uliverse
-
Posts
49 -
Joined
-
Last visited
Posts posted by uliverse
-
-
I think I have to give up on exec at this point, this is way over my head... The problem seems to be that the exec function can't be called in my MAMP environment, not even when I add the full path to the npm script.
However I found that tailwind comes with a "--watch" command to monitor any changes. And this works! I guess only until the console is closed, but better than manually initiating the build command with every change... I run a command like this:
npx tailwindcss -i ./input.css -o ./site/templates/bundle/tailwind.css --watch
The input.css looks like this:
@tailwind base; @tailwind components; @tailwind utilities;
I'm sure I totally messed up your setup, but it seems to work.
I was also wondering if the standalone CLI might not be easier to install for most people on shared hosting...
-
Well, I did some more testing and found that the exec function is actually available.
I added this code to my page:
<?php $function_name = "exec"; if ( function_exists($function_name) ) { echo "$function_name is enabled"; } else { echo "$function_name is not enabled"; } ?>
As you can see on the screenshot, the result is positive...
Don't get me wrong: I am not trying to ask for your help in my specific case. I believe in your product and I want to help make it usable for as many people as possible!
-
1
-
-
Thank you, @bernhard! Too bad... I will try to figure out why exec is not working in MAMP...
-
42 minutes ago, bernhard said:
Hey @uliverse thx for that screenshots. I was able to reproduce the issue when installing PW in a subfolder. I never do that, so it causes trouble more often that I'd like, because I don't realise if anything doesn't work.
Your issue is fixed now in the latest version 3.21.1
This works for me in my subfolder installation, so my guess is that exec() is not available in your setup?
Could you try this /site/livereload.php ?
<?php namespace ProcessWire; /** * This file will be loaded by RockFrontend whenever livereload detects * a change in the source files. By default it will run npm run build to compile * the css from tailwind, but you can add other commands to run other scripts * like running tests or linters as you need. * * If you are not using Tailwind or you don't need to compile anything, you * can remove this file. */ if (!defined('PROCESSWIRE')) die(); // early exit if not in debug mode or livereload is not enabled if (!wire()->config->debug) return; if (!wire()->config->livereload) return; // run npm build to compile css from tailwind // check if exec is available and allowed if (function_exists('exec') && !in_array('exec', explode(',', ini_get('disable_functions')))) { exec('npm run build'); } else { rockfrontend()->getLiveReload()->log('exec() not available'); }
Or in Tracy try this:
What does it show?
I have changed the livereload.php, but the result is the same.
In Tracy I getarray (0)
-
I cleared the database and re-installed everything (local MAMP installation), but the problem persists. I am going the traditional way: download Processwire, download SiteRockfrontend, move the site-rockfrontend folder into the root folder and install PW with Rockfrontend as site profile. Then run "npm install -D" in the root folder of the project. My installation looks like the screenshot now.
The relevant part of livereload.php looks like this:if (!defined('PROCESSWIRE')) die(); // early exit if not in debug mode or livereload is not enabled if (!wire()->config->debug) return; if (!wire()->config->livereload) return; // run npm build to compile css from tailwind exec('npm run build');
The fronend is reloading after a file change, but the tailwind.css is not being recreated. If I manually execute "npm run build" it works. Is it possible, that the exec command is run in the site subfolder and therefore not working correctly?
About the topbar: the path to the topbar.css is not correct:
-
Nice work! Tailwind is installing correctly now. Only the Topbar still gives me trouble, since the topbar.css is also not linked correctly. This is a minor issue, since the fronend editing module is not essential. But still...
I noticed that tailwind.css is only generated ONCE. When I change the main.latte template again (to "bg-green-500" p.e.) the css file is not re-created... Is there anything I need to enable for the tailwind.js to work correctly?
-
😝 Sorry to be the messenger of bad news... I am glad it was not due to my stupidity... Again - thank you for making this available. Your contributions make PW more accessible to ordinary people like me! 😂
-
So I managed to install the npm packages in the root folder of my project (I guess this is where "site" and "wire" also live). However, the topbar.min.css is not loading and the H1 is not turning red. I found that the path to the topbar.min.css is not correct:
/pwrockfrontend/pwrockfrontend/site/modules/RockFrontend/topbar/topbar.min.css
instead of
/pwrockfrontend/site/modules/RockFrontend/topbar/topbar.min.css
-
Thank you. Helpful tutorial.
-
1
-
-
Hi Bernhard. Thanks for creating this. I managed to install the profile and I get the welcome screen. Where I get stuck is the command line instruction... Currently I am on a local machine (MacOS / MAMP) and I have no idea how I would go about this, to be honest...
-
Very cool! I just found this module and tried the demo. I am amazed how well it already works! Wow!! This could definitely be a game changer for some because it brings so much design flexibility to PW (of course the purists among us cringe inside ?). I have been hoping for some solution like this and will definitely look into it more. Thank you for sharing!
-
2
-
-
No, the caching is definitely server side.
-
Hi.
In my template I call images the standard way ($image = $event_item->page_image->size(640, 480, $options); $options are defined as well in the template, of course. Caching is enabled for the template in use.
On desktop this works normally. But on mobile browsers I get strange behaviour: after changing an image on a page, the new image shows up on desktop, but not on mobile. Only after clearing cache (PageRender module) the correct image shows up...
-
Ah... thank you. That at least takes care of the errors... not quite there, but closer...
Still confused about the PW syntax ?
-
I am trying to implement the search function from the demo into my website. I run into errors, though.
My search.php template starts like this:
Quote<?php namespace ProcessWire;
// look for a GET variable named 'q' and sanitize it
$q = input()->get('q');// sanitize to text, which removes markup, newlines, too long, etc.
$q = sanitizer()->text($q);Already at line 4 it throws an error:
QuoteFatal Error: Uncaught Error: Call to undefined function ProcessWire\input()...
I am lost... What am I doing wrong? It somehow must have to do with Processwire syntax, but the code is taken directly from the demo... so why wouldn't it work?
-
I have encountered a bug: as soon as I turn on the cache function (Processwire built-in) the maps don't load any more on Chrome. Firefox works, though. Any idea what causes this?
-
OK... So it sets a "marker" that I can use for triggering/preventing tracking.
-
Maybe I just missed it... But I am wondering how the tracking cookie management works. What happens if the user chooses either of the options? How does that choice interact with Google Analytics or Matomo?
-
Thanks, johndoe. I will investigate further... :-)
-
Here I am, once again...
I noticed that repeaters won't keep their order in the backend after dragging them into a new order. They will always return to the original order in which they were created in after saving. Is that a bug or is there a setting I have missed? I seem to remember that this used to work... I am currently on 3.0.123.
Help appreciated!
-
On 1/9/2019 at 8:11 PM, matjazp said:
Did you try this version: https://github.com/matjazpotocnik/DynamicRoles ?
I installed this module and it generally seems to work with PW 3.0.123. However, I am logged out of the backend every few seconds. Has anyone else experienced this?
-
1 minute ago, adrian said:
You could make use of http://modules.processwire.com/modules/process-admin-actions/ and build a custom action that lets you choose a Page Table field and then a page to add to that field.
Or you could use http://modules.processwire.com/modules/fieldtype-runtime-markup/ and build a page selector field just above or below the Page Table field and on pag save, process the selected page and add it to the PT field.
You could also hook into InputfieldPageTable::render and add the page selector interface there.
Lots of options really ?
Hmmm... I will look into those options! Thanks a lot! You are always very helpful.
-
3 minutes ago, adrian said:
The code in that link I posted hooks into the rendering of the page table field in the backend and automatically adds existing child pages. Is that not what you are looking to do?
Yes and no... it's a bit more complicated I guess... I need to be able to do this manually. If there is no simple solution, I will find a workaround. Thanks for your help, though!
-
Thanks for the ideas. I need to be able to do that in the backend. But it seems there is no simple way of doing that...
RockFrontend Site Profile - RockFrontend + UIkit + TailwindCSS
in Themes and Profiles
Posted
I see... Makes sense.
I just followed the instructions in the tailwind docs... This is all new to me. 😄