Jump to content

kongondo

PW-Moderators
  • Content Count

    5,984
  • Joined

  • Last visited

  • Days Won

    98

Posts posted by kongondo


  1. Hi @jens.martsch,

    This looks awesome! Even without the todo list, this is a huge improvement to the current way of installing and searching for modules. I really like the listing of modules. Some quick questions:

    1. Why call it Modules Manager 2? Why not just ModulesManager?
    2. I might have missed it; Is it possible to read/find modules that have been moved physically to the modules folder on one's site but have not yet been installed? This will cater for modules that are not online in ProcessWire's module's directory

    Great work!

     

    PS: Nice overview video, btw!

    • Like 1

  2. Variations 002  (released 16/09/2019)

    Happy to announce the latest release of Variations.

    Changelog

    1. ProcessWire 3.x support only.
    2. New GUI to match AdminThemeUiKit
    3. Save and exit or save and add more variations configuration or attributes (in modal)
    4. More granular control of custom column types and definitions: DECIMAL, FLOAT, DOUBLE, TINYINT, INT, VARCHAR, TEXT, DATETIME, TIMESTAMP, BOOLEAN, etc
    5. Decimal type better suited for price data compared to Float/Double
    6. Boolean type, useful for Yes/No type data, e.g. for sell out of stock? yes/no
    7. Datetime/Timestamp fields if required.
    8.  Column definitions: null, precision, scale, length, default value, etc.
    9. Required fields: if column is not nullable and no default provided, it becomes a required field. E.g. can set price not to be null.
    10. Default fields: For uses such as prefixing SKU-

    Apologies that this has taken a while to update.

    Upgrading

    If upgrading from version 001, ProcessWire's Filecompiler will fight you. You might get errors such as Class ProcessVariations not found in file..... If you get such errors, first, try to clear your cache and compiled files several times. As a last resort, if clearing cache doesn't work (and I don't like this workaround), temporarily change the code in the offending file, e.g. in VariationsRender.php, where it says class VariationsRender extends ProcessVariations, change that to class VariationsRender extends WireData. Refresh the modules page until the errors disappear, then revert back to the original text (class VariationsRender extends ProcessVariations). I hate to ask you to do this but I've had it with the Filecompiler.

    Documentation

    Documentation can be found here. However, it still needs updating to reflect latest changes outlined above. For now, please note that we've added an extra setting for setting the default date and time formats for datetime/timestamp custom columns/subfields. This is available in the Input Tab of the field.

    Screenshots

    variations-version-002-001.thumb.png.2bfdc6a468adc1fd4a783d6443ceeacb.png

    variations-version-002-002.thumb.png.150d86d25901a615bcc32d75bf23558a.png

    variations-version-002-003.thumb.png.879c64aca5d5192c1941b32b58a28446.png

    variations-version-002-004.thumb.png.0a4a7c36f4d8656782d9415fa9bc6552.png

    variations-version-002-005.thumb.png.16fefa8dbfbbe38a3a2c082e5daddcb9.png

    variations-version-002-006.thumb.png.2ef684af1466bc30326c866f60bc9901.png

    variations-version-002-007.thumb.png.ddb24c8dc5a1189628a7b662111a89bc.png

    variations-version-002-008.thumb.png.c1f10ce1314d9c37caaf4a2616aee027.png

     

    Thanks!

    • Like 1

  3. Maybe rtrim can work as well? or that and mb_string?

    E.g.

     

    foreach($page->images_slider as $slide_image) {
       echo rtrim($slide_image->name,"{$slide_image->ext},.");
    }

    I haven't tested this much. I also cannot remember if ProcessWire allows dots in file names.


  4. 34 minutes ago, neophron said:

    The background is, that a clients website has a lot of images, packed in different galleries. All image files contain the name, dimensions and other stuff about the image (painting). I want to echo the image name in the image tag.

    Are these images saved in ProcessWire image fields?


  5. Edit: I misunderstood the question above...this post is not really relevant but I'll leave it here anyway :-).

    This is how I close PW modals (in Media Manager and other modules). 

     

    	/**
    	 * Close jQuery UI Modal.
    	 *
    	 * @param integer $s Number of milliseconds before closing modal.
    	 *
    	 */
    	function closeDialog($s = 1000) {
    		setTimeout(function() {
    			jQuery('iframe.ui-dialog-content').dialog('close');
    		}, $s);
    	}
    
    // call the function
    // if adding media into a Media Manager Inputfield and closing the dialog is set
    // in this case data is an Ajax Response
    if (action === "insert" && data.insertAndClose) closeDialog();

    Question, are pw-panels the same as pw modals?

    • Like 1

  6. 1 hour ago, bernhard said:

    But pw-panel does not offer a way to check which element triggered the opening of the panel.

    Are you sure about this? I use pw-modal-closed in several of my modules and code similar to below works ok.

     

    $(document).find('a.some_class, a.another_class').on('pw-modal-closed', function (evt, ui) {
        var $parent = $(this).parents('div.some_wrapper');
        $parent.addClass('class_to_hide');
        console.log('parent hidden');
        console.log($parent,'PARENT')
    });

    The correct div.some_wrapper has the class to hide it ('class_to_hide') applied to it. Are you using ProcessWire's JqueryMagnific?


  7. 17 hours ago, dragan said:

    surely it can't be both (?).

     

    17 hours ago, wbmnfktr said:

    I don't know if this is correct in any way.

    This module gets people confused 😉. Yes, it is both. Page Table is a pro module based on a concept by @apeisa, coded by @ryan and sponsored by Avoine where Antti works. Avoine offered the module to the ProcessWire community for free (through their sponsorship).

     

    Edit: For some reason, the above link is not linking correctly to the single post where Ryan explains the difference between the modules. Here is the direct link. It is Ryan's 3rd post on page 2 of that thread. 

    TLDR; Table and Page Table are different modules. Both are pro fields. The latter is available to us for free, thanks to Avoine. 🙂

    • Like 7

  8. On 7/31/2019 at 4:25 PM, elabx said:

    Hi! Is this module working with recent versions of ProcessWire? Is it compatible with UIKit theme? 

     

    On 8/8/2019 at 11:33 AM, eydun said:

    I just bought this module. Any chance to make it compatible with UIKit?

    Hi all. Just a quick update. I have been working on updating the module to make it ProcessWire 3.x compatible + add some improvements. Most of the work is done. I hope to release by next week. Thanks.

    • Like 1

  9. On 8/28/2019 at 10:54 AM, gebeer said:

    So in the list of media in the manager there should be something like a button to copy that public link and when editing media that public link should be displayed also.

    Where is the link being copied from?

    On 8/28/2019 at 10:54 AM, gebeer said:

    Since all media are pages, I guess I can hook into ProcessPageEdit for those templates and add the link to display in the page editor screen? 

    Yes, but Media Manager methods are currently not hookable. I'm not sure you've seen it, but Media Manager allows you to add your own (ProcessWire) fields to the media pages templates. Those will then be displayed in the list (table) view if you configure them to be displayed in Media Manager settings. However, you will not be able to edit the values directly in the table view. Instead, each media has an edit link that when clicked will open the full page for editing - this is a normal (almost) ProcessWire page edit form. You can use it to edit any of the fields in the template as well as the media themselves. In the frontend you access them as $m->your_public_link_field. I hope this makes sense. If not, please let me know.

    Thanks.


  10. Thanks @Sergio, @apeisa and @Tom. for bringing Tailwind CSS to our attention. Incidentally, I checked out the Tailwind screencasts and ended up picking up Vue.js as well :-). Anyway, to my first question.

    16 hours ago, apeisa said:

    Two sites I have build with tailwind and purge css. Other site css file was 3.4kb and other 2.5kb... I also skip purge from my own css, just tailwind goes through it. 

    It is actually very simple. It does "scan" all the files you need. But in case of ProcessWire custom classes can come from many places, so I felt it easiest to purge only tailwind css. And I am pretty happy with the file size results... 

    @apeisa, could you please clarify this statement about ProcessWire custom classes. Does it mean you use Tailwind in the backend/admin/modules or does it mean you use ProcessWire inputfields in the frontend? 

    Thanks.

    Cross-posting Tom's Tailwind + UIKit + Grid resource:

     

    • Like 3

  11. Hi @Sergio and @apeisa. Do you mind if I please hive off your Tailwind CSS discussion into one topic (say, Tailwind CSS for ProcessWire Developers)? It seems to me there is a steady interest in the framework. It would be nice to have one go-to topic where ProcessWire Devs can learn from (and contribute to) in respect of the framework. Personally, I have a few questions as well but I am hesitant to post in this topic since we'll quickly go off topic. Thanks.

    • Like 1

  12. On 8/11/2019 at 5:42 PM, Gadgetto said:

    This would fragmentize the source of a module a lot. I thought it works like in frontend, where I can enable URL segments and then the parts of URL paths like /mymodule/this/that/ are simply assigned to urlSegement(1) = "this" ,urlSegement(2) = "that". And the request wouldn't be routed to /mymodule/this/that/ but /mymodule/.

    From this point of view, I don't see any advantage for using url segments in process modules.

    It could also be that I still don't understand how URL segments are working!? (which is probably the case)

    @Gadgetto

    My bad. I misled you a bit. I can't find it now, but @teppo made an excellent post about the executeWhatever() aspect of Process modules. In Process Modules, unlike URL segments in the frontend, ProcessWire will 'jealously guard' the first URL Segment, i.e. the Whatever part of execute....(). In other words, if your Process module has a first URL segment, it will look for a method in your Process module named executeYourFirstURLSegment(). If it doesn't find that, rather than render what is in execute(), it returns the error, Processwire: Unrecognized Path and the content The process returned no content. However, this only applies to the first URL Segment. After that, i.e. 2nd, 3rd, etc URL segments will resolve to whatever you decide based on the code you have in the method of the first URL Segment. For instance, in the case /admin/mymodule/firsturlsegment/whatever/, ProcessWire will not complain if there is no 'whatever' as long as firsturlsegment has content. Please find an example Process module below and the demo of it. The example is a bit rudimentary but you get the idea. Normally, I don't include the content of what I want the 2nd, etc URL segments to resolve to within the executeWhatever() method itself. I usually throw those in their own methods or even class. 

    Example

    In this example, executeColours() is our gateway to anything we want the 2nd URL segment to resolve to. The 'red', 'green', etc segments do not exist independently (i.e. no corresponding executeXXX() methods for them). ProcessWire does not complain since the first segment /colours/ exists as executeColours().

    Spoiler
    
    <?php namespace ProcessWire;
    
    class ProcessDemoURLSegments extends Process implements Module {
    
        public static function getModuleInfo() {
    
    		return array(
    			'title' => 'Demo URL Segments',
    			'author' => 'Kongondo',
    			'version' => "1",
    			'summary' => 'Process Module Demoing URL Segments.',
    			'singular' => true,
    			'autoload' => false,
    		);
    
    	}
    
        const PAGE_NAME = 'demourlsegments';
    
        public function __construct() {
            parent::__construct();
        }
    
        public function init() {
            parent::init();
        }
    
        public function execute() {
            $out = 'My Demo URL Segments Module';
            return $out;
        }
    
        public function executeColours() {
    
            $input = $this->wire('input');
            $sanitizer = $this->wire('sanitizer');
            $urlSeg2 = $sanitizer->pageName($input->urlSegment2);
    
            if($urlSeg2 == 'red') $colour = 'red';
            elseif($urlSeg2 == 'green') $colour = 'green';
            elseif($urlSeg2 == 'blue') $colour = 'blue';
            else $colour = 'main';
    
            $out = $this->menu($colour);
            $out .= "<h2 class='{$colour}'>Demo URL Segments Process Module.</h2>";
    
    
            return $out;
        }
    
        private function menu($currentMenuItem) {
    
            $menuItems = array(
    			'main' => $this->_('Main'),
    			'red' => $this->_('Red'),
    			'green' => $this->_('Green'),
    			'blue' => $this->_('Blue'),
    		);
    
            $out = "<ul class='demo nav uk-navbar-nav pw-primary-nav'>";
    
    
            $seg1 = 'colours/';
    
    		foreach ($menuItems as $key => $value) {
    			// determine 'active' menu item
    			$on = $key == $currentMenuItem ? 'menu_item on uk-active' : 'menu_item';
    			$seg2 = $key;
    			$href = $this->wire('page')->url . $seg1 . $seg2 . "/";
    			$out .= "<li><a class='{$on}' href='{$href}'>{$value}</a></li>";
    		}
    
    		$out .= "</ul>";
    
    		return $out;
    
    
        }
    
    
        public function ___install() {
            $page = new Page();
            $page->template = 'admin';
            $page->parent = $this->wire('pages')->get($this->wire('config')->adminRootPageID);
            $page->title = 'Demo URL Segments';
            $page->name = self::PAGE_NAME;
            $page->process = $this;
            $page->save();
        }
    
        public function ___uninstall() {}
    
    
    
    }

     

    Demo

    demo-url-segments-process-module.thumb.gif.a5e42256e30d0331d1597bc5985537bf.gif

     

    • Like 3

  13. What the others have said. In addition, note that you can use your own param string when you build your modal URL and check that instead. However, I have found that param strings are not as reliable as url segments. I tend to use the latter more. For instance, for my process module's modal landing pages, I append some pre-determined url segments and check that instead. Below, some rough examples of both approaches (untested, mostly written from memory :-)).

    // using custom param string (popup)
    $url = $this->wire('config')->urls->admin . "your-process-module-name/some-page/?modal=1&popup=1/";
    $input = $this->wire('input');
    
    if((int)$input->get->popup == 1){
        // in modal
    }
    
    // OR using custom url segment (popup)
    
    // create URL with segment
    $url = $this->wire('config')->urls->admin . "your-process-module-name/some-page/popup/";
    $input = $this->wire('input');
    if($input->urlSegment2 && $input->urlSegment2 == 'popup') {
        // we are in a modal
    }
    else {
        // not in a modal
    }

    Something along those lines...

    • Like 1

  14. 10 hours ago, elabx said:

    Just so you have more info, the only difference was that I namespaced the old modules

    Aah, nice workaround. I never thought to do that 😊.

    10 hours ago, elabx said:

    This is a GREAT update kongondo! I know this has been mentioned before but the improvement in the UI is a huge plus! I see you mentioned you have a lot of users that had never mentioned this, but in my case as with other PW users, all my clients complained about the lack of polish in UI, but this update really solves a lot of the inconveniences. 

    Glad you like it :-).

    10 hours ago, elabx said:

    I cannot get the alt text on images placed in CKEditor to update accordingly, I also have the setting updated in the Inputfield configuration, have you had any issues with this?

    I don't follow. What is this alt text please? Please clarify which inputfield configuration, CKEditor or MM?

    Full documentation is available here, by the way :-).

    Thanks.

×
×
  • Create New...