Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/09/2016 in all areas

  1. Lots of fun new upgrades to our Repeater and Repeater Matrix fields this week. In this post we cover all the details along with a couple of screenshots. You can start using these now in ProcessWire 3.0.44 (dev branch): https://processwire.com/blog/posts/pw-3.0.44-repeaters/
    9 points
  2. Hi Adrian, I have a module that could be helpful here - just putting the finishing touches on it and will release this weekend. Cheers, Robin.
    5 points
  3. Whether it is actually meaningful or not, it might help convince your clients - ProcessWire won the best small business CMS for 2016: https://www.cmscritic.com/awards/
    4 points
  4. A repeater will work, but it's sort of overkill for repeating just a single line of text. Behind the scenes it is creating a page for every line. This is probably the way to go. If you wanted your own custom markup you could explode and foreach a textarea. $lines = explode("\n", $page->my_textarea); if(count($lines)) { echo "<ul class='my-special-list'>"; foreach($lines as $line) { echo "<li class='my-list-item'>$line</li>"; } echo "</ul>"; } For sure, and for more complex repeatable items see the Table fieldtype.
    4 points
  5. Media Manager version 008 (released 09/12/2016) Happy to announce the latest release of Media Manager. Changelog Fully compatible with ProcessWire 2.8 and 3.x (@see note #1 below though). Fully compatible with repeaters including ProcessWire 2.7, 2.8 and 3 Fully compatible with Repeater Matrix Fixed bug in Media Manager insert-image-in-RTE feature. Please note, there are a some slight UI changes, but nothing major. Also @see note #2 below. Notes Maybe it's my environment or the file compiler but in ProcessWire 3.x, if you delete media, they are reported as not deleted until you manually refresh the page In case you didn't know, you do not have to use FieldtypeMediaManager/InputfieldMediaManager to insert images in the RTE Please also upgrade to version 004 of Jquery File Upload (uploaded today) A couple of people are reporting not getting confirmation emails after purchasing MM. I'm looking into this
    3 points
  6. ProcessWire is going to cost more on initial development than setting up things in a prebuild and bought wordpress theme and just doing some editing. But as soon as any amount of serious customization is needed you should be fine with ProcessWire as well. I mean you can still use prebuild html templates, but it's not a drop in thing like in other systems. If you need more than just styling or basic-content customization, but also custom business logic you'll probably have a better time in processwire than in other cms systems. Depending on the projects scope it might even be easier to set up than using a full-on framework like laravel or others (e.g. you get the backend basically for free).
    3 points
  7. In short: You shouldn't. You won't want all requests to hit the index.html as it's going to prevent you from hitting processwire in any way (even ajax requests). I'd rather suggest letting your build steps transfrom the index.html into some file, which you can easily include as part of your templates and you're good to go and much more flexible. The alternative would be serving processwire and the SPA unter totally separate domains / access points.
    3 points
  8. MarkInPageTree New module which does what it says in the title. It adds an icon to a page on the page tree if -> a specific field is true and / or is a specified template. For example I'm using it to add an icon to any page that has a checked (checkbox) exclusive field. This helps with admin clarity as you can see instantly which pages of the same template have differing content (i.e. are exclusive or not). https://github.com/benbyford/MarkInPageTree
    2 points
  9. Tense Tense (Test ENvironment Setup & Execution) is a command-line tool to easily run tests agains multiple versions of ProcessWire CMF. Are you building a module, or a template and you need to make sure it works in all supported ProcessWire versions? Then Tense is exactly what you need. Write the tests in any testing framework, tell Tense which ProcessWire versions you are interested in and it will do the rest for you. See example or see usage in a real project. How to use? 1. Install it: composer global require uiii/tense 2. Create tense.yml config: tense init 3. Run it: tense run For detailed instructions see Github page: https://github.com/uiii/tense This is made possible thanks to the great wireshell tool by @justb3a, @marcus and others. What do you think about it? Do you find it useful? Do you have some idea? Did you find some bug? Tell me you opinion. Write it here or in the issue tracker.
    2 points
  10. This works pretty straight forward echo $image->title($languages->get('en')); // $image->title($languages->get($input->get('lang'));
    2 points
  11. Still wasn't perfect - "images.field.label" worked only for Image fields but not for other. However I figured out that this one actually works (for a Date field named "date_created"): {fieldgroup.date_created.label} It still returns the label int he default language, but with the %lang_id% it's outputted fine: {fieldgroup.date_created.label%lang_id%}
    2 points
  12. Got it working by adding a token %LANG_ID% - will be included in the next update. {images.field.label%LANG_ID%}
    2 points
  13. Check out Profields Table, Repeater or Profields Repeater Matrix, PageTable (can't find a good link for this but it's an installable core module).
    2 points
  14. ConnectPageFields Allows the connecting of two related Page fields so that changing one updates the other. Purpose of module An example: suppose your website is about movies. You have a template "movie" with Page field "actors". For each movie you add the actors that appear in the movie. All good, but what if you want to find results like... the 10 actors who have appeared in the most movies actors who haven't appeared in any movies since 1990 You cannot retrieve these pages with a single efficient $pages->find() query, and must load a large PageArray into memory in order to iterate or filter it. For the sake of making these types of queries more efficient you could structure your templates/fields so that movies are added to actors instead, but this may be a less comfortable workflow and can run into equivalent problems (e.g. "find the 10 movies with the largest cast"). The solution is to have a two-way relationship so that movie pages have an "actors" Page field and actor pages have a "movies" Page field. This module will keep these two Page fields in sync so that adding "Ryan Gosling" to "Drive" automatically adds "Drive" to "Ryan Gosling". Also, you can select the same Page field in both Page field A and Page field B. For example, create a "Related" Page field for related pages. Choose "Related" for both fields in a pair in the module config. Now when you add "Orange buffoon" to Related for "Donald Trump", "Donald Trump" is automatically added to Related for "Orange buffoon". Usage Install the ConnectPageFields module. If you haven't already done so, create the two Page fields you want to connect and add them to templates. In the module config select the two Page fields in a "Connected field pair" row as Page field A and Page field B. You can add rows as needed using the "Add another row" button. Troubleshooting Make sure you have set the "Selectable Pages" settings for each Page field correctly: The settings for Page field A should allow pages using the template(s) that Page field B has been added to. The settings for Page field B should allow pages using the template(s) that Page field A has been added to. http://modules.processwire.com/modules/connect-page-fields/ https://github.com/Toutouwai/ConnectPageFields Module config: Demo showing how changing one Page field updates the other:
    1 point
  15. Hi everyone, Here's a new module that lets you control whether multi-language support is enabled at the page / branch level, rather than only per template. http://modules.processwire.com/modules/restrict-multi-language-branch/ https://github.com/adrianbj/RestrictMultiLanguageBranch This is ideal for a site with repeated branches using the same templates where only some need to be multi-language. I think it is confusing to provide multiple language inputs for fields when they are not required - it just bloats the admin interface for site editors. I am hoping to expand this module to allow selection of which languages are supported per page/branch, but I am waiting on @ryan's response to this request: https://github.com/processwire/processwire-requests/issues/54 - to me this would be even more powerful if you have a situation where certain branches need some languages and other branches need different languages. The module config settings shows a summary of the restrictions you have implemented, eg: This shows that we have started with the home page which disables multi-language on itself and all its children/grandchildren (because "This Page Only" is "False". Next we have the /report-cards/ page multi-language enabled, but no inheritance (because "This Page Only" is "True"). The only branch below this to have multi-language enabled is Guanabara Bay and all it's children etc will also be enabled. All other report card branches will be disabled because they will inherit directly from the config settings default status. The Settings tab for each page gives you three options: Inherit, Enabled, Disabled. The screenshots give you an idea of how the Inherit option works and the information it provides based on the status it is inheriting and from where. My goal for this site was to just enable multi-language support for the Guanabara Bay report card branch of the tree, as well as the home page and the /report-cards/ parent. All other branches have multi-language support disabled which makes content entry much cleaner. Hope you guys find a good use for it and I'll be sure to update with the ability to define which languages are available on which pages/branches if Ryan comes up with a core solution for changing the returned $languages. Please let me know if you have any problems / suggestions.
    1 point
  16. Hi community, i'am not a pro in module creation and i need someone, who build it better. What my stuff at this time does: there is a page "Standard". This Page can upload into OR select Images from "Image Library". The pages inside "Image Library" are simple pages with a imageField (single) inside. The page "Standard" looks like this: "Select existing Images" ist a pageField. The Inputfield is a AutocompleteField with preview oh the selected pages (from "Image Library"). "Image (add if not exists)" is a imageField (multiple) this two fields togehter and some hooks are the core of my project. select a image form the list, or upload a new one. The Module has to parts: The new Autocomplete Inputfield for FieldtypePage and a processing for the imagefield via hooks. Lets start with the ImageField: Upload a Image(s) like everytime in Processwire. After hit "Save": a "Page:saved" hook is checking if the image is already in the Library is checking the basename. if basename already exists, the code compares the two images by pixelanalysis(!) if in Library already: then add the existing Page with this image to the PageField field if not: create a new page with template "Image", add the image there, and add the new page to PageField after all: remove the image from this page (because we linked the image via a page) The pageField is a clone of the existing InputfieldPageAutocomplete, but i extended that with little new function: display images in ___rendeListItem() and the javascript-version after AJAX loading. In my module, you can use as a new label specific string img:{a_image_field.url}:img. This pageField automatically controls the imageField. The selected Parent and Template is the path for new Pages and there Templates. I'am testing a lot with this new components. Works fine. I Like this solution for pages where many images are allways the same (like a product-catalog). Download the zip and have a look. Installation Follow this steps: Install module "InputfieldPageAutocomplete2" install module "ImageUploadOrSelect" create a Template "Image" now we need a unique name for three fields. For example: "loremipsum". create a field of type image, call it "imageuploadorselect_imagetarget_loremipsum". this field is single image field. no array output! add the field "imageuploadorselect_imagetarget_loremipsum" to template "Image". create a field of type image, call it "imageuploadorselect_imagestemporary_loremipsum". this field is multiple. array output! add this field to a template you decide. For example "basic-page". create a new field of type Page, call it "imageuploadorselect_pages_loremipsum". set up this field like in the image above. Parent: a page you decide (where pages with template "Image" will be created) Template: Image Labelfield: custom Custom page label format: {title} img:{imageuploadorselect_imagetarget_loremipsum.url}:img Inputfieldtype: "PageAutocomplete2". add this field to template from step 8, where the imageField also is. I would be very happy if someone could help. How i sad before, i'am not the pro. I looking for somebody who could help me to merge this stuff in one module to share it in the community. I commented all the things in the files. There are a lot of detailed information. Have nice weekend! modules.zip
    1 point
  17. I'd say that if your small business can afford week or more development time (high quality and/or unique look and feel, some custom processes, integrations or just big site), then ProcessWire is excellent option. If they just need lot's of bells and whistles out of the box, then some high quality WordPress themes or SaaS offerings (wix, squarespace etc) would be best. Due the nature of ProcessWire, it is actually also very nice for pretty static websites, where only few places are editable (maybe news, menu or price lists etc).
    1 point
  18. @LostKobrakai's question is a good one. You shouldn't run any logic inside getModuleInfo() since it is executed by the module cache update routine long before the system is ready and things like permissions, roles, users and session have been wire()d. I guess one cou could say it used to work accidentally. I don't think there's a way around moving your logic into __construct(), init() or ready() in recent PW versions.
    1 point
  19. Why are you loading a permission in the getModuleInfo? This should a static a.k.a. self-contained function which returns information about the module independent of the installed system. Also permissions are usually referenced by name. I mean it's technically correct, but still curious.
    1 point
  20. How about using InputfieldSelector for the page selection and using InputfieldIcon for the icon selection?
    1 point
  21. Update: Jquery File Upload Version 0.0.4. Changelog Fixed a small bug introduced during the last commit. This causes some images not to be displayed in image gallery.
    1 point
  22. Yesterday I was not completely happy with the pagelistmarkup feature because occassionally I need to output dates and as I store them unformatted (unix timestamp) I can't output them formatted in the page list. Now I have added a feature to set the formatting using the following syntax (borrowed from Latte template engine): ({date}|date:%Y. %B %d.) As you can see it's very flexible, the only issue remained is setting the locale. My idea is to leave this thing to the developer and do not add it here (maybe a hook?). Of course this issue only affects multilanguage sites where you would need to output month names in different languages too, but using only number format is OK.
    1 point
  23. I've been able to start adding some text to the Readme's for these two now. Please get involved if you're interested in helping with these two specific modules as im still relatively new at it.
    1 point
  24. Plans yes, - but currently no time. It will need a complete redesign of the storage. Currently it is stored with the original files in IPTC, and thats not supported by PNG and GIF.
    1 point
  25. Now that's what I call service, or maybe it's just "Great minds think alike" Can't wait to see what you have put together!
    1 point
  26. @FrancisChung, uhhm, I changed wire-> to $wire-> on the fly for the example to be more future ready with PW3 and possible multi instances. So, please, can you test if it works with this too: if($u) { $wire('user')->user = $u; } (see the preceding $, to invoke the instances aware $wire, and not the (static) main wire instance)
    1 point
  27. Padloper works now with PW 3.0. Planning for next release on Christmas time.
    1 point
  28. Sorry guys, I have been laughing five minutes alone here for your vagina monologues vs avengers debate It was indeed our link spam protection plan (that actually worked pretty well). So @fbg13 no worries about any virus, just poor humor from moderators.
    1 point
  29. This discussion is also about linking pages back and forth with a hook example:
    1 point
  30. I don't think this is the place to ask which cms you should choose. It's PW forum and i doubt there will be people who'll tell you you should use another cms. I doubt there is something you can't build with PW, or the others cms too, the questions is which one is the easiest to work with.
    1 point
  31. hi from the API side you can set the values like this: $page->setOutputFormatting(false); $page->images->trackChange('title'); $img = $page->images->first(); // or whatever image you want $img->title = 'Title in default language'; $img->title($languages->get('fi'), 'Title in Finish'); $img->title($languages->get('de'), 'Title in German'); $page->save(); $page->setOutputFormatting(true);
    1 point
  32. If anyone with php <5.4, be aware that the short [] array index won't work for you. You'll need array().
    1 point
  33. Hi everyone, @Christophe was kind enough to notice that I had mis-spelled "Language" throughout the module, including the name of the repo on Github and the class name. I think I have everything updated correctly now, so if anyone has already installed it, you will unfortunately need to install again. Sorry about that!
    1 point
  34. You can use $this->animal $this->animal = 'cat'; $this->addHookAfter('Page::render', function($event) { bd($this->animal); }); or you can also do this: $animal = 'cat'; $this->addHookAfter('Page::render', function($event) use($animal) { bd($animal); });
    1 point
  35. @Nukro, Update is same as any other ProcessWire module. However, in this case, we also have to delete the following folders: /site/modules/InputfieldCKEditor/plugins/mmimage/ /site/modules/InputfieldCKEditor/plugins/mmlink/ /site/modules/MediaManager/plugins/ In addition, you need to remove references to the the plugins MMImage and MMLink from any CKEditor field that were using them. Edit the field Go to Input Tab Under CKEditor Settings > CKEditor Toolbar delete references to MMImage and MMLink Scroll down to Plugins and untick mmimage and mmlink Save The update does not write anything; neither to your file system nor to your database. Therefore, it shouldn't affect anything related or unrelated. Better to be safe always, however, so, create a backup of your site first Backup your files and db replace or overwrite the contents of /site/modules/MediaManager/ with the contents of the folder MediaManager-007. If overwriting, remember to delete the plugins folders as stated above since there will be nothing to overwrite them with from the MediaManager-007 folder Hit module refresh Test that everything works fine Acquaint yourself with the latest changes Let your clients know about the changes
    1 point
  36. Cough. We used to get a lot of spam with certain movie names on the forum. That's a feature.. kind of
    1 point
  37. Well for some reason IronMan with space between the words gives me that no idea why. Might have caught a virus.
    1 point
  38. Got it, thanks. And your interpretation of those movies clearly goes much deeper than mine
    1 point
  39. For pages related to same kind of pages: movies (Ironman related to Ironman 2, Avengers etc), books, games, tutorials, recipes... If i write IronMan with space between the words i get V@g1n@ Monologues wtf
    1 point
  40. Sounds interesting. Here's one way you can do it: $table = $fields->get('your_page_field')->getTable(); $query = $database->query("SELECT data FROM $table GROUP BY data"); $ids = $query->fetchAll(PDO::FETCH_COLUMN); $items = $pages->getById($ids); // $items is a PageArray echo $items->implode("\n", "<a href='{url}'>{title}</a>"); If we were to add this to the API, I think I'd want to make it accessible from a regular find() selector, rather than as a separate findSelectedPages method. That way it could be used with things like InputfieldSelector. Perhaps something like this: $pages->find("your_page_field=:selected"); ...where ":selected" is a keyword is would recognize to execute this behavior.
    1 point
  41. Does your problem persist after removing the dependency, logging out and back in again? If I do that, the error is gone. It seems that the error just doesn’t get cleared properly. To fix this right now, you can hack the core. Open the file wire/modules/Process/ProcessProfile/ProcessProfile.module and change the following line: if(count($form->getErrors())) { To this: if(count($form->getErrors(true))) { The argument clears the errors that occurred during form validation. It should be safe. The errors are not used anywhere else as far as I can tell. Instead of hacking the core directly, it’s probably better to use the new multiple-modules feature. Funnily enough, Ryan uses the exact same file as an example in his blog post.
    1 point
  42. You'd want to hook after $pages->save(); If you want your function to execute on every page save, any time, then you'd want to create an autoload module. http://wiki.processwire.com/index.php/Module_Creation If you want to capture newly added pages separately, then you'd also want to hook $pages->added(), which is called after a new page has been added. This example shows both: /site/modules/HelloWorld.module class HelloWorld extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hello World', 'summary' => 'Just an example module class.', 'version' => 1 'autoload' => true, ); } public function init() { $this->pages->addHookAfter('save', $this, 'hookSave'); $this->pages->addHookAfter('added', $this, 'hookAdded'); } public function hookSave(HookEvent $event) { // this function called any time a page is saved (whether new or not) $page = $event->object; // now you can access anything from the $page } public function hookAdded(HookEvent $event) { // this function only called after a new page added $page = $event->object; } }
    1 point
×
×
  • Create New...