Jump to content

da²

Members
  • Posts

    271
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by da²

  1. Really? 🤔 Maybe check the root directory you set in Apache config. It looks like it's targeted on mysite/site/templates/ instead of mysite/. Personally I use relative paths in CSS (url('../font/NotoSansDisplay-Regular.ttf')), but that doesn't matter, if I enter url('/site/templates/font/NotoSansDisplay-Regular.ttf') it works fine too.
  2. I would just use if ($page->isNew()). This is true when we are on the very first page form with only the title and name fields. Then it's false. This is the same as if (!$page->id).
  3. I would say the easiest is to add an "edit bookmark" to this page, it requires no module or hook nor moving the page in a specific location. Go to modules page Click the tab Configure Find the module Page Edit and click Configure Check to enable bookmarks Go to menu Pages > Edit > Bookmarks Add the bookmark for your page with the corresponding user role (select everyone if no specific role is necessary) Now you can access this page with menu Pages > Edit > Your page
  4. I see, this is probably the module "Page Title (Multi-Language)", I'm not using it, and the documentation talks about these active checboxes.
  5. The problem, for what I understand, is that you are asking for links that open in another tab. It's simple, @Jan Romero already answered the question. But then you say you need a redirect, but a redirect always change the current page URL, it's never opening in another tab. We are not talking about ProcessWire limitations but web standards. Maybe just be more precise on what you want, or maybe it's just me who doesn't understand... I asked ChatGPT what you need (with a link to this topic), and here is what he answered to your request, a JS script that automatically open a new tab on the wanted URL: echo "<script type='text/javascript'> window.open('{$page->external_url}', '_blank'); window.location.href = '{$page->some_other_url}'; </script>";
  6. I don't have theses active checkboxes in my multi-language pages, maybe you are using a specific module and that could help to mention it in your original post? Or is it an old PW version? I have no idea here. ?
  7. Why is it not constructive? Sorry that you interpret my comment that way. I've also read the output strategies tutorials and explanations were clear to me, so if you think "they don't make much sense" and you "struggle to read and comprehend the more complex code" I think you lack some PHP background. Maybe I'm wrong, it seems you are saying the problem is not about PHP knownledge, maybe you could explain so we can be more precise in the help we give to you.
  8. I'm curious, where in PW do you see a list of languages that are active or not for a page? I see nothing like this in my multi-language site but maybe you are using a specific module?
  9. So the next step is probably to learn PHP more. ?
  10. 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.
  11. 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. ^^
  12. 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.
  13. 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?
  14. 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.
  15. 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. ?
  16. 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! ??
  17. 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.
  18. 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...
  19. 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.
  20. Maybe open a bug report for this, that looks like this is not intended.
  21. 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.
  22. 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.
  23. 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?
  24. 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.
  25. @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.
×
×
  • Create New...