Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/10/2017 in all areas

  1. did a total rewrite of the module and will release it the next weeks when i'm done
    5 points
  2. The demo site uses Lister Pro (it's debatable whether pro modules should be used in the demo site but that's another discussion) but you can achieve something similar by using a bookmark for the basic core Lister. Visit the "Find" lister and set up the filters and columns how you like to show the skyscrapers or whatever your pages are about. Then save that configuration as a bookmark on the Bookmarks tab. The bookmark appears as a child menu item of the Find section, but as @tpr suggests you can include a link to the bookmark in the main Pages menu using the NavItems feature in AdminOnSteroids.
    3 points
  3. @Soma wrote about his solution related to your problem, take a look:
    2 points
  4. Thanks @Robin S, just a small addition: you can omit the admin root url part, so use only "Skyscrapers: page/lister/...".
    2 points
  5. Since this thread is related , I'm also posting this here. I wrote a little helper module to find related pages with score and sorting by score AND modified. Module code can be found here: https://gist.github.com/3558974 $pages->findRelated( Page $page, PageArray $tags, string $field [, string $tmpl, int $limit] ); It add a $pages->findRelated() method. You can do something like this: $found = $pages->findRelated($page, $page->tags, 'tags', 'product|product2', 100); if($found) { foreach( $found->slice(0,5) as $rel ) { echo "<p><a href='$rel->url'>$rel->title</a> ($rel->score)</p>"; } } else { echo "<p>No related Products found</p>"; }
    2 points
  6. Hi everyone, I'm proud to share my first fieldtype module and I think it's a quite handy one It helps you to create all kinds of table/matrix inputs very quickly and easily. You have loads of options for customizing your field via plain javascript. See the handsontable docs for that Please consider this module ALPHA until i got some more time to test it. Any help would be highly appreciated Numbers are for example always tricky. Different locale settings, different types, rounding errors and so on... Download: https://gitlab.com/baumrock/FieldtypeHandsontable Result: Installation/Configuration: Just install the Fieldtype, add a field to your template and set the handsontable options in the fields details. If you have InputfieldAceExtended installed you will also have code highlighting for your code: Get data: If you retrieve the data from the API with outputformatting ON you have some helper methods available: getData() + getRows() get all data of the field getRow($row) get one special row, eg getRow(1) or getRow("2017") getCols() get all data but by columns not by rows getCol($col) get one special column, eg getCol(1) or getCol("mycolumnheader") You can also access rowHeaders and colHeaders directly (see examples) Simple Example: Caution: the examples below are outdated! see this post:
    1 point
  7. Hej, A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated (Also pull requests are appreciated ? - have a new Job now and don't work a lot with ProcessWire anymore, yet, feel free to contact me here or on GitHub, Im'm still "online"!) Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method: <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so: <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe What do you think? Any ideas, bugs, critique, requests? cheers Steffen
    1 point
  8. fyi MySQL >= 5.7.8 supports searching inside JSON
    1 point
  9. Two small additions in v150: Misc: add new page: uncheck `Active?` for non-default language names (thanks to Tomka) Misc: hide the `Add new` dropdown button from above the main pagelist Unchecking the active state for the non-default language variant of a page can be handy if only a few pages need to be multi-language, so you don't have to go to the Settings tab to uncheck them all every time adding a new page. Also works with templates with parent-child relationships set (when the first step of the addnew process is invisible). Hiding the Add new dropdown doesn't take the available bookmarks into account, just hides the button entirely (CSS only btw). I never really needed this feature and I agree that it's rather confusing. The main pagelist looks a bit empty without this button though
    1 point
  10. @ian has a site about moths, maybe he can help you.
    1 point
  11. Hi @Sipho, Welcome to the forums. Instead of unpublished you could also make them hidden. They won't show in a $pages->find() either unless you explicit ask: $pages->find('include=hidden')'. Also check out this famous post on how to organise content in ProcessWire with great examples. This will give you good insight on possibilities on how to structure your data.
    1 point
  12. Very nice site - good to look at and functional too - Well done!
    1 point
  13. Already done The fields are there for really simple tables and the files for more complex ones. The module will include all files related to a field automatically (PHP, js and CSS).
    1 point
  14. Hey Bernahrd, really good work. Thank you so much for your effort!
    1 point
  15. Hi @bernhard Thanks for putting all the work into sharing this module. What came to my mind was that I do not really like providing code in admin input fields, except when it is a few lines of code. So wouldn't it be possible (optionally maybe) to provide paths to files instead?
    1 point
  16. Ok, thanks Robin!
    1 point
  17. @Margie, it's likely that the error you're seeing is due to interference by the mod_security Apache module. Ask your host to disable mod_security and it should resolve your issue.
    1 point
  18. cheers and thanks again for helping! ... just merged
    1 point
  19. hey clsource. thanks for the reply! and you are absolutely right, it is odd...but i needed a quick solution and couldnt find a good and especially quick PW way. once I have more time again, the plan is to move and extend the pwtemplates.de page
    1 point
  20. Update: Merged dev 2.4.1 to master. Changelog New, cleaner Backend UI. Better sorting of Posts, Categories and Tags in their dashboards. New option for posts: post_edit. Allows top or bottom placement of link to edit post for logged in users or non-display of link for all users. Thanks @antoiba86 Code refactoring. Screenshots in this post:
    1 point
  21. Updated to Version 1.0.3 with one more Inputfield Option which allows to use any custom JavaScript.
    1 point
  22. Great work!. Hope you make many sales and spread the word about professional processwire uses!. As a side note I find odd that the page selling processwire site profiles and templates is made with wordpress. http://isit.pw/?url=https%3A%2F%2Fpwtemplates.de%2F%3Flang%3Den
    1 point
  23. That looks awesome. I finally found some time to play around with it, and I'm quite impressed. I can already see some concrete usage scenarios - especially what you already mentioned re: when it's too tedious to go the "export CSV from Excel, import CSV to PW" route. I am somehow stuck though when trying to add i18n options to the datepicker. I took your example (Jan-Dec), added a few options, and everything worked fine in the back- and frontend, but now I don't see that handsontable anymore in "page edit" mode. I get a message saying "Please save this page to be able to change this content". I did that repeatedly, but it's always the same. Funnily enough, I don't see any errors in the PW error log, and the frontend works just fine (granted, it's only a print_r() so far, but at least it still fetches something from PW and spits it out correctly). Did you run into similar situations? Any idea what I did wrong? This is my JSON: var colheaders = ['Jan', 'Feb', 'März', 'Apr', 'Mai', 'Juni', 'Juli', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez', 'Datum']; hot.updateSettings({ colHeaders: colheaders, minCols: colheaders.length, maxCols: colheaders.length, rowHeaders: false, minRows: 1, copyPaste: true, autoWrapRowBoolean: true, autoWrapColBoolean: true, minSpareRows: 1, columns: [ {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, { type: 'date', dateFormat: 'DD.MM.YYYY', correctFormat: true, defaultDate: '01.07.2017', i18n: { previousMonth : 'Voriger Monat', nextMonth : 'Nächster Monat', months : ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'], weekdays : ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], weekdaysShort : ['So','Mo','Di','Mi','Do','Fr','Sa'] } datePickerConfig: { firstDay: 1, showWeekNumber: true, numberOfMonths: 3, disableDayFn: function(date) { return date.getDay() === 0 || date.getDay() === 6; } } } ] }); Edit: D'oh - I missed a comma after the i18n block... OK so the table is back, but although Saturdays + Sundays are deactivated, and Monday is set as the 1st day of the week, the days and months still display in english. Guess I have to dig into the original docs a bit further... Thanks for this great addition to PW!
    1 point
  24. Importing data into PW is certainly no big deal. I guess the actual challenge is to find out whether an update is necessary, or creating a new recordset (page). If your export from the other system (I guess a CRM) only allows to have ALL data exported, then it's going to be tricky. It would be ideal if you had three different exports: only completely new records (new customers, new sales reps) only updates to existing data (new customer address, new sales rep phone number) only removals from the system (or a flag like "inactive") You would probably need unique identifiers (perhaps an ID from your CRM that you store as a special field in your PW-template), to make sure you update the right page.
    1 point
  25. Hi, I just wanted to sing a song of praise of how smart actually PW is (designed). From my recent posts here in the forum you may know what I'm currently trying to do in my spare time - I port/migrate a fairly popular handbuilt 16 year old forum over to process wire. Reason is; the forum's users have grown to like the not-like-the forums out there look of the 16 year old originally perl/cgi based thing, which basically is nothing else like a nested list in most views, which then got enhanced whith loads of custom pages, functions, galleries and wutnot. 16yrs worth of procedural php code, created by at least 4 different and differently skilled developers. Bring it on! Whatever the reason, I thought this might be the perfect pet project to get to know PW in and out. And I really have to say: I'm deeply impressed. I have over 15 years experience wiith different CMSses, and I consider myself as fairly skilled in TYPO3 (yes, with that Typoscript riddles), know my way around cutsomizing and theming Wordpress sites since wp2.1 and I messed around with several other popular and not so popular CMSs as a part of my daily work. For like 1.5 years now I use PW as the "motor" of most sites I build. And now, with this "pet project" of mine, I'm really starting to fall in love : Being able to bootstrap the API and creating scripts that I can "fire" via the commandline, directly on the server, connecting to other databases, helped immensly with the task of getting 186000 posts by 5000 users into a processwire install. creating the relations between these posts (which one is the root of a "discussion", what is the "parent" of the current post) was easily done be using "Page" fields and again a script that scraped that info from the old structure and populated the page fields accordingly. I plan to write a detailed how-to once the migration is completed and working, but this could take some time ;-) Now the backend would time out if I wanted to edit one of the post. Caching the templates didn't help, so I thought about what was going on "under the hood" -- and after a little bit of head scratching it occured to me that maybe the 4 "Pages" field each post carried, were to blame, esp. the 2 fields referencing the whole collection of posts: "post_root" and "post_parent" -- each of which could theoretically be one of the other 185999 posts in the database. Since the default option for the visibility of "pages" fields are "select" and "open", PW needs to query the 185999 posts - and that brought down my php script execution limit and/or the allocated memory size of 152MB. Wow. But guess what, and that's where my romance with PW started for real: If you switch the visibility to "closed", or in my case to "closed with ajax on opening" the backend will run fast again. Now the selects will only be populated (with ajax) if I need to change the post_root or post-parent - which should never be necessary in the everyday use of that data. Initially I had imported the 4000 users not with the system's user template, but a custom one. While this worked without a problem, it brought down the lister, which wouldn't respond and time out after like 5 minutes. I still don't know why, but changing those users to the system user template got rid of that problem, and now they are behaving quite well. This is so cool. What started as a late night idea seems now to grow into a real project. With all that importing and moving imported data to pages data, I had like half a million pages in this install, and PW handled this quite nicely. In the meantime I have cleaned up and currently I'm down to about 186000 pages plus 4000 users plus some static pages. This wouldn't have been possible without the option to use the PW API from the outside. Thank you Ryan for this great piece of software. Cheers, Tom
    1 point
  26. https://www.typografics.be/nl/blog/processwire-bigger-stronger-faster-en-easier
    1 point
  27. Absolutely. Nowadays we build most of the stuff in the back-end with custom Process modules in combined with the forms api. Importing content is also pretty easy. You might ask why not in the front-end? Because the roles and permissions work flawlessly in the backend and the back-end looks pretty good (Reno looks imo the best), but you can create your own based on Uikit. If you want to overwrite the default styling take a look at AdminCustomFiles where you load css and javascript files. Also take a look at MarkupAdminDataTable since most of the stuff you will need is forms and tables. This makes it pretty easy to prototype.
    1 point
  28. I'm using https://buddy.works/, but this might not be the best place to discuss CI options
    1 point
  29. I've been hard working on JavaScript and things are finally starting to fall into place. I've missed the PW forum though so I thought I'd swing by and share this. Kept me amused for awhile, enjoy
    1 point
  30. I still don't fully understand what your platform should offer in the end, but to be honest I'm even more curious what you find so appealing in processwire compared to what you're writing about using a blockchain. ProcessWire is a quite nice, but comparatively simple CMS, whereas a blockchain implementation is a highly complex thing for decentralized and trustless computation/storage. The latter is something where experts develop a non trivial amount of time to just get it running (maybe not for the blockchain per se, but also the implementation and business logic around it). You should not miss one critical factor in the blockchain equation, which is the computational cycles needed to calculate new blockchain hashes. That's the reason, why this stuff does work, because it's so (mathematically proven) hard to abuse/break. So I'd really suggest you to ask yourself, what benefits you'd get from using a blockchain, because building that will be an investment and it'll certainly limit your base of potential customers if you don't fully hide the blockchain technology from them (e.g. most likely run your own servers again).
    1 point
  31. Hello Jozsef, for the generation of many large image variations, ImageMagick comes in handy. Of course you have to enable it first on your webspace, but most hosters have an manual for the activation, if they support it. Usually I visit the page I added images in to generate the variations. You could probably achieve this also by an hook. But for me it seems more natural to check the changes I made after saving a page. For the lazy loading of images in the front end, I can highly recommend using the plugin lazysizes. It is easy to setup, supports responsive images, background images and so on. There is also the module Markup SrcSet, which uses lazysizes. Regards, Andreas
    1 point
  32. I'm always amazed by the interfaces you implement in the pw admin @renobird. It's crazy.
    1 point
  33. I've updated the module with some small changes. Exceptions are no longer unintentionally catched when using the CLI tool. Also the default migration format does now include seconds in the timestamp. These are optional so migrations without seconds will still work.
    1 point
  34. InputfieldSelectize A Inputfield to provide a select interface for Processwire CMS FieldtypePage using the (awesome) Selectize.js jQuery plugin, by Brian Reavis. Selectize: https://github.com/selectize/selectize.js Modules directory: http://modules.processwire.com/modules/inputfield-selectize/ Github: https://github.com/outflux3/InputfieldSelectize Features Custom designed options and items for any page select field. Your select options can use any field or subfield on the page, but also sub-subfields, or any data you provide, since you are not limited by tag replacement: you control the precise data supplied to the options using a PHP array that returns data to the module, which is in turn supplied in JSON to the select as adata-dataattribute. The plugin uses the JSON object for each option meaning you can do whatever you want with that data in designing your options/items. Each instance lets you define which fields are searchable for the select Your selects can use display logic based on the value of any field/data item, for example using ternery conditionals you can avoid empty parenthesis. You can design the options and items (what is seen once an option is selected) independently of each other. Therefore you could have special fields on the options for searching, but exclude those on the item. Likewise you can show elements on your item like an edit button which is not needed on the option. Multiselect pages are sortable, and deletable by backspace or optional remove button. When AceExtended editor is installed, the module will use that for the code input fields. Usage Install the Module Edit your pagefield and choose InputfieldSelectize as inputfield. You will see the empty fields that need to be populated to make this work Notes For examples of what you can do (in general) with your selects when using Selectize.js, view the plugin site at http://selectize.github.io/selectize.js/. The plugin theme is selected on the required JquerySelectize module ----- Examples Basic Example PHP (the data array for each item - this must return a plain array): $data = array( 'title' => $page->title, 'company' => $page->company_select ? $page->company_select->title : 'Not set', 'total' => count($page->recipients), 'editUrl' => $page->editUrl ); return $data; Javascript (item and option same) Here, the item.property each refer to the keys of the PHP array that you returned in the above field. This field must be a valid Javascript string with each of the properties you want to show as demonstrated below, and recommended to use the escape(item.property) syntax. These strings are passed to the render functions of the plugin. '<div class="item">' + '<span style="display:block;font-size:14px;font-weight:bold;">' + escape(item.title) + ' (' + escape(item.total) + ')</span>' + '<span>' + escape(item.company) + '</span>' + '</div>' Example screenshot: A more advanced example This example shows how to use conditionals for the PHP and JS to get the select options to look clean and provide the necessary information to assist users in choosing the correct options: PHP $data = array( 'title' => $page->title, 'year' => $page->year ?: $page->year_sort, 'for_inst' => $page->for_inst, 'edit_href' => $page->editUrl ); return $data; Item Javascript: '<div class="item">' + '<div style="color: black; font-size: 14px;"><span style="font-weight:bold;">' + escape(item.title) + ' (' + escape(item.year) + ')</span>' + ' <a class="pw-modal pw-modal-medium" href="' + escape(item.edit_href) + '">Edit <i class="fa fa-edit"></i></a></div>' + (item.for_inst ? '<div style="color:gray;">for ' + escape(item.for_inst) + '</div>' : '') + '</div>' Option Javascript: '<div class="item" style="width:100%;">' + '<div style="color: black; font-size: 14px;"><span style="font-weight:bold;">' + escape(item.title) + ' (' + escape(item.year) + ')</div>' + (item.for_inst ? '<div style="color:gray;">for ' + escape(item.for_inst) + '</div>' : '') + '</div>' Example with images In this example the selects will feature a thumbnail image: You could also set the width of the selected item to 100% depending on where you place the field (e.g. in a column) $image = $page->images->first(); $thumb = $image->size(100,100); $data = array( 'title' => $page->title, 'thumb_src' => $thumb ->url, 'img_dims' => $image->width . 'x' . $image->height, 'img_desc' => $image->description, 'img_size' => $image->filesizeStr, 'edit_src' => $page->editUrl ); return $data; '<div class="item" style="width:100%;">' + '<div class="image-wrapper" style="float:left;"><img src="' + escape(item.thumb_src) + '" alt=""></div>' + '<div class="info-wrapper" style="float:left; padding:5px;">' + '<span style="font-size:14px;font-weight:bold">' + escape(item.title) + '</span><br>' + '<span>Dimensions: ' + escape(item.img_dims) + 'px</span><br>' + '<span>Filesize: ' + escape(item.img_size) + '</span><br>' + '<span>' + escape(item.img_desc) + '</span><br>' + '<a class="pw-modal pw-modal-medium" href="' + escape(item.edit_src) + '">Edit <span class="ui-icon ui-icon-extlink"></span></a></div>' + '</div>' '<div class="item">' + '<div class="image-wrapper" style="float:left;"><img src="' + escape(item.thumb_src) + '" alt=""></div>' + '<div class="info-wrapper" style="float:left; padding:5px;">' + '<span style="font-size:14px;font-weight:bold">' + escape(item.title) + '</span><br>' + '</div>' + '</div>' Current Notes & Issues: Works with 3.0.23 devns Doesn't currently support creating new options (and may exhibit strange behavior if you try and add one not in the list) Doesn't yet support optgroups
    1 point
  35. Here's a bit of code that you might find useful. It's something that I referred to earlier in this thread. Say you have a group of pages that represent businesses - like entries in a business directory. Put something like this at the top of your template for each business. <?php $siblings = $page->siblings(); foreach($siblings as &$sibling){ $pagetext = strtolower($page->title.' '.$page->city.' '.$page->postcode); $siblingtext = strtolower($sibling->title.' '.$sibling->city.' '.$sibling->postcode); $stopwords = array('limited','shop','emporium'); $pagetext = str_replace($stopwords,'',$pagetext); $siblingtext = str_replace($stopwords,'',$siblingtext); similar_text($pagetext, $siblingtext, $sim); $sibling->similarity = $sim; } $siblings->sort('-similarity'); ?> $stopwords are words you want to be ignored in the comparison (in my real-world use they are business-specific terms that a great many businesses have in their names). Then to display a list of similar entries... <?php $score = 40; if($siblings->eq(1)->similarity >= $score){ echo '<h3>Similar Entries</h3>'; echo '<ul>'; for($i = 1;$i <= 10;$i++){ if($siblings->eq($i)->similarity < $score) continue; echo "<li><a href='{$siblings->eq($i)->url}' title='{$siblings->eq($i)->title}, {$siblings->eq($i)->address}, {$siblings->eq($i)->city} {$siblings->eq($i)->postcode}'>{$siblings->eq($i)->title}</a>"; if($user->isSuperuser()) echo ' '.round($siblings->eq($i)->similarity, 2); echo "</li>"; } echo '</ul>'; } ?> Adjust $score to get satisfactory results. (And the bonus prize is that logged-in super users get to see the score in the page output.)
    1 point
×
×
  • Create New...