thetuningspoon

Modalception!

Recommended Posts

Modalception for ProcessWire

GitHub: https://github.com/thetuningspoon/AdminModalception

Direct Download: https://github.com/thetuningspoon/AdminModalception/archive/master.zip

Modalception improves the usability of ProcessWire's modal dialog/popup windows when opened from within another modal window. The parent window is expanded to take up the full screen behind it so that additional modals can be opened without the inner windows becoming progressively smaller and less usable. The outer windows' toolbars are hidden from the user to help reduce confusion.

post-449-0-20442500-1452964609_thumb.gif

* Screencap also features the Page Field Edit Links module

  • Like 18

Share this post


Link to post
Share on other sites

Love the joke in the module title :D

  • Like 2

Share this post


Link to post
Share on other sites

Really cool. Would love to see this in the PW 3.0 final build (at latest) if possible :)

Share this post


Link to post
Share on other sites

hi thetuningspoon!

thanks for this module! unfortunately it does not work properly on frontend:

i included styles and scripts like this (using AIOM):

        $config->scripts->add("../modules/AdminModalception/AdminModalception.js");
        $config->styles->add("../modules/AdminModalception/AdminModalception.css");

modalception.gif

any idea what could be the problem? any easy fix?

the files are definitely loaded, but the first modal gets 100% width and height as you can see in the screencast.

thank you for your help!

Share this post


Link to post
Share on other sites

hi thetuningspoon,

thank you for your quick answer. sorry for being unclear:

2nd modal on backend: all good

2016-09-15 22_50_25-Edit Page_ untitled-8 • mustangs.do2.baumrock.com.png

first modal on frontend: all good

2016-09-15 22_51_44-Program Manager.png

second modal on frontend: first modal gets 100% width and height and overlaps the normal page.

2016-09-15 22_52_16-Program Manager.png

ps: i tried if it has something to do with the pw-modal-small that i'm using but it's the same without that class!

i can also provide you a login to this site and you can see it yourself...

Share this post


Link to post
Share on other sites

Ah, I understand now! This is actually the intended behavior, and if you look carefully, it is also how it works on the back end. The parent window is expanded to take up the full screen, with the effect that the entire interface zooms inward. 

Share this post


Link to post
Share on other sites

hm... not sure if i don't understand you or you don't understand me ;)

pic1: there are 2 modals open, but you see only modal 2. in the background is the original processwire page and NOT the first modal.

pic2: frontend, 1 modal open. you only see modal 1 and in the background the original page (logo, menu)

pic3: frontend, 2 modals open, you see BOTH modals! modal 2 is open (thats good), BUT modal 1 is in the background and NOT the regular page.

do you understand now? or please let me understand what you mean :)

 

Share this post


Link to post
Share on other sites

The expected behavior is what is occuring on the front end. I'm not sure why the parent modal is not visible in your back end example. I bet that if you go another layer deep, the parent modal will be visible in the background.

Is the parent modal being visible in the background problematic for your use case?

 

My original thought when creating this module was to make each window overlay the previous exactly so that the top parent window would always be visible in the background, but I found the "zoom" approach to be a much simpler and more programatically elegant solution to the problem.

Share this post


Link to post
Share on other sites

@bernhard Do you get the same results with AOS off?

Share this post


Link to post
Share on other sites
On 17.9.2016 at 6:34 AM, thetuningspoon said:

The expected behavior is what is occuring on the front end. I'm not sure why the parent modal is not visible in your back end example. I bet that if you go another layer deep, the parent modal will be visible in the background.

Is the parent modal being visible in the background problematic for your use case?

no it is not. i can open as much modals as i want and they are all properly overlaying each other with the exact same size.

no, it's not problematic at all.

On 17.9.2016 at 7:38 AM, tpr said:

@bernhard Do you get the same results with AOS off?

does not make any difference, neither on frontend nor on backend.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Anssi
      A simple module to enable easy navigation between the public and the admin side of the site. After installation a green bar will appear to the upper side of the screen, containing a few navigation elements and displaying the PW version number.
      Heavily inspired by @apeisa's great AdminBar (Thanks!). I needed a bit simpler tool for my projects and as a result, this was made. Available on GitHub .

    • By Sebi
      I've created a small module which lets you define a timestamp after which a page should be accessible. In addition you can define a timestamp when the release should end and the page should not be accessable any more.
      Github: https://github.com/Sebiworld/PageAccessReleasetime
      Usage
      PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules
      After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually.
      Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached.
      If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well.
      How it works
      This module hooks into Page::viewable to prevent users to access unreleased pages:
      public function hookPageViewable($event) { $page = $event->object; $viewable = $event->return; if($viewable){ // If the page would be viewable, additionally check Releasetime and User-Permission $viewable = $this->canUserSee($page); } $event->return = $viewable; } To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile.
      public function hookPageIsPublic($e) { $page = $e->object; if($e->return && $this->isReleaseTimeSet($page)) { $e->return = false; } } The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client.
      The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file.
      public function hookProcessPageViewSendFile($e) { $page = $e->arguments[0]; if(!$this->canUserSee($page)) { throw new Wire404Exception('File not found'); } } Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab.
      Limitations
      In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() wether the page can be accessed. $page->viewable() returns false, if the page is not released yet.
      If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!
    • By David Karich
      Thanks to the great Pro module "RepeaterMatrix" I have the possibility to create complex repeater items. With it I have created a quite powerful page builder. Many different content modules, with many more possible design options. The RepeaterMatrix module supports the cloning of items, but only within the same page. Now I often have the case that very design-intensive pages and items are created. If you want to use this module on a different page (e.g. in the same design), you have to rebuild each item manually every time.
      With this proof of concept I have created a module which adds the feature to copy a repeater item to the clipboard so that you can paste this item to another page with the same repeater field. The module has been developed very rudimentarily so far. It is currently not possible to copy nested items. There is also no check of Min/Max. You can also only copy items that have the same field on different pages. And surely you can solve all this more elegantly with AJAX. But personally I lack the deeper understanding of the repeaters. Also missing on the Javascript side are event triggers for the repeaters, which would make it easier. Like e.g. RepeaterItemInitReady or similar.
      it would be great if @ryan would implement this functionality in the core of RepeaterMatrix. I think he has better ways to implement this. Or what do you think, Ryan?
      Everybody is welcome to work on this module and improve it, if it should not be integrated into the matrix core. Therefore I put it for testing and as download on GitHub: https://github.com/FlipZoomMedia/InputfieldRepeaterMatrixDublicate
      You can best see the functionality in the screencast: 
       
    • By anderson
      Hi,
      Please take a look at this:
      https://templatemag.com/demo/Good/
      The upper nav bar, including dropdowns like "pages" and "portfolios", what do you call this whole thing? At first I guess it's called "dropdown nav bar", but seems not.
      AND of course, what's the simplest way/module to achieve this in PW?
      Thanks in advance.
    • By Sebi2020
      Hey, I'm new and I created a simple module for tagging pages because I didn't found a module for it (sadly this is not a core feature). This module is licensed under the GPL3 and cames with absolutly no warranty at all. You should test the module before using it in production environments. Currently it's an alpha release. if you like the module or have ideas for improvements feel free to post a comment. Currently this fieldtype is only compatible with the Inputfield I've created to because I haven't found  an Inputfield yet, that returns arrays from a single html input.
      Greetings Sebi2020
      FieldtypeTags.zip.asc
      InputfieldTagify.zip
      InputfieldTagify.zip.asc
      FieldtypeTags.zip