Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/05/2023 in all areas

  1. Hi, This is called Markup Regions, it's targeted to ease templating (like Twig would do but only in PHP): https://processwire.com/docs/front-end/output/markup-regions/ If you use this, prefer to do it with the pw-region tag as it is better optimized (check the documentation). EDIT: I forgot to mention you can disable Markup Regions in site/config.php with $config->useMarkupRegions = false; Then you may also want to disable $config->prependTemplateFile if this file is no longer necessary. But if you want to use regions, you'll find in documentation that you can prepend/append/replace the _main.php tags with tags in templates, to solve the problem you are facing.
    5 points
  2. 2nd time this has happened this year, 2nd time I've been brought in to fix it. Two different websites, two different clients of a small marketing business I subcontract for. Directly contributing to loss of revenue due to online ordering being down. Currently managing ~4 WP websites for clients, they're all not a fan. Currently negotiating a contract for a website and an employee at the company said "I f****ing hate WordPress". Feel free to spread the WP love here <3
    2 points
  3. I tried to replicate this problem and it turns out there are some characters you can add to $config->pageNameWhitelist and .htaccess all you want, this blacklist in the core won’t have it: https://github.com/processwire/processwire/blob/master/wire/core/Sanitizer.php#L911 Dollar signs are FORBIDDEN!!!! However, don’t despair yet, you’re never more than a finite amount of disgusting hacks away from success: wire()->addHookBefore('ProcessPageView::pageNotFound', function(HookEvent $event) { if (stripos($_SERVER['REQUEST_URI'], '/concepts/') === 0) { //serve file } }); This needs to go into init.php and runs whenever PW would otherwise 404, that is, it can’t find a page or url segments or url hooks for the requested path. Some things will not work as expected in this hook. For example input() will not be populated. To make the $ work you’ll need to update your .htaccess, though. For example you can just add the $ to the default rewrite condition: # PW-PAGENAME # ----------------------------------------------------------------------------------------------- # 16A. Ensure that the URL follows the name-format specification required by PW # See also directive 16b below, you should choose and use either 16a or 16b. # ----------------------------------------------------------------------------------------------- RewriteCond %{REQUEST_URI} "^/~?[-_.a-zA-Z0-9/\$]*$" # ----------------------------------------------------------------------------------------------- # 16B. Alternative name-format specification for UTF8 page name support. (O) # If used, comment out section 16a above and uncomment the directive below. If you have updated # your $config->pageNameWhitelist make the characters below consistent with that. # ----------------------------------------------------------------------------------------------- # RewriteCond %{REQUEST_URI} "^/~?[-_./a-zA-Z0-9æåäßöüđжхцчшщюяàáâèéëêěìíïîõòóôøùúûůñçčćďĺľńňŕřšťýžабвгдеёзийклмнопрстуфыэęąśłżź]*$" Or use the other one below and add it there. Or do whatever is applicable for nginx? Not ideal but still better than messing with the core, I guess.
    2 points
  4. Maybe with URL rewriting? Like a web server rule to transform URL like /concepts/My_Test_File4$$$.pdf/ to /concepts/?fileName=My_Test_File4$$$.pdf So old links are still working.
    2 points
  5. Different site I was hired to make simple text edits and remove some menu items. What should have been a 15 minute job ended up taking an hour because the page editor completely broke and it wasn't clear what was causing it. Turns out a jQuery version changed and I had to edit the plugin code directly. This is just tacky.
    2 points
  6. Here's a different site I was called in to fix. The design has been screwed up because it never quite looks right and the non-designer that edited the pages didn't click the buttons that change the editor size to "Mobile", "Tablet", and "Desktop" to make sure it would look correct across all devices. The semantic HTML was destroyed because, you know, the <h*> tags are to control the size of the text, right? It murdered SEO because tags aren't being used correctly. I love ads and update notifications that have existed there for weeks and also appear to be broken. I'm not doing anything about it because I'm not contracted for it and who knows what it will break. I do like the power that this design editor gives non-developers though, when things don't look right they can just tweak all of these numbers. I mean, who doesn't know and understand the CSS box model? Surely users can rattle off the differences between px, %, em, rem, and vw. Anyway. The amount of work it takes to make sure a page doesn't look like a trainwreck is, and I mean this, a valuable use of everyone's time- just stack the time I'm getting paid to fix it on top of that. I love WordPress, I make a lot of money off of it.
    2 points
  7. PW has quite strict session spoofing protection enabled by default. It is called a session fingerprint. Take a look at the session fingerprint settings here. I would start by trying to relax this setting and try to log in again. I have encountered problems with the fingerprint when using proxies and multiple-forwarding as it is usually the case in a cloud environment. EDIT: Yes, in AWS environments, the SSL is usually done on the proxy and then internally, only HTTP is used. But I am pretty sure this is handled correctly (host rewriting and such) in order for PW to function correctly. What is your "HTTP hosts whitelist" configuration?
    2 points
  8. Happy 1st of September! Now that we've got the new main/master version out and running smoothly, I've been catching up with some client work this week. I'll need to do some of that next week too. But we'll also be fine tuning the core and fixing anything that comes up in issue reports. We may have have another master version out with these kinds of minor updates before digging into more major updates, feature requests and PRs on the dev branch this month. If you've not yet upgraded to 3.0.226 yet, I'd encourage you to give it a try. So far all reports have been positive and I've not heard of anyone running into any upgrade issues yet. Thanks and have a great weekend!
    2 points
  9. I've not come across this before but in the default install for PW3.0.226 if you add some HTML into _main.php template file: <div id="content"> <?php // template code rendered here by PW ?> </div> and then add the same html container to the template named file e.g. home.php <div id="content"> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mattis eros vitae metus sodales eget suscipit purus rhoncus. Proin ultrices gravida dolor, non porttitor enim interdum vitae. Integer feugiat lacinia tincidunt. Nulla laoreet tristique tristique. Sed elementum justo a nisl elementum sit amet accumsan nisi tempor. Nulla quis eros et massa dignissim imperdiet a vitae purus. </p> </div> when rendered I dont get double content containers but just one with the Lorem ipsum... What is this behaviour called??? Is there settings for it? Can it be disabled? confusing as hell.
    1 point
  10. Those template files need a comment that explains what is going on. I opened a GitHub issue: https://github.com/processwire/processwire-issues/issues/1806
    1 point
  11. Hello, Reading the documentation this is the expected behavior: But you can use get parameter: /concepts/?fileName=My_Test_File4$$$.pdf wire()->input->get->text('fileName'); It's maybe better to use an url encoded PDF name with php urlencode(): /concepts/?fileName=My_Test_File4%24%24%24.pdf urldecode(wire()->input->get->text('fileName'));
    1 point
  12. Hi @fruid At the moment it looks like you are grabbing all pages (with parent id = 1) and iterating through them individually to find the ones matching the required menu. With a small number of pages this may well be perfectly fine, but if there are hundreds/thousands of pages it's not very efficient. It would be better to just grab only the pages in the required menu - unfortunately you can't (currently?) do that with a PW selector, but you can use a MySQL query directly combined with a PW find selector -- check out the following thread:
    1 point
  13. Thank you for your interest and input. The question about JS errors was particularly helpful: apparently a script from the old ListerPro version got stuck in my browser - clearing the browser cache helped. Embarrassing beginner's mistake ? Markus
    1 point
  14. @Jim Bailie, I updated the styling in a new release of the module. You don't want to encode entities when you set the value or you'll get a double-encoded string when you get uploadName when output formatting is on.
    1 point
  15. v0.2.0 is released, which adds support for multi-language, custom fields and upload name when a file is replaced.
    1 point
  16. I've just tested this: $home->of(false); $home->rockfrontend_favicon->add(__DIR__ . "/Test$$$.png"); $home->save(); bd($home->rockfrontend_favicon->uploadName()); Which resulted in this: So that confirms that uploadName() does not work for API added files.
    1 point
  17. Tracy Debugger for ProcessWire The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger Modules Directory: http://modules.processwire.com/modules/tracy-debugger/ Github: https://github.com/adrianbj/TracyDebugger A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
    1 point
×
×
  • Create New...