Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. I don't think PW frontend-editing will work like that. If the images were placed in a WYSIWYG field, FEE would work. But files used like that in a PW template are another matter.
  2. I guess those methods are meant to be used only in the admin, e.g. if you are building your own module. $inputfield = $modules->get('InputfieldText'); If you would set up your form like this in the frontend, you could probably use all methods from the docs. But I'm not sure you could "clone" your already existing backend inputs and re-create in the frontend. I understand that's what you're trying to do?
  3. https://processwire.com/api/ref/inputfield/#pwapi-methods-other Did you try contentClass or wrapClass?
  4. I just noticed that PW will output frontend-editing markup, even if I output JSON. Is there a way I can disable that, from inside my template? I use classic switch/case statements and URL-segments to output different content, HTML + JSON, in the same template. I know that my JS modules will not see all that extra markup, and guest users neither. [{"title":"Joe Doe","firstName":"<span id=pw-edit-1 class='pw-edit pw-edit-InputfieldText' data-name=firstName data-page=1161 style='position:relative'><span class=pw-edit-orig>Joe<\/span><span class=pw-edit-copy id=pw-editor-firstName-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>Joe<\/span><\/span>","lastName":"<span id=pw-edit-2 class='pw-edit pw-edit-InputfieldText' data-name=lastName data-page=1161 style='position:relative'><span class=pw-edit-orig>Doe<\/span><span class=pw-edit-copy id=pw-editor-lastName-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>Doe<\/span><\/span>","teamEmail":"<span id=pw-edit-3 class='pw-edit pw-edit-InputfieldEmail' data-name=teamEmail data-page=1161 style='position:relative'><span class=pw-edit-orig>akbari@inspire.ethz.ch<\/span><span class=pw-edit-copy id=pw-editor-teamEmail-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>joe.doe@foo.ch<\/span><\/span>","office":"<span id=pw-edit-4 class='pw-edit pw-edit-InputfieldText' data-name=office data-page=1161 style='position:relative'><span class=pw-edit-orig>PFA E 91<\/span><span class=pw-edit-copy id=pw-editor-office-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>PFA E 91<\/span><\/span>","phone":"<span id=pw-edit-5 class='pw-edit pw-edit-InputfieldText' data-name=phone data-page=1161 style='position:relative'><span class=pw-edit-orig>+41 44 123 45 67<\/span><span class=pw-edit-copy id=pw-editor-phone-1161 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>+41 44 123 45 67<\/span><\/span>"}] But when working on a PW site, it would be cool to somehow not see this. Is there a setting for this? Do I have to add something to my selector?
  5. I didn't integrate Disqus so far in any PW site (or anywhere else, for that matter), but I guess this very fine tutorial should get you going: https://abdus.co/blog/creating-a-simple-and-configurable-module-for-processwire/ Especially the "Building a configuration page" chapter.
  6. Always do backups before manually changing something in the DB. I never touched the caches DB-table. I only delete assets/cache/ stuff from the file-system if I need to (rarely). Perhaps delete those file-caches too and it will then try to re-create all DB-caches?
  7. Not sure about repeaters, but to find all pages that use template basic-page, you could do this: SET @tid = (SELECT id FROM templates WHERE name='basic-page'); SELECT DISTINCT p.id, p.name FROM pages AS p, templates as t WHERE p.templates_id = @tid or this (include page titles) SET @tid = (SELECT id FROM templates WHERE name='basic-page'); SELECT DISTINCT p.id, p.name, ft.data AS title FROM pages AS p, templates AS t, field_title AS ft WHERE p.templates_id = @tid AND (p.id = ft.pages_id)
  8. What a stupid host... Well, in that case just remove those lines instead of commenting them out (perhaps make a backup copy for yourself first, in case you decide to switch to another hosting company sometime...)
  9. Nice. I like the bold graphics. And good use of animated cat pictures at the end of the quiz I'm looking forward to using ProField Textareas myself.
  10. btw, if you want to see something like this in action, check out this: Clicking around, I was first puzzled how certain pages were assembled.
  11. Does that mean: 10k PW-pages with 5 fields each? Multi-lang = how many? 2, 3, more? I don't quite understand this part: Does that mean your tests are done in a PW-module, and previously you only used it in the frontend? In any case, that's good news. re: pro/free I agree. And (if it's reasonably priced) I'd be happy to buy a pro version, even if I wasn't sure if I would have a specific need in a client project right now. re: cache mentioned above Are you talking about caching the 10k pages? Or do you save the queried results (JSON?) as a file first, and then use this saved version as DT data-source? I use the latter method for a custom search that features autosuggest/-complete + fuzzy search, where the generated JSON is around 500-600kb. It speeds up the whole thing tremendously.
  12. Big thanks to @flydev - he offered to help via TeamViewer. However, when I installed the latest version on the remote server, it didn't work. I set it to 30 seconds, with LazyCron, and nothing happened. I clicked around several pages in FE + BE... Only via manually triggering a backup via package manager did I get a backup. And even then, the entire site was frozen. You couldn't do anything (front- or backend), in the time it was creating the backup. I understand such a process takes lots of resources, but is this expected behavior?
  13. Hello and welcome to the forum. I'm not sure I understood your question. You have a database, or database-tables unrelated to PW, that you want to somehow query and then display inside PW? Please re-phrase your question, so we can give you more infos + tips.
  14. @flydev Yes, I try it out locally first. So: vendor, site + wire are all on the same level? The local backup (triggered now twice with logout) didn't work. See screenshot of current module config.
  15. @flydev I have installed 1.1.7 now. Not sure yet if it works (set to lazyCron, every hour). Meanwhile, I installed GoogleDrive SDK via Composer. After reloading the module config page, I can't click on GoogleDrive option. Where do I put the vendor folder from Composer? And why is https://github.com/flydev-fr/duplicator-google-drive an error 404 page?
  16. What could go wrong, if I tried Duplicator already on two PW installs (both 3.0.81 or thereabouts), both on a Windows machine (local) + remote (*nix), but nothing happens? I chose the default settings + LazyCron. Checked the error logs also - nothing.
  17. There's a similar discussion here you might want to check out:
  18. The Admin on Steroids module has that feature (and tons more) - you can choose to have CTRL + S to save the page.
  19. You might want to change the instruction text: You don't login @ wire/, but processwire/ Speaking of login... I used the mentioned username + password, but it always says "login failed". Are you sure it's correct? I had to use this to change pass + login:
  20. First of all thanks for offering this to the community. I am curious though: Why did you include the entire wire folder in the package as well? Normally, people create a site profile. I never ever touched the wire/config.php file, only site/config.php.
  21. It's a bit tricky, without knowing more. Since the error msg says "cannot redeclare", did you try to bootstrap with include_once instead of include?
  22. What is that line? _functions.php:59 Do you have PW namespace in _functions.php? <?php namespace ProcessWire;
  23. Any news on this? A beta version maybe under the Christmas tree?
  24. dragan

    JSON POST woes

    I'm puzzled by something I thought would be rather easy: I want to send a request to a PW page. It's POST, and I define a header, and send data as JSON. I need to send data in the following format: $ POST https://mysite.com/foo/bar/ {"headers": {"Authorization": "Bearer API_KEY", "Content-Type": "application/json"}, "body": {"fields": {"Name": "<get name>", "Department": "<get team>", "Home Address": "<get address>", "Phone #": "<get phone>", "Personal Email Address": "<get email>", "Birthday": "<get birthday>", "Date Added": "<call>currentDate</call>" }}} This is supposed to be sent via a Chatbot engine (Dexter). In the PW page that should handle this, $_POST is always empty, as is $_REQUEST. Same for PW's $input or if ($config->ajax) {}. I get the header, but no data. So I dug deeper, and tried this: @ini_set("allow_url_fopen", true); @ini_set("always_populate_raw_post_data", true); $data = json_decode(file_get_contents('php://input'), true); $d = print_r($data, true); // I store this, along with the header infos and timestamp in a PW page-field (instead of using file_put_content) I checked page permissions, I made sure I use pagename/, i.e. with trailing slash only, to avoid stripping the header away due to redirects (which somebody in an older forum thread once highly suggested). I tried to send the same stuff that the chatbot does via CURL. Nothing. PW error logs don't report anything (site is still in dev-mode). PW 3.0.81 - everything else runs just fine. Any ideas what I should change? Any more PHP/Apache settings maybe? Help is highly appreciated.
×
×
  • Create New...