Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/01/2017 in all areas

  1. I do believe this is to do with Let's Encrypt SSL certificates and I don't think this is anything to worry about. Malware with ProcessWire, pah
    4 points
  2. Or if not I do believe this is put their in readiness by your hosting company that you may wish to. It may even be enabled without you knowing, try going to the https:// version of your site and see what it says.
    2 points
  3. I think @cb2004 is right - see https://serverfault.com/a/795474/129338 (towards the end of that answer).
    2 points
  4. "Also worth mentioning is that each field template file receives all of ProcessWire's API variables. It also receives....": https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/#processwire-3.0.5-introduces-field-rendering-with-template-files Since no additional variables can be passed to the method, the workaround shown by @Ivan Gretsky is the recommended way to do it.
    2 points
  5. Hej, there is also this topic about synonyms, I put my few cents there already: Actually I believe whatever you plan is covered there ... also I am not entirely sure where you are stuck.
    1 point
  6. Hi @Mike Rockett -- @melody and I took a look at this this morning. It looks like this is an issue with 0000-00-00 00:00:00 null dates in our strict MySQL environment. After replacing the NULL_DATE constant at the top of the module file with 'CURRENT_TIMESTAMP' and replacing the 0000-00-00 00:00:00 dates in Blueprints/schema-update-v2.sql and Blueprints/schema-update-v3.sql with the same, the problem went away after re-installing the module. Hope that helps.
    1 point
  7. Based on @diogo's idea above, I impleneted a version which works for multiple Page Tables of the same Page, and only adds the extra button to the top if the table is not empty (i.e. exists): $(document).ready(function () { /* * Use both clonePageTableAddButton(); and bind("DOMSubtreeModified"... below so that it * works with multiple PageTables on the same page. */ clonePageTableAddButton(); //Adds the button again, when AJAX updates the table: $(".InputfieldPageTableButtons").closest(".InputfieldPageTableContainer").bind("DOMSubtreeModified", function () { clonePageTableAddButton(); }); }); /* * Adds a clone of the PageTable field's Add New button to the top of the table */ function clonePageTableAddButton() { $(".InputfieldPageTableButtons").each(function () { $myButtons = $(this); $myTableContainer = $myButtons.closest(".InputfieldPageTableContainer"); //Only add button when Table is not empty (length != 0) and no button has been added already (length < 2) if ($myButtons.closest(".InputfieldPageTableContainer").find(".AdminDataTable").length != 0 && $myTableContainer.find(".InputfieldPageTableButtons").length < 2) { $myButtons.clone().prependTo($myTableContainer); } }); } I think the non-existence of this button on the top of the table is a major UX issue and it should be treated like a bug in the core. What's your opinion on this?
    1 point
  8. When you create a new product page a reference to some tags get automatically added to the product page, right? Is it your site or you are working with some clients you did not make? What tags are added? It might be that it is done with some hooks. If so, you can check the site/modules folder for some suspicious modules and read through site/ready.php and/or site/init.php - they might be there .
    1 point
  9. Hey, @webhoes! I did not dive too deep into your code, but: I think you use $inputs instead of $input. I don't see the code for the form which has to include the select and therefore do not see the way that r_selector will ever get into the $input object. You need to sent the form to get the input parameters.
    1 point
  10. There are a couple of topics kind of about this question with working solutions: https://processwire.com/talk/topic/9675-page-field-bidirectional/ https://processwire.com/talk/topic/14689-connect-page-fields/ But there are other ways. Put page reference field on vehicle-template template and add synonyms from there. Create a separate category for vehicle groups and reference category pages from both vehicle-template and vehicle_synonym-template (do you really need 2 of them?) Add a RuntimeMarkup with some easy-to-write php finding and showing the pages you want to back-reference.
    1 point
  11. 1 point
  12. Hello @ARG By design CKEditor is for generating valid and "preferable" HTML stripping out any unwanted markup/code, including PHP. It is configurable, meaning it is possible to specify what gets stripped out and what not, but I do not recommend using it the way you wanted to. You might have better luck with this one: https://modules.processwire.com/modules/inputfield-ace-extended/ An alternative way is to directly edit files in the admin: However, keep in mind that letting users directly edit code is a huge security hole/risk. Only trusted superusers should be allowed to do that. Non superusers should only use Hanna Code (similar to WordPress short codes): https://modules.processwire.com/modules/process-hanna-code/
    1 point
  13. That's a bug. Working on fix now. Thanks for reporting. Good point. I'll rewrite the markup to be more contextual. So, when using a single page field: select/unselect all will not show make add image/page configurable so that it will either do nothing (and let you know page field not empty) or replace the image/page in the field already Make apply action contextual + configurable to show/not show/add page/image and close modal, etc. I'll need to think these through so it may be a while before I am ready
    1 point
  14. hi @AndZyk and thank you for your feedback Yes, you are right in both points. I'll add this on my todo-List. The streched team images are on iOs i guess? If yes, then we are already working on that.
    1 point
  15. Hey, @mel47! Here is the code for the method. Seems like the 3rd parameter is to override default field value, not to provide additional variables to the template: @param mixed|null $value Optionally specify value to render, otherwise it will be pulled from this $page. Did not try this, but you probably can do this to have additional variable in the field template context: // main template $page->$sizeColumn = 2; $content .= $thanks_page->render('images', '/images_column'); // images_column.php foreach($value as $image) { echo " <article class='column is-{$page->sizeColumn}'> .... }
    1 point
  16. Thanks, is this something i can setup in procache or processwire? Or must i do this in the HTaccess? Edit: i found it on Setup > template
    1 point
  17. Hi @melody - thanks for the post. This has popped up before, and still not sure as to why. When it happened, I asked Zeka to delete the last_hit column and refresh the modules. It turns out that he had to delete the process_jumplinks_nf table as well, and it started to work properly. Why that is the case, I still do not know... You can follow the brief thread from here to see what happened: Let me know if those steps work for you. You might land up having to add the nf table manually and increasing the schema version in the module's configuration via phpMyAdmin or whatever tool you use to manually edit DBs.
    1 point
  18. This describes a kind of liberty ... (this is why I find Processwire so attractive).... but... ..''Is the technology an instrument of liberation or enslavement?'' You have four hours. GO ! Just joking Thank you for the answers: each of them open up the door a little more.
    1 point
  19. Had to report back and say that in a multi-site environment, where all the sites are using the same ProcessWire core, it is possible to "share" modules by the method listed above, with no need for symlinks! $config->paths->siteModules = $config->paths->root . 'shared/modules/'; $config->urls->siteModules = $config->urls->root . 'shared/modules/';
    1 point
  20. I can guess that 403 errors are thrown by the server, not PW. Here are the conditions for that in stock .htaccess file. Maybe you named your dev site folder without the "site-" prefix?
    1 point
  21. Great site and nice feedback by your client. There is not much to say except, that the usage of responsive images could improve the experience on retina displays. Also could the logo be replaced with an SVG in my opinion. Maybe it is just me, but could it be that the team images are a little bit stretched? I only watched the site on mobile so far. Regards, Andreas
    1 point
  22. Another option is the functions API: https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api which lets you do things like: pages("template=basic-page")
    1 point
  23. Hi @Sérgio Jardim I'm looking for this functionality, too. Did you actually get this working, where image resizes are uploaded to S3? It seems the module is perhaps no longer being developed, but it still seems to work in PW 3 - I'd like to enhance at least my copy of it. Thanks
    1 point
  24. Just came across this issue in 3.0.62 and glad to find @Soma's workaround. Not sure if it's caused by the clone function as the pages are created by a client, but highly possible. Hope @ryan can fix this soon, maybe with @LostKobrakai's fixer module. Thx.
    1 point
  25. Visual Page Selector version 003 (released (07/07/2017) Happy to announce that the latest release of Visual Page Selector is now available for Download/Purchase. Documentation is also complete! This is a major update. Visual Page Selector can now be used as a normal but enhanced page field! There are 2 views each for inputfield (page edit) and the page selector modal. These can be combined to suit your workflow as explained in the docs here. As a normal page field, you can opt to view the selected pages as a simple list and add pages to your page field using a ProcessWire Lister modal. This opens so many possibilities, including nuanced differentiation of pages to add to your page field, for example, making use of Lister columns and other page properties. For those that want to use Visual Page Selector as a 'one-page-per-image' solution, you can carry on as normal, with the added benefit of different view combinations In page edit, selectable pages are not loaded directly in the Inputfield allowing you to have hundreds of thousands, nay, unlimited numbers of selectable pages without experiencing any slowdowns (@note: What you see in the screenshot below is not AsmSelect or PageAutocomplete; just a custom list that blends in with the rest of ProcessWire). Please note that there were a few inevitable changes to the field settings. The Lister settings are now separated into individual settings. In addition, there was a typo in the 'vps-delete-page' permission. That should be 'vps-delete-pages'. Due to these, if upgrading from version < 3, please test thoroughly and fix any brokenness before using in production. If you need any help please let us know. Changelog Lister view for an enhanced page field experience. Combine different views as you wish. Faster Inputfield load times in page edit. UX changes. Lister and list view demo
    1 point
  26. Thanks for your points. It indeed makes less difference for low traffic site where shared hosting is the common choice. I always use cheap VPS plan in DigitalOcean or Linode to gain the largest control for less money so I forgot about shared hosting for long..
    1 point
  27. niiiiiice, glad it worked right away! You're very welcome! also let's worship Ryan and contributors, for the brilliant architecture of processwire making it possible! ^~^
    1 point
  28. blynx, your solution is definitely ingenious – in total and detail! I played around with all parts and everything was working immediately without any issues. Standing ovations! What I like the most is the relation of maximum result with minimum effort – this reveals true masters. To get the synonym and sync problem solved with a few lines of code in very short time is more than I dared to dream of. So another giant thank you!
    1 point
  29. Hej, I think thats no problem. When you have the link between synonyms and entries like I described, it is easy to retrieve the tags from the entry when you query a synonym: <?php # # "linked_entry" is the page field on the synonym holding the # reference to the entry. # synonyms have no tags field. # // get the tags of synonyms $a_synonym = $pages->get("parent=synonyms, name=airplane"); $synonyms_tags_via_its_linked_entry = $a_synonym->linked_entry->tags; // edit: in one line: $synonyms_tags_via_its_linked_entry = $pages->get("parent=synonyms, name=airplane")->linked_entry->tags; // find synonyms with tags $those_synonyms = $pages->find("parent=synonym, linked_entry.tags=some_tag|another_tag"); You just need to tag your entries and through the link in the synonym its very easy to handle anything tag related. But the syncing you describe would still be possible - though I don't think you need that if the tags of the synonym and the entry will always be the same. Regarding hooks: Have a close look at https://processwire.com/api/hooks/ and this when you got the idea: https://processwire.com/api/hooks/captain-hook/ and also search the forum for more examples! This is a rough sketch of a hook that might sit in the init.php / ready.php file. It may work out of the box, but I am still in the trial and error phase when it comes to hooks and haven't teste this one but it should work more or less somehow like this: <?php # keep synonyms linked_entry in snyc with entries synonyms wire()->addHookAfter('Pages::saved', function($event) { $page = $event->arguments(0); // what page was the hook called on? $template = $page->template; // what template has that page // see if the saved page is an entry because this hook is called on every page save if($template == "entry") { /* $related_synonym_pages = $pages->find("parent=synonyms, name={$page->synonyms}"); foreach($related_synonym_pages as $syn) { $syn->setAndSave("linked_entry", $page); } */ // haha, this happens to me all the time, the following should be simplier =) foreach($page->synonyms as $syn) { // get the set synonyms directly from the page $syn->setAndSave("linked_entry", $page); // set this page to that synonym } } }); So, this is the hook for: Edit synonyms on entry page, save it → hook updates the related synonyms which are set on the entry page enjoy
    1 point
  30. Okay, I’m nearly convinced now. The steps you outlined in your last paragraph seem to be the most plausible way to get where I want to. Sadly, I found another stumbling stone in the meantime: the tags. There will hardly be the need to list all database entries, the most frequent rendered lists will be search results and entries matching tag X. Approximately I will exclude synonym pages from the search, so the main problem will be the tags. If 'plane' is tagged with 'traffic' and 'transport', the synonyms 'ufo' and 'flying saucer' should be tagged with both tags too. So I should better not only give the synonym page a parent field, but a tags field too. Which leads me to hopefully my last questions: Is it possible to sync the content of the tag field like the following? Creating a new synonym creates the according synonym page and copies the content of the root entry’s tags field to the synonym’s tag field. When editing the tags field content of the root entry, all connected synonym tag fields get updated too. You mentioned the option to create links to parent pages automatically via hook. How do I do this? In case of the tags I work with the 'page' field type and unfotunately I don’t know how to run automated tasks when filling a field with content. Where should the hook function reside? Edit – a few hours later Meanwhile I’ve read (nearly) everything about hooks and where to place them. I think I will get the autolinks done as well as the tag syncs, so both questions are answered. I want to thank you again, blynx – you showed a lot of patience and helped me a whole piece further, that was very friendly.
    1 point
  31. Hm, well - regarding "thousands of pages": There was this blogpost once: https://processwire.com/blog/posts/find-and-iterate-many-pages-at-once/ about the new findmany() function: https://processwire.com/api/ref/pages/find-many/ - but from my understanding, this only applies if you really want to retrieve and do something with that many pages. In an encyclopaedia application you will of course search inside of manymany pages but you mostly only retrieve one or a small subset. I would assume (though I am not an expert) that the findMany() case does not apply here. The actual link will actually be the other way around. The synonyms don't know anything about their relation to someone else. That's why I was referring to the tagging: You have the entries and they point to synonyms: plane → aircraft, ufo, flying saucer, … but with your application logic you can create that link. Assuming: entries plane car fork ... synonyms airplane automobile ufo flying saucer ... Then, for example you get a query for "airplane": <?php $incoming_query_term = "airplane"; $entry = $pages->get("name=$incoming_query_term, parent=entries"); // see if there is an entry if($entry instanceof NullPage) { // no entry? $synonym = $pages->get("name=$incoming_query_term, parent=synonyms"); // get the synonym $entry = $pages->get("synonyms=$synonym, parent=entries"); // get the entry which has that synonym in its synonyms page field // eh, should also work, combined and short: $entry = $pages->get("synonyms=[name=$incoming_query_term, parent=synonyms], parent=entries"); } I guess your tagging should work kind of the same? edit: Mh, reread your original post - I think it would be more complicated to have the synonyms in a field. Maybe it feels stupid to have extra pages for the synonyms but I think it is the better solution. The downside is maybe that database queries take longer - but since processwire has the findMany() method now I don't think it is any problem to handle that many pages. One consideration might be helpful for rendering the list: Without this you would have to retrieve the entry for a synonym for every synonym by code like $pages->get("synonyms=THIS_SYNONYM.id") ... You could link from the synonyms to the entries by giving them a page field, too, where you store the linked entry. You could create that link with a hook automatically every time a synonym is created, so that every synonym has an entry-link. The problem here is to keep the links coherent. But then it would be very easy to render the list: Find all entries and all synonyms to one PageArray (probably paginated then, findMany?). Sort by name. Render them accordingly to their type: Entries become direkt links to the entry, synonyms become that "aircraft → plane" output.
    1 point
  32. Mh, The synonyms field could be a simple textarea field "synonyms" on the "root word" with a synonym in each line. And when you are looking for the root page for a synonym: <?php $pages->find("synonyms*=requested_synonym") // or ->get() Would this do it? But I'd say having synonym pages might give you more flexibility - maybe you want to add properties to synonyms later .. who knows ^^. I don't think it is a downside having lots of "empty" pages. I probably would store all synonyms in a synonyms folder page as a storage and having a page field on the actual entry with that inputfield: http://modules.processwire.com/modules/inputfield-page-autocomplete/ It'll basically just be like tagging and one doesn't have to think much about those tag / synonym pages. They can be hidden somewhere. Finding correlating pages would work like above. (Not sure about the *= though, works with just = on a setup I have). This might also prevent you from some errors since every synonym is an actual entity in the system.
    1 point
  33. You could add them with some JS with Admin Custom Files http://modules.processwire.com/modules/admin-custom-files/ Something like: $(".InputfieldPageTableButtons").each(function(){ $myButtons = $(this); $myTableContainer = $myButtons.closest(".InputfieldPageTableContainer"); $myButtons.clone().prependTo($myTableContainer); }); (written in the browser and not tested)
    1 point
  34. You have moved those pages around from amother parent? Move those out of the parent and then back in. Works?
    1 point
  35. Here's how it worked for me in CKEditor (in case you persist on this route - but I would go for Hanna Code as Adrian suggested. As usual, the "culprit" is our friend HTML Purifier (read from here up to and including Ryan's comment here about its pros and cons before deciding whether to implement #5 below!) For iframes, the Extra allowed content seems to have no effect - btw, the correct syntax here is for example, div(*) not div[*] Add 'Iframe' (note the spelling) to your CKEditor Toolbar Leave ACF on No need to switch the field's "Content Type" from "Markup/HTML" to "Unknown" Turn HTML Purifier off (gasp! ) Enjoy your embedded video
    1 point
×
×
  • Create New...