Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/20/2019 in all areas

  1. This week’s dev branch version brings you improvements to ProcessWire’s $input->cookie API variable, plus it adds the ability to modify system URLs and paths at runtime. This post also includes some examples to demonstrate just how useful this can be— https://processwire.com/blog/posts/pw-3.0.141/
    12 points
  2. Thaks Ryan, for the new features and also for the entertainment, which was just as great as the one and only "youtuber's" channel I regularly watch. His similar topic: https://youtu.be/Q6emWqJOTkY?t=1017
    2 points
  3. Your problems are gone! :) https://modules.processwire.com/modules/connect-page-fields/
    2 points
  4. @CrazyEnimal, please insert your code inside a code block in forum posts. You can use SQL in ProcessWire when it suits you. That's what the $database API variable is for. Here is one way you could get a listing of manufacturers with the number of occurrences within a selection of cars. // Get the IDs of the cars $car_ids = $pages->findIDs("parent=$parent, template=page_car, dealer=$dealer_id"); // Get table for manufacturer Page Reference field $table = $fields->get('manufacturer')->getTable(); // Get manufacturers that are selected in the car pages $query = $database->query("SELECT data FROM $table WHERE pages_id IN (" . implode(',', $car_ids) . ")"); $manufacturer_ids = $query->fetchAll(\PDO::FETCH_COLUMN); // Count how many times each manufacturer occurs in the results $manufacturer_occurrences = array_count_values($manufacturer_ids); // Sort the results in order of occurrences, highest to lowest arsort($manufacturer_occurrences); // Get the manufacturer pages $manufacturers = $pages->getById(array_keys($manufacturer_occurrences)); // Output a list of manufacturer titles and the number of occurrences foreach($manufacturers as $manufacturer) { echo "<p>{$manufacturer->title} ({$manufacturer_occurrences[$manufacturers->id]})</p>"; }
    2 points
  5. AdminBar 2.4.0 is out and adds support for the "data-adminbar-adjust" attribute. The idea here is to automatically modify (or adjust) certain CSS properties whenever the height of the Admin Bar is recalculated. Note: AdminBar already automatically adds "padding-top: [Admin Bar height in px]" to the <html> element, so this feature mainly applies to elements with "position: fixed". Assuming that Admin Bar is displayed and is 100px tall at the moment, the following markup... <div data-adminbar-adjust="top max-height"></div> ... would result in this: <div style="top: 100px; max-height: calc(100% - 100px);" data-adminbar-adjust="top max-height"></div> Thanks to @Fokke for the idea ?
    2 points
  6. I stumbled across this solution a few times. There is/was a bug in CKeditor which affected those multiple class setups.
    1 point
  7. Actually I'm still working on minor details, but I'll have it posted by 5pm EST.
    1 point
  8. @kkalgidim Not sure that it would suit your case, but worth to mention that there is the 'owner' selector, so you can use it instead of updating field. https://processwire.com/blog/posts/processwire-3.0.95-core-updates/
    1 point
  9. Or this https://modules.processwire.com/modules/pagefield-pairs/
    1 point
  10. @PWaddict - I have managed to solve the problem you are seeing, but there is another issue when using $file->mtime in the rename rule for images in repeaters that I am having trouble fixing. The problem is that when you save an image, the mtime changes and there is an order problem with the mtime changing before or after the renaming of the pagefile which is causing problems. I noticed though that it all works fine if you use $file->modified instead. Would that work ok for your needs instead of mtime?
    1 point
  11. Yep, I'm getting the same results with you.
    1 point
  12. Hello for all, and for my friend @Leftfield Sorry, but I need to say that I agree with @wbmnfktr in your previous post ("... why do you want/need such a weird URL?")? Here is one solution (as option) with default Processwire (no hooks, custom modules or core hack): 1) template: product, fields: title, details (page table with auto name date format) 2) child template: details, fields: image, color, size, price # With that you will get paths (URL's): # Backend administration: # Page tree: There is always option to develope custom module with different UI (and Ajax processing) where user in one "container" write title (parent page), and in another product details (child page). For users all that can looks just like a single UI form that they don't know that are 2 pages. Right now, I see this as one option (or something in this direction) how to get that what you want, but also in all that respect PW core. But need to think is this all worth it (complexity in backend, and later in frontend..).
    1 point
  13. @Peter Knight The filters for installed uninstalled could be also seen as a category and I think I will integrate them into the category select. "Show only uninstalled" are modules that are already downloaded but not yet installed. I am not even sure if this option makes any sense. Picked, is not an option. It was just a demo, which of the filter I selected.
    1 point
  14. You can check whether page rendered in admin if so, do nothing. if (strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0 || $this->wire('page')->template->name == 'admin') return;
    1 point
  15. As threatened in Ryan's announcement for 3.0.139, I built a little module for sliding toggles as a replacement for checkboxes. Styling of the input is CSS3 only (with all the usual caveats about older browsers), no JS necessary, and may still be a bit "rough around the edges", so to speak, since I didn't have much time for testing on different devices or brushing things up enough so I'd feel comfortable pushing it to the module directory. But here's the link to the GitHub repo for now: InputfieldSlideToggle Fieldtype and Inputfield that implements smartphone-style toggles as replacement for checkbox inputs. The visualization is CSS-only, no additional JS necessary. Status Beta, use with caution Features / Field Settings Size You can render the toggles in four different sizes: small, medium, large and extra large. Off Color Currently, "unchecked" toggles can be displayed either in grey (default) or red. On Color "Checked" toggles can be rendered in one of these colors: blue (default), black, green, grey, orange or red. Screenshots Some examples with checkbox label View all Size and Color Combinations Small toggles Medium toggles Big toggles Extra big toggles
    1 point
  16. Good point. I am attaching a new version here for you to test. I don't have much time this morning to test it properly, but hopefully this will also handle that. @simonsays - could also please test this version? ProcessCustomUploadNames.zip
    1 point
×
×
  • Create New...