Jump to content

flydev

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by flydev

  1. Short answer from mobile. Try with that in .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /2022/$1
  2. @tires the hook need to be Session::loginSuccess - the one given by @adrian - to redirect the user, after he log in. You can write the target url in the session, and you do not really need the GET variable. But as I said in the first idea, if you need to differentiate a user which come from the mailed url, you "have" to give a GET variable or a segment. If you do not do that, the url set in the session will be for all users. It might not be an issue for you. I all needed template, just set $page->url in the session. Apply logic there. And as I said, without distinction, it will apply for all users.
  3. Quite easy ? (see: https://github.com/baumrock/AdminStyleHello/issues/1#issue-1401993078) https://github.com/flydev-fr/AdminStyleDark/tree/dev
  4. ? Perfect, checking it, thanks.
  5. @bernhard could you take a look at https://github.com/flydev-fr/AdminStyleDark Is this the right way to do it?
  6. Its a matter of taste and organization. You can have 3 pages and only one template. If services and about was using the same template basic-page, you end with only one basic-page.php template to work with. The strategy used and the templates are two distinct things. Add Pages to it, and its 3 differents things.
  7. You can write a simple hook, and to redirect to a specific url, you can set the url in the user session, once logged, redirect and unset it. An idea could be to set a GET variable in the link you send to your users so it will work only for theses links, then do the logic in the hook (about checking for the existing GET var and setting the url in the session). Check this thread for the hook :
  8. I must admit that I didn't understood this statement as it was working as expected lol
  9. @Boost I think yes, I never used markup-region, maybe pw-3.0.61 introduced new api functions or markup-regions things which are required from there. https://processwire.com/blog/posts/processwire-3.0.39-core-updates/ Edit: I read the ProcessWire 3.0.61 core update, I think I am missing some details as I don't use this strategy, but clearly, the region strategy seem to be introduced on this update yes. Let's wait others users to give us more details in this thread.
  10. I was sure I had already saw an update made by @ryan to make SkyScrapers using markup-region (https://weekly.pw/issue/129/). The demo I linked previously is made with it. There you go: https://github.com/ryancramerdesign/skyscrapers2 ?
  11. I still use 2012 code from time to time, it make me also smile when it happen. About the tutorials, a real website, it depend what you call a real website. (I am not being rude, and I get your point, but I think that the tutorials need be done by the community, maybe we should follow an official guidelines). For example, for me, you would need to put your hand in Vite, Svelte, and how to mix them with ProcessWire to get data which mean to build a module that will inject custom headers, or use an internal API, and make yo call ProcessWire Headless cms things. For others devs, it could be other stack / frameworks, and we all know there is a ton of them. So you end up in what PW is the best => freedom, and I think IMO that it will be hard to satisfy everyone. ? For beginners, there is some good up-to-date doc, like https://processwire.com/blog/posts/starting-with-the-blank-profile/ and also tutorials - https://processwire.com/docs/tutorials/ - and for a real damn good example real website, the update profile SkyScraper which can be visited there http://demo.processwire.com/ , downloaded, dissected and modified. Maybe, again, the real need is to organize better what's already exist.
  12. @gebeer there you go: https://github.com/davidhellmann/tailwindcss-fluid-type https://play.tailwindcss.com/TegGD6vkSM
  13. I am used to use rem, the reason => web accessibility => a pixel is not responsive and with some algebra (lol) for fluid typo, the concept is called Poly Fluid Sizing and using tailwindcss utilities? Rule them all with this linear equation definition, which result the font-size : Take a look at this sample: https://codepen.io/neil/pen/agzZVg And give a read to : https://www.smashingmagazine.com/2017/05/fluid-responsive-typography-css-poly-fluid-sizing/ ✌️ Edit: for the rest, everything with a tailwind.config.js, it's so cool: https://tailwindcss.com/docs/grid-template-columns & #arbitrary-values
  14. The extension look cool and will install it on Windows, but its not available for Chrome iOS :(
  15. @Pete ? A dark-mode could be available to view the forum ? iam near 40 and my eyes need more obscurity ??‍♂️?
  16. After reading again Steve's messages, I added a new setting (enabled by default) which if set, delete orphaned logs files from the folder. Update to v1.4.26 to get that.
  17. Another update (v1.4.25) with a new setting available to customize the permission set on duplicator.sh when using the Native Mode feature. Thanks @netcarver It also delete the corresponding log file. ℹ️ The module can be upgraded again trough ProcessWireUpgrade, I was only updating a static var forgetting the module version field and then the module version was not reflected in the modules directory.. ?‍♂️
  18. I said, both module require the file `admin.less` or at least the compiled `admin.css` ? But forgot it, my question doesn't make sense as I didn't read the point #3 on AdminStyleRock github repo ?‍♂️ It might serve as an example how to share your own styles with the community in a modular way instead of sharing admin.less files that can't be updated/monitored by the PW upgrades module.
  19. Yes that is what was planned, I talked about LESS mod, but I used your module in first instance and I think he will receive the PR to give the dark-mode available by default. I might be blind, but what's the difference between the LESS or Rock in the "sharing flow" ? they don't both require the admin.less files ?
  20. It take into account: the official ProcessPageList BreadcrumbDropdowns by @Robin S AutocompleteModuleClassName by @Robin S InputfieldSelectize by @Macrura InputfieldSimpleMDE by @Macrura to be continued...
  21. Just sharing an admin dark mode theme. Still a WIP, I need to figure out how uikit-inverse colors work and a switcher will be pushed. (great rock job @bernhard) Feel free to try it, submit issue or better pull-request. https://github.com/flydev-fr/AdminStyleDark
  22. great perseverance from you, learning new things from each others as always. @szabesz given the answer too there :
  23. Yes, because of the rendering order - (I am used to use the Delayed Output Strat so I can't tell you right now what's going on for real) - wrap the HTML output with `if(!$config->ajax)`. example : _main.php: <?php namespace ProcessWire; // place this on the top - easier for us to debug for your project. // but with the good logic, you could do it by feeling. // // return content set in `header()` (ext/json here) if($config->ajax && $input->post->bookmark) { bd($input->post->bookmark); // debug with tracy, uncomment if you have it $bookmarkid = $sanitizer->int($input->post->bookmark); $action = $sanitizer->name($input->post->action); $bookmarks = $user->getUnformatted('bookmarks'); switch($action) { case 'save': // save logic if(!$bookmarks->has($bookmark)) { // add bookmark $bookmarks->add($bookmark); $user->setAndSave('bookmarks', $bookmark); $message = 'Borat saved bookmark "'. $bookmark->id .'" ?'; } else { $message = 'Nothing done'; } $success = true; break; case 'remove': // remove logic if($bookmarks->has($bookmark)) { $bookmarks->remove($bookmark); $user->setAndSave('bookmarks', $bookmarks); $message = 'Borat removed bookmark "'. $bookmark->id .'" ❌'; } else { $message = 'Nothing done'; } $success = true; break; default: $message = 'error'; $success = false; } // build the response data array that will be returned in `data` from `.done(function(data) {` $json = array( 'id' => $bookmarkid, 'action' => $action, 'message' => $message, 'success' => $success ); // convert data and send as JSON header('Content-Type: text/json; charset=utf-8'); // forgot this line echo json_encode($json); return; } ?> <?php // HTML code need to be rendered when a normal request happen (non-ajax, the user dont want the JSON thing, he want text/html to see it in his browser page) // render HTML only if not ajax detected if(!$config->ajax): ?> <!DOCTYPE html> <html lang="en-gb"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="alternate" href="https://ad-bank.co.uk/" hreflang="en-gb" /> <title> Browse Over 1000 Ad Creative Examples | Adbank.co.uk </title> <!-- .... --> </head> <body class="body"> <!-- Page Header --> <!-- Navigation --> <nav id="nav" class="unhidden"> <!-- .... --> </nav> <div id="content-main" class="adbank"> <!-- .... --> <header class="small-header"> <div class="full-width"> <div class="row flex header-content"> <h1>This is everything!</h1> <p>Here are all the ads we have collated. It seems a lot, it is and it's only growing. Check out the filters or the brand and industry sections. Struggling for inspiration? The blog has features collections based on styles, industries and our personal favourites.</p> </div> </div> </header> <!-- .... --> <div class="breadcrumbs"> <!-- .... --> </div> <!-- .... --> <section id="main-post-area" class="ab-post-area"> <div class="full-width"> <div class="row"> ...... </div> </div> </section> <!-- .... --> </div> <footer> great success </footer> <!-- PUT OUR JQUERY SCRIPT HERE AT THE VERY BOTTOM --> <script> jQuery(document).ready(function($) { // when clicked, send ajax request to server $('button.bookmark').on('click', function(e) { var btn = $(this).hasClass('clicked') ? false : $(this).addClass('clicked'); if (!btn) { console.warn(`⚠️ Bookmark already saved to profile`); return false; } $.post('<?=$pages->get('/')->url?>', { action: $(this).val(), bookmark: btn.data('id') }) .done(function(data) { console.log(data, "? response from ajax req"); console.info(`✅ Bookmark id => ${data.id} ${data.action} `); }); }); }); </script> </body> </html> <?php endif; // /render HTML ?> Adjust you code, fire the button, report back (✅❓❓)
×
×
  • Create New...