Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. It seems strange you get a 500 error for something so trivial. Perhaps you have other code you've stripped from your post that causes an endless loop or redirect... You can try this: $refs = $pages->find("template=project, title%=Zürich, include=all"); $count = count($refs); $last = $count-1; $c = 0; foreach($refs as $r) { switch ($c) { case 0: echo "<hr><strong>FIRST: {$r->title}</strong><br>{$r->project_desc_short}"; break; case 1: echo "<hr><strong>SECOND: {$r->title}</strong><br>{$r->project_desc_short}"; break; case 2: echo "<hr><strong>THIRD: {$r->title}</strong><br>{$r->project_desc_short}"; break; case $last: echo "<hr><strong>LAST: {$r->title}</strong><br>{$r->project_desc_short}"; break; default: echo "<hr><strong>DEFAULT: {$r->title}</strong><br>{$r->project_desc_short}"; break; } $c++; }
  2. Welcome to the PW forum @Slideth. As far as I know, adding redirects directly from a page's setting is not a core-feature. Can you find out if this is a module? Or maybe done with a hook (?). If it's a module, you should try to find its own dedicated module support forum and ask there. But generally speaking, check this redirect-field setting under "access", maybe you can define things right there...
  3. Are those quotes actually single quotes ' ? I'd try to remove them from the $port, as it's just an integer anyway. For an example of how to use the PW DB handlers, see this post from @ryan: Or you can use plain PHP functions (PDO, mysqli...) instead. If the error persists, you simply don't have the correct DB credentials.
  4. Sure; you can PM me, and I'll have a look
  5. Also, nothing happens when I add something to the cart. Are you sure it's working at all? I see no visual feedback, and after going to another page, I see no cart anywhere.
  6. Care to explain? Do you load infos about all that on every page load? "just in case you need parts of it somewhere"? What's in you _init.php of _func.php, or whatever you use before the main template file(s)? If you indeed query 1800 pages (and several fields, relations etc.) then no wonder it's not fast. Did you build the site yourself, or did you take it over from someone else? Also, I have never seen an HTTP header like this: x-iplb-instance: 28111 Any idea what this is?
  7. A performance audit with Google Chrome (Lighthouse) delivers abysmal results. TTFB over 6 seconds. This has nothing to do with frontend assets. You must be doing something terribly inefficient in your code (PHP)... You should use Tracy Debugger and see what's causing all this slowness. Also take a look at your server logs. Does a local copy of the same site load equally slow? Did your hoster change any PHP/Apache settings recently?
  8. well then... that explains it. I had allowed approx. 4 dozen fields. Roughly 40% of these are page-ref fields. Is that a general graphQL (architectural) performance issue, or just with this particular PHP library in particular? (which, as I have noticed, is not being maintained anymore)
  9. I was spending some more time with this module, and have tried various queries. The exact same query with JS + graphQL: 6s. PW inside Tracy (and JSON output): 0.177s (tried several times) Does the number of allowed fields and templates play a role with performance?
  10. If the design is almost the same across sites, I wonder why you want to spread your content across several domains in the first place? Is it for legacy reasons? You could define one main domain for the future, and on relaunch simply use 301 redirects. But if you want to keep separate domains, I'd try option 1, except... I wouldn't recommend that step. You could run into problems with search engines who detect duplicated content across several URLs.
  11. It's odd: If you try to add a child-page under Access > Users > usernameX > Tab "Children", you get these errors as posted above. However, you can create child-pages via the page-tree without a problem!
  12. I guess it has to do with security. Since the user is a system-template, there are mechanisms (limitations) in place that potentially try to stop you from doing something that may sooner or later break stuff.
  13. Yes, why not? Or you could add a new field for licenses to the user template, and store the infos directly there?
  14. perhaps PHP shortcode is disabled in your server environment. Try <?php ... ?> instead of <? ... ?>
  15. You could instead try to define the default to match one of your image variations you are actually going to use in your srcset with $config->adminThumbOptions: https://github.com/processwire/processwire/blob/master/wire/config.php#L633
  16. PW needs some thumbnail to show image previews in the admin, so I don't think there's a setting somewhere to avoid creating the default thumb. You could use file fields instead, but you would miss on all the image-specific API functions... see also:
  17. if you have $config->advanced = true in your site/config.php file, then you'll see some addtl. fields in template > advanced: Although I would also be careful with that.
  18. dragan

    Blog

    Just install the "regular" PW site profile, it has various blog features (comments, categories, pagination etc.) built-in. https://processwire.com/blog/posts/introducing-a-new-processwire-site-profile/ There's also an (older) blog profile you could try: https://modules.processwire.com/modules/process-blog/
  19. It's weird. I have managed to get it working with German umlauts, but not with cyrillic characters. I guess the culprit is not line 204, but further below: $input = iconv('utf-8', 'us-ascii//TRANSLIT', $input); I've tried to implement the fix suggested here, but it still didn't work... (1st user-contributed note).
  20. "framework" and "web application projects" are very very loose terms... If you could describe a bit better what you are trying to build, I'm sure people could chime in with more "to-the-point" suggestions, or concrete real-life examples from their own experience. There are various ways how to extend / customize the whole backend. Custom dashboard, custom modules etc. @bernhard has an excellent, epic tutorial how to create your own module to handle potentially... well, just about anything you'd want. So, I guess if you want to get constructive feedback here, you should elaborate on what you're trying to achieve. And what exactly do you miss in PW that you have in Laravel or Silverstripe.
  21. dragan

    Laragon slow?

    seriously? Windows 7? Maybe that's the root cause of your troubles...
  22. I guess with .htaccess alone you won't go far. Here's a recipe that you could probably easily rewrite to suit your needs: https://processwire-recipes.com/recipes/maintenance-mode/ There's also a module: http://modules.processwire.com/modules/maintenance-mode/
  23. Repeater Matrix sounds like a good fit for this. Believe me, the Pro Fields module is worth every cent.
  24. https://processwire.com/api/ref/modules/refresh/
×
×
  • Create New...