Jump to content

Pixrael

Members
  • Posts

    395
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Pixrael

  1. @kongondo This does not work, these new hook functions only work when the requested URLs are not mapped directly to a page and the home page is "always there". @Sebi Could it be possible to use the homepage template file to "wireIncludeFile" the routes file, or to directly pass the request to your module, ex. initialize a module static function with the input object? AppApi::Execute($input);
  2. @Sebi How to set the "API Endpoint" module configuration correctly? I need to create a website (subdomain) that is an API server only, no web pages will be served from there.. I test the parameter like "/" in order to works like: https://api.domain.com/users/ but this show a "404 Not Found".. I need the endpoint entry of the API in the "home" of the website
  3. $import_timestamp = time(); foreach($jsonData as $jsonDataItem) { // Search for the page $imported_page = $pages->findOne("template=import_page, title=$jsonDataItem->name"); // Check if the page exist if ($imported_page->id) { // update values $imported_page->setAndSave([ 'field_A' => $jsonDataItem->source_A, 'field_B' => $jsonDataItem->source_B, 'field_C' => $jsonDataItem->source_C ]); } else { // create new page $p = new Page(); $p->template = 'import_page'; $p->parent = $pages->get(xxxx); $p->title = $jsonDataItem->name; $p->save(); } } // use this because if the pages were not updated/created during this import it means they don't come in the json $old_imported_pages = $pages->findMany("template=import_page, modified<$import_timestamp"); // hide/delete all $old_imported_pages..
  4. You can use the urlSegments to choose which html code to output in the template file, it can be with the code directly or with file include. https://processwire.com/docs/front-end/how-to-use-url-segments/
  5. Have you already tried using the repeater field for that? https://processwire.com/modules/fieldtype-repeater/
  6. .. or you can use $input->get() check docs here: https://processwire.com/api/ref/wire-input/get/ if you want to learn how to use ulrSegments, read this: https://processwire.com/docs/front-end/how-to-use-url-segments/
  7. ProcessWire can be checked? https://www.zdnet.com/article/google-releases-new-open-source-security-software-program-scorecards/ https://github.com/ossf/scorecard
  8. I implemented that previously. In my experience, if you create a page for each event (using child pages or repeater) you will end up with hundreds of thousands of pages quickly, and in each one you will recorded only a minimum data. I think that is very inefficient. Maybe using ProTable is a better solution. I finally ended up using a textarea and saved one event in each line, when I was going to show the timeline I parsed it with regex, as well to update the tracking info this is very easy. Maybe if I do that again, I would avoid parsing every request for the tracking info by saving/reading/updating the events in JSON format.
  9. I think the "correct" way to do it, is how you have it implemented now: for each portfolio, you query the related user to obtain the additional data. It's true that if you are constantly making queries of this type (ex: inside a loop), that performance is not optimal. Maybe if you use some kind of page/template cache you can solve it. Another way could be to keep a copy of the user's data in a "user" field of the portfolio template (using a textarea field and save all user data in JSON, or use the new ProFields Combo field) and implement a synchronization system based on hooks, then in the users' Page Save hook, find the related portfolio and updates that JSON field. ?‍♂️
  10. I have been using exactly that workflow for a long time now, with total success in medium to complex projects. Additionally I add components and partials using wireRenderFile or wireIncludeFile and that's all I have needed. It's important to note that all my projects are one man projects.
  11. Check this: https://www.fastcomet.com/processwire-hosting I never try this Managed Processwire Hosting, but I used their regular hosting plans, and they comes with cpanel + softaculous, so you can install PW easily.. fast hosting
  12. https://processwire.com/api/ref/page/set-and-save/ // Not needed: $order->of(false); $order->setAndSave([ 'pad_user' => $u->id, 'expire_date' => $expireDate, ]);
  13. Tip: always use Google to find information about Processwire
  14. You can use this too: <?php echo $pages->get(1025)->FIELD ?? ''; ?>
  15. In the meantime you can go using this: https://www.uniformserver.com/ it has worked wonderfully for me
  16. I'm sorry.. I did not want to distort this forum topic, it is just that this fact caught my attention .. ProcessFileManager is an interesting solution to fix something in a hurry, you just have to apply a very good access control. Years ago, when I was traveling and I was using ICE Coder (https://icecoder.net/) in a project and it worked well for me, then when I return I uninstalled it.
  17. Is Processwire losing traction?? ... lately I have read many comments in this forum from several of the most prominent people in the discussions who are no longer working with Processwire .. ???
  18. ADVICE: Jump directly to this: https://processwire.com/docs/front-end/output/markup-regions/
  19. Pixrael

    Webwaste

    That's right .. in my company we have debated many times about the current trend of web design with so many graphics and stock photos, and too much bombast in the texts. After a couple of minutes looking at the pages you still do not understand what exactly they are trying to sell, offer or inform. A total loss of the message, and all for the "beauty" of the page. It's the sublimation of "an image is worth a thousand words", but incoherent words I suppose!
  20. @bernhard several days ago I found this free image cache & resize service https://images.weserv.nl/ just in case you want to create a Rock module for that ?
  21. I agree.. today everything is SaaS like.. membership+subscription is the thing
  22. You're right, but I think it depends on the project. In my case, it's an internal company system, and only the admin accesses the user's url in the backend. I also take into account a future situation, when the user needs to enter his profile on the front-end, in that situation he is the only one who has access to the url that shows the name of the page. For me it works perfectly. The developer just needs to think ahead and decide. Any page name you want to use in PW should be sanitize first as a rule.
  23. In my current project, I have the user's email field as required, and realizing that the email is unique to each user, I use base64_encode () successfully, having john.doe@email.com the page name of that user is unique like am9obi5kb2VAZW1haWwuY29t, in addition, this keeps a record of the initial email used when registration was made. Initially I had thought of using the email with $sanitizer->pageName() but I did not want to expose the email address so obvious in the url.
×
×
  • Create New...