Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/14/2016 in all areas

  1. This module comes in handy when you need related pagefields that are dependant on each other. Example: you have a sports team and team members belonging to that team. you need 2 fields: one on the team-page, one on the member-profile. this module keeps both fields in synch. Other examples would be hierarchical company structure or any other kind of membership relation. Demo: settings in this example: Gitlab: https://gitlab.com/baumrock/PagefieldPairs Modules Directory: asap only tested on PW3 and reno theme. Please test it faithfully before using it. please report any issues
    4 points
  2. @Rudy Have a look at the WireMailBranding module by @Martijn Geerts. It allows custom html templates in outgoing email - but I've never used it in your situation so I can't say if it will do the job or not. Please have a try, and let us know how it goes.
    3 points
  3. foreach($page-children(…) as $key => $post) { if($key == 3){ // Render static content after 3 posts } // Render post as normal }
    3 points
  4. Just uploaded v104 that adds ctrl+u source mode toggle to CKEditors (CKEaddons keystrokes), plus a new CKEditor plugin Keep TextSelection. The latter works with the non-dialog source mode only (plugin limitation). Also contains bernhard's request to allow field edit links on non-pageedit pages, and a possible fix for the PHP 5.3.8 issue reported by @Noboru which is probably due to the missing support for closures - if so, I'll rewrite all of them in the module.
    3 points
  5. Tried it on another machine and the icons are there. Suspect it's because my main PC has a touch screen and PW falsely identifies it as a mobile device or something like that. Will file a GitHub issue for this because there are many large screen touch devices out there with mouse attached and PW should account for this.
    2 points
  6. It's not working quite right in Firefox. The data-url and data-editurl attributes are for the neighbouring breadcrumb item. In the screenshot below the Home item has the data- attributes for the "Four" page.
    2 points
  7. Great to see these types of modules appearing. Similar functionality to ConnectPageFields? I was working on my own implementation but seems that's no longer necessary!
    2 points
  8. 2 points
  9. The stackoverflow post relates to Microsoft SQL Server, not MySQL. Searching for Unicode characters works fine in PW. If your characters get stripped, my bet is that they aren't valid utf8, which means the script itself is in another encoding, and/or the webserver announces a different one. I just tested by creating a page titled "你好 World". Running <?php foreach($pages->find('title%=你好') as $p) { echo $p->id . ": " . $p->title . PHP_EOL; } returned exactly that one entry as it should. To check, save your test code as a script and set your editor to utf8-encode it. Don't trust the command line. If that works, check the encodign headers of the webserver using the developer console (F12).
    2 points
  10. BTW, to update pages after they are added to a PageTable field I found one approach, and that is to hook the field save done in InputfieldPageTableAjax.php. The reason you want to hook this for added pages rather than the save of the container page is that the editor could add pages to the PageTable field and then leave Edit Page without saving the page, meaning your hook wouldn't fire. You have to place the hook in init.php - this hook doesn't fire for InputfieldPageTableAjax.php if you place it in ready.php (would love to know why). $this->pages->addHookAfter('saveField', function($event) { $page = $event->arguments('page'); $field = $event->arguments('field'); if(is_string($field)) $field = $this->fields->get($field); if($field->name !== 'my_pagetable_field') return; $new_value = $page->{$field->name}; $pages_added = $new_value->getItemsAdded(); // here save something about $page to a field in $pages_added }); To update pages after they are removed from a PageTable field you would hook Pages::saveReady for the container page and look for changes to the PageTable field, doing something similar to this section of ConnectPageFields.
    2 points
  11. Mh, what kind of field is author? If thats a Page field, try author.title=... Also, what FieldType is alias? I assume Text?
    2 points
  12. Updated 2018-05-06: Version 2.0.0 released Updated 2017-03-27: Version 1.1.3 released Updated 2016-04-11: Version 1.1.2 released Updated 2016-02-26: Officially in the module directory! http://modules.processwire.com/modules/webmention/ Updated 2016-02-25: Version 1.1.0 is now released. It's been submitted to the module directory so should appear there soon. In the meantime, it's available on GitHub: https://github.com/gRegorLove/ProcessWire-Webmention. Please refer to the updated README there and let me know if you have any questions! ------------ Original post: This is now out of date. I recommend reading the official README. I've been working on this one for a while. It's not 100%, but it is to the point I'm using it on my own site, so it's time for me to release it in beta. Once I finish up some of the features described below, I will submit it to the modules directory as a stable plugin. For now, you can install from Github. It works on PW2.5. I haven't tested on PW2.6, but it should work there. Feedback and questions are welcome. I'm in the IRC channel #processwire as well as #indiewebcamp if you have any questions about this module, webmention, or microformats. Thanks to Ryan for the Comments Fieldtype which helped me a lot in the handling of webmentions in the admin area. ProcessWire Webmention Module Webmention is a simple way to automatically notify any URL when you link to it on your site. From the receiver's perspective, it is a way to request notification when other sites link to it. Version 1.0.0 is a stable beta that covers webmention sending, receiving, parsing, and display. An easy admin interface for received webmentions is under development, as well as support for the Webmention Vouch extension. Features * Webmention endpoint discovery * Automatically send webmentions asynchronously * Automatically receive webmentions * Process webmentions to extract microformats Requirements * php-mf2 and php-mf2-cleaner libraries; bundled with this package and may optionally be updated using Composer. * This module hooks into the LazyCron module. Installation Github: https://github.com/gRegorLove/ProcessWire-Webmention Installing the core module named "Webmention" will automatically install the Fieldtype and Inputfield modules included in this package. This module will attempt to add a template and page named "Webmention Endpoint" if the template does not exist already. The default location of this endpoint is http://example.com/webmention-endpoint After installing the module, create a new field of type "Webmentions" and add it to the template(s) you want to be able to support webmentions. Sending Webmentions When creating or editing a page that has the Webmentions field, a checkbox "Send Webmentions" will appear at the bottom. Check this box and any URLs linked in the page body will be queued up for sending webmentions. Note: you should only check the "Send Webmentions" box if the page status is "published." Receiving Webmentions This module enables receiving webmentions on any pages that have have "Webmentions" field, by adding the webmention endpoint as an HTTP Link header. If you would like to specify a custom webmention endpoint URL, you can do so in the admin area, Modules > Webmention. Processing Webmentions (beta) Currently no webmentions are automatically processed. You will need to browse to the page in the backend, click "Edit," and scroll to the Webmentions field. There is a dropdown for "Visibility" and "Action" beside each webmention. Select "Process" to parse the webmention for microformats. A better interface for viewing/processing all received webmentions in one place is under development. Displaying Webmentions (beta) Within your template file, you can use `$page->Webmentions->render()` [where "Webmentions" is the name you used creating the field] to display a list of approved webmentions. As with the Comments Fieldtype, you can also generate your own output. The display functionality is also under development. Logs This module writes two logs: webmentions-sent and webmentions-received. Vouch The Vouch anti-spam extension is still under development. IndieWeb The IndieWeb movement is about owning your data. It encourages you to create and publish on your own site and optionally syndicate to third-party sites. Webmention is one of the core building blocks of this movement. Learn more and get involved by visiting http://indiewebcamp.com. Further Reading * http://indiewebcamp.com/webmention * http://indiewebcamp.com/comments-presentation * http://indiewebcamp.com/reply
    1 point
  13. Sometimes I feel I write the readme in vain Add long-click and ctrl+click actions to breadcrumbs: if enabled, long-click on a breadcrumb item will open the corresponding front-end page in a new tab/window, and holding the Ctrl key when clicking on them will navigate to their edit screen. I know it's not too user-friendly but it's there and working
    1 point
  14. Hi tpr, I can install and use 1.0.4 successful on my PHP-dinosaur ;-) Thanks!
    1 point
  15. ProcessWire Image description field has no limits by default.
    1 point
  16. From the video demo it looks great, so good job regardless!
    1 point
  17. oh noooooo then it seems i was working too much on the todo-module it's the first pw weekly i missed since a while... anywhay. it was not too much effort...
    1 point
  18. 1 point
  19. oh man... exactly the same... i knew this would happen. not enough time to follow the forum and it seems it was not on pw weekly also in this thread it was not mentioned thanks for your hint...
    1 point
  20. 1 point
  21. @s3nior If you want to split the content of the field up by lines, you can use the PHP explode() function with "\n" (probably) as the $delimiter; something like this... $lines = explode("\n", $image->description); // $lines is now an array of strings, indexing starts at zero $second_line = $lines[1]; echo "Second line is: $second_line"; Hope that helps.
    1 point
  22. @mel47 it's really easy to write any kind of custom import script so there are no limits maybe thats of interest to you
    1 point
  23. Check this discussion, can get you started :
    1 point
  24. Looks like I didn't test my module for single Page fields. Will get that sorted in an update soon. In the meantime just set the 'featured_on' Page field to 'multiple' and it should work.
    1 point
  25. but the returned json works... anyway. someday, I will be good at programming ;-)
    1 point
  26. I don't know that it will, because the default behaviour for removing pages from a PageTable field involves marking them for deletion (uses JS) and the deletion takes place when the container page is saved. Pages don't disappear from the inputfield when marked for deletion, as opposed to the way pages appear when they are added. But I can think of some alternatives. Seems like what you want is to have some featured Quote pages: you mark a Quote page as 'featured' when editing that page, and when editing the Home page you can see all the Quote pages that were marked 'featured'. Option 1: use a 'featured' checkbox on the Quote template. Use a RuntimeMarkup field on the Home template to list all the featured pages, maybe with a link to Edit Page for each featured Quote to make it easy to 'unfeature' a page. Option 2: Use the ConnectPageFields module. Create a 'featured_quotes' Page field on the Home template (multiple, allows pages using Quote template, uses AsmSelect inputfield) . Create a 'featured_on' Page field on the Quote template (single, allows pages using the Home template, uses Checkboxes inputfield). Link these Page fields in the ConnectPageFields module. Now you can add/remove featured Quotes when editing the Home or a Quote page.
    1 point
  27. @tpr, I'm not loving the bold styling applied to active/open items in PageList instead of the default yellow background. Can you make this optional please?
    1 point
  28. Unless you need the reference number inside PageEdit for some reason (e.g. an inputfield dependency, and for that there are workarounds using RuntimeMarkup or FieldtypeReference), it should be possible to get the reference using the API in your template. You either get the page via the container page's PageTable field, or in the page's template you do similar to what you showed in your first post: $container_pages = $pages->find("my_pagetable_field=$page");
    1 point
  29. Oh, why I don't know things so simple... Thanks!
    1 point
  30. Template Notes Adds a "Help" tab to pages for notes and instructions on the current template used. You can add content by simply putting a html or markdown file in /site/templates/notes/ the module will automatically load that file if it finds one and adds a "Help" tab to the page edit form. Name the files using the template name. You can use html or markdown to write the help text. - /site/templates/notes/[tplname].html - /site/templates/notes/[tplname].md To style the content you can specify a custom css file url you add to the module settings. http://modules.processwire.com/modules/template-notes/ https://github.com/somatonic/TemplateNotes This module was quickly written after seeing a wish-list request by Joss http://processwire.com/talk/topic/5016-help-tab-for-template/
    1 point
  31. Just a follow up on the issue of Tracy suppressing these notices. I have posted a Github issue here: https://github.com/nette/tracy/issues/233 Note that you will see the actual original error message if you have your browser dev console open, although obviously this is not ideal and I really want it shown in the Errors panel on the AJAX bar in Tracy.
    1 point
  32. If you want to teach your kids programming or just want to put together games easily, then GDevelop is highly recommended: http://compilgames.net/
    1 point
  33. @SiNNuT, if we stay in the non-proprietary category, you might be interested by http://sk1project.net/.
    1 point
  34. Elixir / Phoenix - A really great functional programming language running on the erlang VM. Damn fast and with great concurrency tools. Phoenix is the corresponding webframework (inspired by rails, but also not really)
    1 point
  35. I found the culprit: debug mode. I realized that when the Tracy debugger was on, everything was fine, even not logged. This debugger reroute Processwire debug mode, I presume... So I switch off the debug mode in config.php and voilà! Remains this bug...
    1 point
  36. include ? ob_start(); include 'partials/sharedtemplates/signup-form-formbuilder.php'; $out .= ob_get_clean();
    1 point
  37. Hi, One way to solve such issues is to prepare separate collentions to be outputted into both the <head> and the footer, like this: https://github.com/NinjasCL/pw-ghost/blob/c192001567b73063dac3cdae72e6e19bbf08e632/templates/_main.php#L35-L38 so when you need something extra on a given page, you just add it to the collection: https://github.com/NinjasCL/pw-ghost/blob/c192001567b73063dac3cdae72e6e19bbf08e632/templates/blog-item.php#L59 more on this: https://github.com/NinjasCL/wire-render-pattern
    1 point
  38. Or use my migrations module, to kinda get the best of both worlds. The ease of the ProcessWire API with the ability to have migrations run/downgraded as needed.
    1 point
  39. just because i needed this again today: if you are dealing with any sort of tags (HTML data) in your fields, than the easiest solution is to base64_encode($var) your data in the export and then base64_decode($var) it in your import. i had to import some pages with inline images today and if you know how to do it, that is also quite easy and straigtforward. the problem is, that you have some html like img src="/site/assets/files/12345/your-image.jpg" in your field and the ID will change after the import! sample export xml - note the tag <pid> holding the old id echo "<?xml version='1.0' ?>"; echo '<pages>'; // find pages $results = $pages->find('parent=/your-parent/'); $results->add($pages->find('parent=/something-else/')); foreach($results as $p): $p->of(false); ?> <page> <title><?= $p->get('headline|title') ?></title> <date><?= $p->created ?></date> <featured>1</featured> <pid><?= $p->id ?></pid> <pic><?= $p->coverpic->first()->httpUrl ?: '' ?></pic> <body><?= base64_encode($p->body) ?></body> <images><?php foreach($p->images as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></images> <files><?php foreach($p->attachments as $file) { echo '<file>' . $file->httpUrl . '</file>'; } ?></files> <gallery><?php foreach($p->gallery as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></gallery> </page> <?php endforeach; echo '</pages>'; die(); and then the import: $items = simplexml_load_file('your-url-of-export-data'); foreach($items as $page) { $p = new Page(); $p->template = 'blogitem'; $p->parent = '/news'; $p->title = $page->title; $p->name = $sanitizer->pageName($page->title, true); while($pages->find('parent='.$p->parent.',name='.$p->name)->count() > 0) $p->name .= '-'; $p->date = $page->date; $p->featured = $page->featured; // get body html and remove root node $p->body = base64_decode($page->body); $p->save(); // change images in body field $re = '/src="\/site\/assets\/files\/' . $page->pid . '\//'; $p->body = preg_replace($re, 'src="/site/assets/files/' . $p->id . '/', $p->body); $p->save(); // add images if(strlen($page->pic)) $p->pic->add((string)$page->pic); foreach($page->images->image as $image) $p->images->add((string)$image); foreach($page->files->file as $file) $p->files->add((string)$file); foreach($page->gallery->image as $image) $p->gallery->add((string)$image); $p->save(); echo 'new page <a href="' . $p->editUrl . '" target="_blank">' . $p->path . '</a><br>'; } die(); just set your ckeditor field settings porperly before your import and all images will be recreated on your new site! remark: this will only replace images from the same page and not any images that are linked from a different page with different page-id. that would need some extra mapping of old-id --> new-id
    1 point
  40. You can set the classes to be used for left, center and right alignment in the configuration settings of ProcessPageEditImageSelect.
    1 point
  41. Under pressure from a client, I had to launch a PW front end user membership site 2 months earlier than the agreed schedule. Never an ideal situ and no time to fully test everything. The client web admin and I were able to monitor the logs, esp the session logs to see who'd logged in and who'd had trouble. We immediately emailed those who'd lost/forgotten/did-not-receive-the-email-with their username. Every single one of those new members emailed back their appreciation for the proactive customer support. What could have been disastrous turned those subscribers into site fans. PW logs are your friends! Thank you Ryan, the PW dev team and every forum/module contributor for delivering such a solid product.
    1 point
  42. i had this problem some days ago and wrote a simple script on both websites. both online on different domains: export on old website: <?php $export = false; if($export AND $input->get->export == 'blogitems') { echo "<?xml version='1.0' ?>"; echo '<pages>'; $parent = $pages->get('/blog'); $results = $parent->children(); //$results = $pages->find('id=3198'); // ohne pic //$results = $pages->find('id=3204'); // mit pic foreach($results as $p): $p->of(false); ?> <page> <title><?= $p->title ?></title> <date><?= $p->blog_date ?: $p->created ?></date> <featured>1</featured> <pic><?= $p->main_slider_coverpic->first()->httpUrl ?: '' ?></pic> <body><?= $p->body ?></body> <images><?php foreach($p->images as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></images> <files><?php foreach($p->files as $file) { echo '<file>' . $file->httpUrl . '</file>'; } ?></files> <gallery><?php foreach($p->gallery as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></gallery> </page> <?php endforeach; echo '</pages>'; die(); } and then the import: <?php $import = false; if($import AND $input->get->import == 'blogitems') { $items = simplexml_load_file('https://www.your-old-website.com/?export=blogitems'); foreach($items as $page) { $p = new Page(); $p->template = 'blogitem'; $p->parent = '/news'; $p->title = $page->title; $p->name = $sanitizer->pageNameUTF8($page->title, true); while($pages->find('parent='.$p->parent.',name='.$p->name)->count() > 0) $p->name .= '-1'; $p->date = $page->date; $p->featured = $page->featured; // get body html and remove root node // $p->body = substr($page->body->asXML(), 6, -7); // ###### update: it's better to use base64_encode($page->body) in your export and then base64_decode($page->body) in your import ##### $p->save(); // add images if(strlen($page->pic)) $p->pic->add((string)$page->pic); foreach($page->images->image as $image) $p->images->add((string)$image); foreach($page->files->file as $file) $p->files->add((string)$file); foreach($page->gallery->image as $image) $p->gallery->add((string)$image); $p->save(); echo 'new page <a href="' . $p->editUrl . '" target="_blank">' . $p->path . '</a><br>'; } die(); } of course that is not bulletproof but it's really simple and you can do whatever you want (export junks by adding start=0, limit=10 or the like to your selector) you can also try adrians batch child editor. or csv importer. but for me the example above worked like a charm ps: try it with limit=1 for testing
    1 point
  43. If there's nothing in the errors.txt the error does happen before pw's error handling kicks in. So probably some error either in config.php (simply checked by adding die() in various places and see if the error persists) or with any autoloading modules or in init.php. Also check your php/mysql/apache versions for any obvious mismatches.
    1 point
  44. Version 1.1.2 is released: http://mods.pw/BC - Updated packaged php-mf2 library to version 0.3.0 - Added config option to automatically monitor a page for approved vouch domains (see below). - Better authorship algorithm support. One of the bottlenecks for the Vouch protocol is "how do you easily manage the list of domains you will accept a vouch from?" In the 1.1.0 release, it was just a text field that you had to manually enter each domain into. As of version 1.1.1, there is a new config field “Vouch whitelist URL.” You can enter the URL of your blogroll or other whitelist. It will be monitored once a day and new domains will be added to the list of approved vouch domains. Links must use the h-card microformat. No domains will be removed from the approved vouch domains. This should help automate the approved vouch domains list. I'm trying this out on my own site currently: http://gregorlove.com/following/ If you're using this plugin, I'd love to hear from you! Feel free to send webmentions to this post: http://gregorlove.com/2016/02/quite-pleased-to-officially-release/
    1 point
  45. https://github.com/gRegorLove/ProcessWire-IndieAuth This module allow users to sign in to your site using IndieAuth: IndieAuth is a way to use your own domain name to sign in to websites. It works by linking your website to one or more authentication providers such as Twitter or Google, then entering your domain name in the login form on websites that support IndieAuth. This module has two different functions: IndieAuth Authentication After a user enters their domain name and successfully authenticates, they will be redirected back to your site and the session variable indieauth_domain will be set. You can then use this session variable to customize your site for the user or offer additional functionality. Note: The user is not logged in to ProcessWire at this point. ProcessWire Authentication If you would like to allow users to log in to ProcessWire using IndieAuth, you will need to make a few changes to the user profile. Add a field named website Add that field to the user template Update the User Profile module to make the website field user-editable The user will need to set their domain name in their user profile before they can log in with IndieAuth. Setup After installing the module, copy the template file extra/templates/indieauth.php into your site/templates/ directory. In the admin area, add the new indieauth template. On the "URLs" tab for the template, check "HTTPS only." Create and publish a new ProcessWire page using this template, e.g. https://example.com/auth/ The included template is a minimal, sample template that covers both of the functionalities described above. You can expand the template or integrate it into your existing templates as needed. For more information about the sign-in form and how the verification works, please refer to https://indieauth.com/developers Notes This module does not create user records if they do not exist already.
    1 point
  46. Yeah, it is probably pretty niche, but it can be very handy if you want to implement something like OAuth or OpenID without all the heavy lifting those entail. My immediate use case is that it's easier for me to log in to my site on mobile by just entering my domain now. On http://indiewebcamp.com it's used as the authentication mechanism for the wiki. It's worked great there to prevent spam accounts/wiki edits.
    1 point
  47. If you want to see page A on page B you can install the Page References Tab module. This adds another tab in your page showing which pages are linked.
    1 point
  48. Ryan, thanks for your answer and fix. That all makes sense. Those $users, $permissions and $roles were exactly what we were playing with. My co-worker has some kind of magical php-shell where he bootstraps pw and these issues came there (also addRoles() stuff I posted, but that was probably just misunderstanding from our behalf (probably thinking in 2.0 way...), will check it again tomorrow). I will post about that shell more too soon, it is very interesting stuff.
    1 point
  49. I'm responding from phone so keeping it short: $image = $pages->get("template=page-headers, sort=random")->images->getRandom();
    1 point
×
×
  • Create New...