Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/16/2017 in all areas

  1. Introducing Variations, an Input- and Fieldtype for product variations and their attributes. Product variations is a topic that has been coming up now and then, especially in the recent past. This module seeks to fill this gap. Though it's in its early stages of development, it is already functional and can be used as is. I decided to make an early announcement (modules development forum) in order to get early feedback from potential users. The module is an alternative take on how variations can be built for a product. Imagine the ubiquitous T-Shirt. The product could vary by ...Size, Colour, Material, etc...These variations could in turn have internal variations, i.e. attributes....so, Size [Small, Large], Colour [Red, Blue]...etc; you get the drift. The usual approaches to building variations have been either to use Multiple pages, Repeaters, Page Table, Table or Matrix (limited to 1x1 variations). In this module, we do it a bit differently. First, the variations occur not at the Field level (meaning all product pages would have the same variations and attributes for each template) but at the page level. Secondly, there are no multiple pages for each variation and/or attributes; a product is a single page. The variations and their attributes are defined by site editors at the page level. Once a variations configuration has been defined, it is applied to the page and all possible combinations are generated (i.e. the Red,Small,Cotton; Red,Large,Cotton, etc) in the Inputfield. There is no limit to the number of variations and attributes that can be defined, although you will be amazed at how quickly the combinations grow! Prices are entered for each combination when editing the page. Combinations without prices are not saved to the database. Please note that prices cannot themselves vary at the page-level. Meaning, you cannot have ONE variation configuration that has different price inputs per product in the same FieldtypeVariations field. The module ships with an API for outputting variation combinations in the frontend. Search, database and in-memory work as normal in the frontend. In the backend, DataTables provides a nice paginated, filterable table. Prices can be entered on any pages (of the table) without loss of data (meaning you can enter prices on page 1, scroll to page 10, enter more prices, filter or search the products table, enter more prices and finally save; no data will be lost). I still have a couple of ideas and plans pending but would love to hear from you, thanks. Below is a short video demo of the module in its current state. Things may/will change, both UI and features. Btw, the Fieldtype, although primarily targeted at commerce applications, is by no means limited to this. Other uses requiring combinations of whatever number of variables are very much within the remit of the module. Planned/Hoped for features Import/Export product variations and attributes (Excel, etc) Full integration with Padloper (I will have to discuss with @apeisa) SKU fields for each product variation Add/Remove extra subfields, e.g. multi-currency prices (currently there is only 1 input for each product variations' price) Product variation images? Etc... Please not this module is not related to this other planned module (but it may eventually). Sneak Peek Demo
    5 points
  2. This will soon be the 'most up-to-date' method . Admin themes in ProcessWire are modules. There is no way to directly edit the theme in some editor within the admin to get the results you want. To change stuff and to make sure they don't get overwritten, you can copy and rename (including class rename) an admin theme module and edit it to your liking and install that. I stand to be corrected but I think you can install a custom admin theme that way, i.e in /site/modules.
    4 points
  3. For any Windows developers interested in an easy way to get going with Docker and Processwire that includes local debugging... https://github.com/rastographics/pwocker Local debugging in your IDE with Xdebug pre-configured. (Also includes working launch.json for you VS Code users ) Use *.localtest.me hostnames for each site you are developing (no editing of hosts file) Simple configuration...copy 2 files into your project, edit a couple variables in those files, and run 1 command per project. Tested with Docker 1.13.1-beta42 on Windows 10 Pro 64-bit. I didn't know much at all about Docker, nginx, or xdebug before doing this, so I pulled much info from gebeer's work and many others who have put Docker/PHP/xdebug stuff out in the community. And it may not be the best setup ever, but it finally gives me what I needed for doing PW work on Windows in a true Linux stack with IDE debugging.
    4 points
  4. Yes, e commerce being the most likely use for this module. Just to be clear for the sake of others, technically, these are subfields. E.g., price is a subfield (meaning a database column in a FieldtypeVariations field [technically a database Table] which you access as $variationsfield.price, similar to $page->image.description). Back to your question, this is a planned feature (although code is already in place). Please note that, in respect of these subfields, there are no plans to include anything as near exhaustive as what Table does. Meaning, these will likely be limited to TEXT, INT, FLOAT, etc fields, but not complicated Fieldtypes such as Page fields, Repeaters, etc. Yes, as many or as little as you want, pre or post-field use. For instance, start with price (default but in future versions one will be able to remove the subfield), then later or at field configuration add an SKU subfield, a discount subfield, some text subfield, etc.
    3 points
  5. You can do this with the undocumented dependent selects feature, which AJAX loads the selectable pages in a Page Reference field based on the value of another Page Reference field in the same page being edited. Your "homes_in_neighborhood" field would use this as the "Selector string" setting: neighborhood=page.neighborhood, neighborhood!='' You can limit by template, parent, etc too if you want. Based on my previous experience: Both Page Reference fields must use a Select, Select Multiple or AsmSelect inputfield. Dependent selects do not work inside Repeater fields. When changing the "source" Page Reference field you sometimes randomly get an option preselected in the "target" Page Reference field. Not a major problem but just something to keep an eye on to avoid accidentally saving an unintended value. If these limitations are a problem and you don't mind having to save the page after changing the "neighborhood" field then you can use the "Custom PHP code" option for selectable pages instead.
    3 points
  6. need to setup tables via custom sql queries? PHP // init datatables module $dt2 = $modules->get('RockDataTables2'); // setup columns $sql = 'SELECT * FROM invoicetable'; $dt2->setupColsBySql($sql); // setup table $dt2->id = 'dt_finanzbuch'; $dt2->js('/site/modules/ProcessRockFinance/dt_finanzbuch.js'); $f = $modules->get('InputfieldMarkup'); $f->label = 'Tabelle'; $f->value = $dt2->render(); $form->add($f); // ################################## // ajax request -> return data // non-ajax -> render form + table // ################################## if($config->ajax) { echo $dt2->getJSON($dt2->getDataBySql($sql)); die(); } JS $(document).ready(function() { // setup variables var opt = ProcessWire.config.dt_finanzbuch; // options from backend var colDefs = []; // column definitions // custom column definitions here // load default column definitions colDefs = colDefs.concat(dtGetDefaultDefs(opt)); // initialise table $('#dt_finanzbuch').DataTable({ ajax: { url: './book/', type: 'post' }, columnDefs: colDefs, pageLength: 10, footerCallback: columnSums, }); }); Result As you can see the sum function is not ready. it shows euros for my usecase...
    3 points
  7. What @LostKobrakai said. Just to expound on it. Your aim is to find pages [in this case 'coaches'] that use a particular category [in this case the children of 'Provinces']. As a by the way, it is also possible to do the inverse, i.e. find the 'categories' that a page uses. In that case, what you would be doing is just looping through Coach 1, etc, and outputting the category pages in their coach_provincie [i.e. the page reference field]; but I digress. Back to the question at hand. You do not need (can be dangerous, not user friendly, etc) code in your editor You do not need multiple templates for your provinces, i.e. Limburg, Drenthe, etc. Suggestion for your templates: Coaches:// template 'coaches' -Coach 1// template 'coach' -Coach 2// -ditto- etc. This is how my references tree looks like: Provinces:// template 'provinces' -Limburg// template 'province' -Drenthe// -ditto- -Utrecht// -ditto- Which coaches travel to this province? When viewing a particular province page, e.g. /provinces/limburg/ and want to find all coaches that are available for this province, all you need is to add Lostkobrakai's code above to the template file 'province.php' <div class="row"> <?php $coaches = $pages->find("coach_provincie=$page->title"); foreach ($coaches as $coach) { echo '<div class="col-md-6"><a href="'. $coach->url .'">'. $coach->title .'</a></div><div class="col-md-6">'. $coach->coach_locatie .'</div>'; } ?> </div> That code will return coaches that have 'Limburg' [the $page->title] in their page reference field (the one with the checkboxes - 'coach_provincie'). Which provinces does this coach travel to? On the other hand, if you want to know which provinces a coach travels to, e.g., Coach 1, (i.e. this URL /coaches/coach-1/, all you need to do is something like the below in the template file 'coach.php' foreach($page->coach_provincie as $destination) { echo $destination->title . '<br>'; } That's it .
    3 points
  8. After a bit of digging, I found more granular control over user permissions here: https://processwire.com/api/user-access/permissions/#user-admin-permissions
    3 points
  9. Glad you sorted it out. Question is, were those permissions changed between Friday and Tuesday? If yes, how and by whom? Hmm..
    3 points
  10. It looks like it could be useful to those using Chrome & CDNs , so thought I would share. http://www.ghacks.net/2017/02/15/local-cdn-for-chrome/
    2 points
  11. For hosting environments where you cannot change my.cnf and make settings persistent, you can do this: https://github.com/processwire/processwire-issues/issues/28#issuecomment-252870084 I just implemented it and it is working fine.
    2 points
  12. Solved by @flydev! Turns out I had the wrong permissions set for the top-level directory. Nothing to do with .htaccess as it turns out! All content of /var/www/html was attached to root's group. So a simple chown -R www-data:www-data /var/www/html did the trick. I just want to say that I'm so thankful for how helpful the ProcessWire dev community is and will make sure to pay it forward!
    2 points
  13. DEPRECATED - this module will not see any updates. I'm short before releasing RockGrid as commercial module. If you are interested contact me via PM this is a preview of a module that i'm working on for quite a long time. I needed it for an intranet office management application that i'm still working on. It makes it very easy to create very customized Datatables using the awesome jquery datatables plugin (www.datatables.net) Download - sorry, removed as it changes too frequently; closed alpha - contact me if you think you can contribute Remarks: The module is intended to be used on the backend. Loading styles is at the moment only done via adding files to the $config->styles/scripts arrays. Also the communicaton to javascript is done via the $config->js() method that is built into the admin and would have to be implemented manually on frontend use. But it would not be difficult of course Installation: Nothing special here, just download + install edit: removed some parts, because i made a complete rewrite of the module (and may not have been the last one)! [...] removed Why i created this module: of course i know @Soma s module but i needed a lot more features and the newer datatables version. also i like to define all the columns as objects and have everything on one place. lister & markupadmindatatable: nice for basic tables but lacks of features to modify the appearance of the cell values (like rendering icons, background colors and so on) datatables provides a great frontend API for filtering, showing/hiding columns, getting data, modifying it... it also plays well together with frontend charts like google chart api in this case: todo / roadmap: reload only one row add filters to all columns (in future also dropdowns, smaller than, bigger than, Regex, ...) make it possible to add table on frontend pages make buttons look like pw buttons make it possible to set settings globally and only for one table provide easy way of colorbars (percentage, red/green), maybe at different positions (left, top, right, bottom) provide easy way of adding action items (edit, show, link etc - visible or onhover) make own layout for tables (topleft, topright, bottom etc to make it easy to create extensions and show messages) privide way of simple javascript plugins (like I already have for row sums etc) provide easy way of handling actions for all selected items (delete selected, update selected...) provide easy way of reloading data (--> easy when using ajax source) easy way of showing/hiding columns excel/csv/clipboard export GUI for table setup processmodule to show different tables (lister replacement)
    1 point
  14. This week we’ve started developing a new admin theme for ProcessWire that aims to be a community collaboration. We’ve now got some good momentum with lots to share in this post. We also get into some technical details and have screenshots as well. https://processwire.com/blog/posts/working-towards-a-new-admin-theme/
    1 point
  15. I've been switching a site from using the Twig Template module to using the new Markup Regions and it's been fantastic! @ryan have you considered a placement attribute that will append/prepend/replace just the content of the attributed element, rather then the element itself? For example, my head tag is <head pw-id="head"> On one of my templates, I have some scripts and styles I need to append to the <head> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" /> <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.0.0/dist/MarkerCluster.css" /> <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.0.0/dist/MarkerCluster.Default.css" /> <script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> <script src="https://unpkg.com/leaflet.markercluster@1.0.0/dist/leaflet.markercluster.js"></script> <script src="https://unpkg.com/esri-leaflet@2.0.7"></script> As it stands I need to add pw-append="head" to every element: <link pw-append="head" rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" /> <link pw-append="head" rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.0.0/dist/MarkerCluster.css" /> <link pw-append="head" rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.0.0/dist/MarkerCluster.Default.css" /> <script pw-append="head" src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> <script pw-append="head" src="https://unpkg.com/leaflet.markercluster@1.0.0/dist/leaflet.markercluster.js"></script> <script pw-append="head" src="https://unpkg.com/esri-leaflet@2.0.7"></script> It would be great if I could wrap these with a <div> or similar, and use a placement attribute that would add all the children of the div, without adding the div itself. <div pw-append-contents="head"> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" /> <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.0.0/dist/MarkerCluster.css" /> <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.0.0/dist/MarkerCluster.Default.css" /> <script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> <script src="https://unpkg.com/leaflet.markercluster@1.0.0/dist/leaflet.markercluster.js"></script> <script src="https://unpkg.com/esri-leaflet@2.0.7"></script> </div> Or maybe this is already possible with some other technique I'm not aware of?
    1 point
  16. Sounds very interesting! Does this mean the "Price" field is only an example, and in non-commerce situations you could add some other type of field to store data related to the variation? Will you be able to add multiple data fields to the variations?
    1 point
  17. Just as a follow up, this is what I did to get content blocks (each a page with no template) into a set area (in my case the footer) of my site. 1) Created two templates, content-block-index (advanced tab = icon cubes) and content-block (advanced tab = icon cube) 2) Added 'title' (type = text) and 'body' (type = textarea) fields to content-block template 3) Created a page (called Content blocks) using the content-block-index template 4) Created a few subpages of this using the content-block template plus populated title/body fields (title only used to label in admin, not output anywhere) 5) Created a field 'insertContentBlock' (type = Page), details = single page or boolean false when none selected, input = parent of selectable pages, chose 'Content blocks' page 6) Added insertContentBlock field to any pages where I want to choose a custom block in the footer 7) Edit a page which includes the field created in (5), choose one of the content-block pages, save To output, I just put this in the footer (which itself is an include from main.php) // ./includes/footer.inc // if page is not 404 page <?php if ($page->id !== 27): ?> <div class='row'> <div class='column-l colour-bg'> <?php if ($page->insertContentBlock) { $block = $page->insertContentBlock; } // if no selection, default block else { $block = $pages->get("/content-blocks/my-services/"); } echo $block->body; ?> </div> <div class='column-r'> <?php // this block doesnt change $block = $pages->get('/content-blocks/contact-me/'); echo $block->body; ?> </div> </div> <?php endif; ?> Maybe not the most elegant but it suits my requirements and gave me a good idea what the Page field does. Anyway, might help someone.
    1 point
  18. Also if coach_provincie is a page field, where you select provincies directly, this selector works as well: "coach_provincie=$page"
    1 point
  19. <div class="row"> <?php $coaches = $pages->find("coach_provincie=$page->title"); foreach ($coaches as $coach) { echo '<div class="col-md-6"><a href="'. $coach->url .'">'. $coach->title .'</a></div><div class="col-md-6">'. $coach->coach_locatie .'</div>'; } ?> </div> What about that?
    1 point
  20. I am sorry about that. Did you get any Errors? Exceptions? Please let me know. I tested the module in 2 different environments. It worked there without problems. @Robin S Thanks for the hint. I added a note to the config field and the readme.
    1 point
  21. @PWaddict: just to clarify: There are two things here: The modules version is recognized and the module gets correctly updated via the individual update function in the modules config screen! The module is not recognized by the third party updater module. This is an issue of that updater module! What I have tried / described above, is to find a way / workaround without needing to contact the author of the third party module "updater" and ask him if he can debug and change the module to recognize modules that are organized like CI3 too. One way I found out to get recognized by the updater, is to use a wrapper module in the root directory of the module. This will work, AFTER everyone has updated to that version. But with the current situation, before everyone has updated to that version, there may be danger to break systems when silently changing the modules hirarchy and dependencies.
    1 point
  22. Perhaps there should be some warning about this option in the readme and/or module config page, as it has the potential to inadvertently break links if the Page Path History module is not installed.
    1 point
  23. To be honest, am totally clueless. I don't still get the reason why you should have code in your editor. Maybe if we saw a page tree and a bit more clarification we'd be able to advise better.
    1 point
  24. But at least Tracy would give you a chance to debug and test your code changes on-the-fly and maybe save yourself from becoming a dead bugger! PS - I am not sure how well "bugger" translates to those here from non English colonies For those looking for this, this is the definition you want: http://www.urbandictionary.com/define.php?term=bugger&defid=1454790 and definitely not this one: http://www.urbandictionary.com/define.php?term=bugger&defid=734856
    1 point
  25. OK after 2 days I got the basic stack functional...havent attempted loading of processwire yet. The key for me was I had to look at the readme of https://hub.docker.com/r/etopian/nginx-proxy/ to see what was going on and how the reverse proxy feature works with that image. I hope to post my final configuration for this when I'm done, for any other Windows devs who want to be able to develop multiple PW sites simultaneously on their PC. (No need to take turns starting and stopping containers). Thanks for your work gebeer.
    1 point
  26. hey guys..just stumbled upon this and i think it might be interesting, at least worth a read ;-) https://medium.freecodecamp.com/how-to-build-cross-platform-mobile-apps-using-nothing-more-than-a-json-markup-f493abec1873#.az40aujdt
    1 point
  27. Interesting, Its similar to https://www.nativescript.org
    1 point
  28. I guess writing comment is much more enjoyable in the forums, but not in the code) For now I settled on this syntax for non-phpdoc multiline comments. Without any particular rules on where to write them. /* * Comments here. */
    1 point
  29. As long as Tracy Deadbugger is not installed. Or any of my modules.
    1 point
  30. Er, well - maybe, but only the stable branch
    1 point
  31. Here is a pre-release version on Github: https://github.com/outflux3/ImportExternalImages Still needs some cleaning up, but works fine so far in limited testing on 3 sites...
    1 point
  32. Website: https://gatorade.com.do/5v5/ Modules: Form Builder, Lister Pro, Profiler pro, Tracy debugger, Procache (still not installed) It's a simple landing designed to handle registrations to a Gatorade Tournament, but it's kind of cool to see a big brand like Gatorade running Processwire.
    1 point
  33. How the new editor window looks like.
    1 point
  34. There's an option in the current .htaccess to forward to the www version of your site. But... I prefer a URLs without a www. However, I would still like said URLs to be accessible should someone type in the www sub-domain in their URL bar, or link to the "www version" of the URL. If you're like me, this could be a useful addition to the .htaccess file... # ----------------------------------------------------------------------------------------------- # OPTIONAL: Redirect users to the non 'www.' version of the site (uncomment to enable). # For example: http://www.processwire.com/ would be redirected to http://processwire.com/ # ----------------------------------------------------------------------------------------------- #RewriteCond %{HTTP_HOST} ^www\. #RewriteCond %{HTTPS}s ^on(s)|off #RewriteCond http%1://%{HTTP_HOST} ^(https?://)(www\.)?(.+)$ #RewriteRule ^ %1%3%{REQUEST_URI} [R=301,L] For me, this is the simplest way to do things. It also means any auto-populated canonical tags, such as... <link rel="canonical" href="<?php echo $page->httpUrl; ?>"> ...will never display the www version of your site. I know many of you will know this already, but I always forget exactly what to put in there, so this will come in useful for me and others in future, I hope! What are your thoughts on this? Some other solutions? I've heard about mod_alias also? How would that work in conjunction with ProcessWire? Would it be a better solution?
    1 point
×
×
  • Create New...