Jump to content

da²

Members
  • Posts

    387
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by da²

  1. Wouldn't these two statements be contradictory? ? A redirection always change the current page. What you need is a link with target='_blank' like @Jan Romero wrote.
  2. Like Ryan said, the error message is about your database credentials, not the ProcessWire password. Connection with database can't be established because login or password is wrong, they are the same that you use with PhpMyAdmin, maybe login is "root" without password. So I suppose you don't use a versioning system like Git? Take a look at it after solving your issue, and you will never fear a file loss again. ^^
  3. PW provides all the API to create users and login them. You just need to create the frontend form so the regular users will be able to login on the site. No module is required, but if you don't want to write code at all you can use a free module, in the past I've used this one.
  4. I don't understand what you need to do, can you give examples? Parent pages and children are always linked, you don't need a page reference field to link children to a parent. If you're doing only this, you can remove it. What kind of page do you want to add with the page reference field? Do you have set the options on this field to filter the pages it allows? EDIT: I didn't see this message. If the goal is only to create child pages, why not using the "Children" tab?
  5. In fact I think your solution is to remove this page reference field, you don't need it because you are using a parent/child relationship that is already implemented by default in PW.
  6. This is where you'll have to put an effort, building a site with ProcessWire needs code. But PW has a fast learning curve compared to some other CMS, API is easy to learn, and creating your own project is a good way to learn to code. ?
  7. Yes, encapsulation is a very important concept to read about, I forgot to mention it in my message. Yes, the book is written based on neuroscientific knowledge that facilitates learning, and it works incredibly well. Before I read this book, I had been trying to understand Design Patterns for weeks or months through discussions on forums with good developers, web tutorials... But I couldn't understand anything, I saw no point in coding DPs. Then I received this book, read 2 or 3 chapters the first evening, it was very exciting to read, I dreamed all night of boxes connecting together (classes/objects), and the next morning I understood everything! ??
  8. Transitioning from procedural development to object-oriented development is primarily a matter of approach and key principles to follow. It involves learning to code differently, but the code itself is not the core issue; it is the way the application is structured that is important. It's not enough to create a class to do OOP; for example, if you put 5000 lines of code in a class, you are probably not adhering to OOP principles. ? I would advise you to look into the KISS principle, read articles that compare inheritance with composition, study the role of interfaces and abstract classes, study Design Patterns, and represent your programs with UML class diagrams before you start coding (at least during your learning period). A book that definitively gave me a leap forward is "Design Patterns" from the Head First series. This book is absolutely magnificent for understanding the OOP approach in record time while learning the essential Design Patterns and the reason for their existence.
  9. What web server and OS do you use? Error 500 is a web server error, and errors are logged by default. The log file location depends on OS and web server, for example in xampp Windows with Apache, it's in xampp/apache/logs/error.log, in Debian it's in /var/log/apache2/error.log...
  10. Hi, I don't know but maybe template caching requests some module to be installed in web server, like URL rewriting. Check your web server logs and you'll find the reason of this error.
  11. Maybe open a bug report for this, that looks like this is not intended.
  12. I can't use a hook like Inputfield::render because I just found that $inputfield->collapsed = Inputfield::collapsedLocked; is not working (I still can edit the field). It's working only from a hook ProcessPageEdit::buildForm or buildFormContent. I'm investigating how to implement this with buildForm, if you have an idea don't hesitate, I'm wasting so much time on this simple feature... ? I also have to check if the field is inside the repeater, because there is also another instance on the page and I don't want to modify it.
  13. Thanks, I had to update to dev branch to make it work. I'm still interested to know how to do this with a hook, because on another template the dependency is related to a parent page field value.
  14. Hi, When I click the "add" button on this repeater I want to hide a field inside depending on the value of other fields in the same page (but outside the repeater). So it should start with a hook and end with a: myInpufieldField->collapsed = Inputfield::collapsedHidden; But I can't find a way to access the input field. And not sure what kind of hook to use (ProcessPageEdit::buildForm, Inputfield::render, InputfieldRepeater::render°. I struggle to access the inputfield inside an item of a repeater... Any idea?
  15. Yes Ubuntu adds their own philosophy over the Gnome desktop. With Gnome in Manjaro Linux I can move the dash in 4 screen edges and have more options to tweak. You could try Manjaro since it's based on the rolling release Arch Linux distribution, so you get only recent versions of each software. It's not considered as stable as Ubuntu tho (in theory, because of rolling release philosophy), but practically there's really few chances to have a serious issue. In the past I ran Adobe CS5 under a virtualized Windows with Virtual Box and that was working fine, I mainly used Photoshop and Illustrator. Maybe make a try. It's necessary to enable CPU virualization in BIOS and activating some options in VirtualBox (like graphical acceleration) after creating the Windows VM and installing the package virtualbox guest additions.
  16. @poljpocket The same code works if called from another class. The above code is incomplete to create a page, and just illustrates that template is empty when called from static method in the custom page class. If I fully create the instance, I end with that strong bug in admin.
  17. @BrendonKozNo, from a template if I remember good. The method create() is not complete in my post, the page is saved at the end and I have these strange bugs in admin, so the code executes well, and the same code in another class (not the custom page class) is working fine. Looks like a bug in Pw, maybe something related with PHP namespaces and template retrieval.
  18. Hello @BrendonKoz, On the code above I didn't copy the namespace and use statements but this is not the issue, instead of using ProcesswireTemplate I can directly use strings but this is not working either. EDIT: I've edited my code to remove this ambiguity, using strings instead of class ProcesswireTemplate.
  19. Hi, I post here before to report an issue, just in case I'm missing something (using PW 3.0.229). To create instances of a custom page class, I'm adding a static method on it: class IndividualCarChoicePage extends Page { public static function create(UserPage $user, ChampionshipPage $championship): void { $carChoiceParent = wire()->pages->get("parent_id=$championship->id, template=individual-car-choices"); $carChoicePage = new IndividualCarChoicePage(); $carChoicePage->of(false); $carChoicePage->template = "individual-car-choice"; $carChoicePage->parent = $carChoiceParent; $carChoicePage->title = $user->displayUsername; DevUtils::prettyPrintObject($carChoicePage); exit(); } } But the template is not defined: ProcessWire\IndividualCarChoicePage Object ( [id] => 0 [name] => [parent] => /assetto-corsa-competizione/championnats-acc/championship/choix-de-voiture/ [template] => [title] => MyName [data] => Array ( [title] => MyName ) ) And then the admin is corrupted: The blue page is the parent page of the newly created, you see the arrow on left indicating it has a child, but this child is not displayed. And there's not way of solving this issue, I can not delete the parent page "Choix de voiture", the trash refuses to delete it! Now, if I move this code to another class, that is not extending Page and not located in /site/classes/ directory: IT WORKS! The new page is created with its template. Why?
  20. About using Paypal for payment, better solution than using payment buttons is to use Paypal checkout SDK. Then you can dynamically create any order you want and validate the payment. EDIT : this SDK is now deprecated and replaced by REST API.
  21. Hello @HarryWilliam It looks like padloper is a e-Commerce module.
  22. @hellomoto It's a common error. You are outputting data before the headers, but headers must be the first thing to output. Headers are sent by ProcessWire, but you echo something before to include PW: $boot = realpath($boot); echo $boot; // DO NOT echo something... require_once $boot;// $pw_dir.'/index.php'; // ...BEFORE PW sent headers. Also why do you use this code and not a simple include at start of file? include __DIR__ . "/../index.php";
  23. Hello, Is your template named "repeater"? (I don't really understand the "page object class: RepeaterPage" here, I don't see this information on my side but am not on last PW version, I imagine this is the custom class associated with this template, but RepeaterPage is a PW class)
  24. Hello, The pw-replace must be in template-file.php and the id in _main.php. Documentation.
  25. Nice, for a beginner it's a nice way to quickly discover PW mechanics. And probably an experimented user can also find some interesting features he doesn't already know (I already see some of them). ?
×
×
  • Create New...