Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/25/2017 in all areas

  1. 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:
    6 points
  2. Well it is more a example of finding the right model to store things....if you would have 30 departments you would possible choose methode 2 or 3 for storing this kind of things...but the first model describes the most simpel way to store 1:1 connections - one member : one department.... Another thing that is here important this models are all show the usage of the pagetree in ProcessWire so a editor with a "small" company with "normal" amounth of departments could easy and fast manage his content....and we could fast get the data on frontend. On the Template side of life there you could read again on this from kongondo: These are just the basic examples for beginners - if you manage complex data and complex editing you could or better will use of ListerPro or even a own admin dashboard, hinding content from the pagetree that confuse the editors and make other strange but always possible things for managing complex content and at the same time give your users a good ui for editing this content. regards mr-fan
    2 points
  3. Adds a Service Worker to your Processwire site which can be customised. The service worker script itself is heavily based on Jeremy Keith’s work – thank you Jeremy! More information: https://github.com/johannesdachsel/processwire-serviceworker
    1 point
  4. The option was hard coded to 'relative' instead of using the user set option. I submitted a pull request. Did you do anything else beside adding the comment field? It works for me on pw version 3.0.42 and php 5.5 on the intermediate profile. Make sure you don't have any typos in your code. Also when sharing code use the code button <> and add the code that way.
    1 point
  5. @JimSee The date part is a bug with PW. No idea about the error, works for me (copied your code and just replaced the comments field name). What pw, php versions are you using? Is your server able to send emails? Ask your host if you don't know.
    1 point
  6. just for reference, i started to build a fieldtype module for handsontable:
    1 point
  7. You're missing a lot of quotes, fix those first.
    1 point
  8. @JimSee it would help if you'd show us your code.
    1 point
  9. In v048 there's a new filter called group. This allows creating groups from a PageArray based on a page field value. I will probably further polish it later when I will use it in more projects but I think it's a nice time saver. {foreach ($page->children()->sort('sort')|group:'section') as $group} ... The filter just saved my *** from re-writing a thing to use Repeaters instead using child pages. It was much easier and fun to create the filter
    1 point
  10. You disabled everything for the fileCompiler, but wireCache and the fileCompiler are two totally different things. The first one is a multiple purpose cache for data you handle in your code. The fileCompiler is there to dynamically add the ProcessWire namespace needed in php files since pw 3.0, a.k.a. it's literally changing your php files and is not a cache for data at all. You could do this: // in config.php $config->cacheTimeMultiplier = 1 if($config->debug) $config->cacheTimeMultiplier = 0 // elsewhere echo $cache->get("hello-world", 3600 * $config->cacheTimeMultiplier, function() { echo "<p>Hello World</p>"; });
    1 point
  11. Saying that without understanding how PW works is a little rash, don't you think? Just compare PW's selectors with WP's WP Query.
    1 point
  12. Are there still somebody who is interested in this topic? I made some silly solutions for my personal purpose. Maybe we can exchange know how. For the base I structure my PW sites similar to Typo3. I have pages like Sites and pages like pagesections. SImilar to Typo3 they have different kinds (text, pictext, pic, …) The current task is to rewrite the tt_news urls. This is so crappy if you see how easy PW handle it.
    1 point
  13. I am really missing this module in version 3, are we any closer to an update? I am having to make do with Croppable Image 3, but the crop settings require both width and height values, not allowing either to be flexible.
    1 point
  14. $page->data is a "remnant" of subclassing the WireData class. It's there to store any value assigned to a page: $p = $pages->get(1) $p->someRandomWhatever = 'Hallo'; echo $p->someRandomWhatever; // Hallo echo $p->data; // {'someRandomWhatever' => 'Hallo', …} Some fields do use this, but especially the native fields (parent, children, …) or others are implemented in different ways. It's at least not in any way specific to fields.
    1 point
  15. $page->files means "the value of a field on the page named files" - it isn't a special method that somehow gets any files you have added to the page. You have named your files field "document_Files" so you get its value with $page->document_Files. If you have no field named "files" then trying to get a field value by that name will return null.
    1 point
  16. A proof-of-concept module. ImageToMarkdown Alt+click an image in Page Edit to copy an image markdown string to clipboard. Usage Install the ImageToMarkdown module. Alt+click an image in Page Edit to copy an image markdown string to clipboard. If the "Description" field is populated it is used as the alt text. https://github.com/Toutouwai/ImageToMarkdown
    1 point
  17. The default minimum length for words in a mySQL fulltext index is 4 letters, and while your hoster might be prepared to reduce that length for you, it would probably be better to change the way your search page works. Assuming you have ftp access, look for /site/templates/search.php. Its contents probably aren't that much different to the basic install search template, based on the way it appears to work and output results. If that is indeed the case, then look for a line like line 24 in the file I linked above. If it is identical, then replace the equivalent line with the following $terms = explode(' ',$q); $selector = ''; foreach($terms as $term){ $selector .= "title|body%=$term, "; } $selector .= "limit=50"; and you should be good to go. (Touch wood.) If it's very similar, you may be able to figure out what to change, but if not, post what code you have and we'll try to help.
    1 point
  18. The latest version of Admin Help module allows you to add a field to any help doc called help_header, which is then prepended to the edit form, for the template that this is enabled for. I use this for exactly the purpose you describe here, as well as putting a lot of instructions at the top of the page edit for certain template/page types; does help a lot and cuts down on support calls.. Alternately you can achieve this with a custom hook/function in your ready.php, for example hook into ProcessPageEdit::buildForm, and then prepend some markup depending if the conditions are met
    1 point
  19. Yeah, Soma, thx! Had parent:init(), but didn't know I have to define the new values. So solution is: public function init() { parent::init(); $this->set('pathToCSS', ''); $this->set('renderLayout', ''); } Now the tricky part begins Perhaps you can help me: I want to hook into a (hookable) method from the InputfieldPageTable module. I try this: public function init() { parent::init(); $this->set('pathToCSS', ''); $this->set('renderLayout', ''); $this->addHook('InputfieldPageTable::renderTable', $this, 'hookRenderTable'); } with protected function hookRenderTable(HookEvent $event) { // do something } I figured for example that $event->return is the original return of the parent module. Is there some overview which other arguments are "hidden" in $event. Var_dump is so huge, I can't find the values I'm looking for (in this case the id of the page, which is rendered in the table row).
    1 point
  20. I think you're missing the inputfield init() to set the properties // fieldtype and inputfield config settings $this->set('parent_id', 0); $this->set('template_id', 0); // placeholder only $this->set('columns', ''); $this->set('nameFormat', '');
    1 point
  21. Too simple to be a module, consider a script like this: $array = $pages->find("template=basic-page")->explode(function($item){ return array( 'id'=> $item->id, 'title' => $item->title ); }); $fp = fopen('file.csv', 'w'); foreach ($array as $fields) fputcsv($fp, $fields); fclose($fp); Note, $pagearray->explode() used here is only available in 2.4 (2.3 dev) http://cheatsheet.processwire.com/pagearray-wirearray/getting-items/a-explode/ And the anonymous functions requires php >= 5.3 http://php.net/manual/de/functions.anonymous.php
    1 point
×
×
  • Create New...