Jump to content

Recommended Posts

Hi apeisa,

We are just using the URLs tab on the relevant templates to redirect to https. How would you set it up so that logged in users are always https? That seems like it would be a good solution.

Share this post


Link to post
Share on other sites

If your login template is HTTPS, then how is the session even possible without SSL? Ah, it is. Our setup is actually little more complicated: we have https://*.pwire.fi ssl sert that we use for all our clients. So their domain is different with SSL.

But basically if you always use relative urls, then it will not ever change for logged in user (if your login page is ssl of course). Though to be sure you can check in autoload module (or _init.php template) something like if user is logged in and http, redir to http

.

Edited by apeisa

Share this post


Link to post
Share on other sites

Ah, you're right! All of my links are root-relative, and most of time I stay in https, EXCEPT when I go back to the home page (which is also root-relative, i.e. href="/"). For some reason that takes me out of https. Any idea why this would be??

Edit: This may be an issue with an Apache directive on our end... Looking into it.

Edit 2: Yep, that was it. The only issue now would be if the client opens another window to view the site front end and doesn't go to https. But I'm not too concerned about that. Thanks for helping me get to the bottom of this, apeisa.

  • Like 1

Share this post


Link to post
Share on other sites

@apeisa: using IE9, I'm seeing a whole bunch of JS errors when loading edit views with Adminbar. Not every time, but couple of clicks on the edit button and there they are. Any idea what could cause this?

SCRIPT5009: 'Array' is undefined 
JqueryCore.js?v=183, line 2 character 9220
SCRIPT5009: 'jQuery' is undefined 
JqueryUI.js?v=192, line 6 character 2
SCRIPT5009: '$' is undefined 
ProcessPageEdit.js?v=102, line 1 character 1
SCRIPT5009: 'jQuery' is undefined 
JqueryWireTabs.js?v=103, line 8 character 2
SCRIPT5009: 'eval' is undefined 
JqueryFancybox.js?v=126, line 16 character 2
SCRIPT5009: '$' is undefined 
ProcessPageList.js?v=102, line 16 character 1
SCRIPT5009: '$' is undefined 
MarkupAdminDataTable.js?v=101, line 1 character 1
SCRIPT5009: 'jQuery' is undefined 
JqueryTableSorter.js?v=203, line 2 character 2
...

CKEditor could be part of the answer, as this is one of our first big sites with it enabled. These errors don't show up when loading same modal edit view in it's own tab/window, so I'm guessing the iframe embed might have something to do with this too.

Also: in IE9 this seems to stay at the level of ton of errors, but a client has reported that on IE8 whole view simply freezes and nothing works. Again, not every time, but often enough to make it an issue.

Edit: actually this also seems to disable most features (links, lists etc.) in CKEditor (IE9.)

Edited by teppo

Share this post


Link to post
Share on other sites

Hi all,

I´ve posted something about using CKEditor for front-page inline editing. Teppo has told me about this thread, so I just wanted to connect. I see the possible use of various editors for inline editing has been discussed here before.

@apeisa: Your Adminbar module looks great. I´ve only become aware of it now.   => I´v just installed Adminbar for a test and it really works well, but if editing could be done "right on the page" (inline) that would be even more intuitive for the end user.

Share this post


Link to post
Share on other sites

Finally had time to take a closer look at that issue I mentioned earlier.

So far it seems very similar to this one affecting Drupal Colorbox plugin, which in turn points to page at MSDN. This could also explain why using IE9 I'm "just" seeing a bunch of "undefined" errors regarding various objects in console, while earlier versions of IE seem to freeze entirely. This behavior was, after all, apparently altered in IE9 to address memory leak issues.

@apeisa, have you heard of this issue earlier and if so, any chance you'd know how to fix it.. or if it even is what I think it is? :)

Edit: solution mentioned in this Stack Overflow thread (clearing iframe src attribute before removing it) seems to do the trick, at least in IE9. Still needs more testing, but at the moment I'm not seeing errors mentioned earlier.

This is what I've changed so far:

--- AdminBar.js (revision xxx)
+++ AdminBar.js (working copy)
@@ -78,7 +78,7 @@
        function slideUp(clean) {
                if (clean) {
                        $adminbar.data('active', 'browse');
-                       $modal.find('iframe').remove();
+                       $modal.find('iframe').attr('src', '').remove();
                        setActive($browse);
                }
                $adminbar.data('active', 'browse');
Edited by teppo

Share this post


Link to post
Share on other sites

Hi antti,

Not really sure if you are planning on maintaining this module anymore, since Fredi, but I just updated an old site that has this running to the latest PW dev version and there is an issue with the adminbar no longer being visible once you click on Edit. So if you decide not to edit the only way out of it is to hit the browser back button, or click save anyway, even though you have no changes.

Share this post


Link to post
Share on other sites

Antti,

AdminBar seems to hide the template dropdown when adding a new page on ProcessWire 2.5.2 sites.

I'm not sure why this particular line was originally added, but removing it fixes the bug:
https://github.com/apeisa/AdminBar/blob/master/AdminBar.module#L142

Do you have some idea if this change will cause problems with earlier versions of ProcessWire?

  • Like 1

Share this post


Link to post
Share on other sites

The reason that template change is disabled (or rather just hidden) is that when changing template, adminbar doesn't know how to show the confirm page (on template change), because it redirects before that.

When creating new page, then I think it's ok to have template select. Not sure which is better/simpler fix: showing it always and handling template confirmation on change situation - or just like now but making sure template select is available when creating new page.

Reason this is little bit "non issue" for me personally is that I have 99% time only one template allowed.

  • Like 1

Share this post


Link to post
Share on other sites
I understand that “non issue” point of view but I’d like to clarify this a bit more, maybe some other users are also wondering about this. =)

I agree that when creating a new page it’s ok to have a template select. Actually I think that it’s quite mandatory, because now in this case the template for the new page will always be the same that it’s on the parent page without any notification to the user. This could be quite confusing in some cases.

As you mentioned, removing that line would cause the template change to be visible in both views (creating and editing page). On previous versions of PW (not sure which versions exactly) the id of the element containing the template change was named differently thus causing the element only on the edit page to be hidden. Which was good. :)

Now on the new versions of PW the element containing the template change when creating a new page is renamed exactly the same for some reason and the adminbar, well, doesn’t behave the same way as usual anymore.

Creating and editing pages directly from the PW admin side of course works very well and doesn’t cause similar issues, but that’s not always the use case considering that site administrators may use both adminbar and the normal PW admin side.

Share this post


Link to post
Share on other sites

Anssi, didn't know that it used to work different (showing template select when it's allowed). Like I said, I pretty much always have only one template allowed for children.

Do you know is there some quick fix that would be backwards compatible?

Share this post


Link to post
Share on other sites

I think there might be some kind of quick fix for this, but “I’ll be back” with the details later this week.

Share this post


Link to post
Share on other sites

Hi Apeisa,

Can't remember if I mentioned this before... Adminbar has a bug now in PW 2.5. If you're editing a page in the admin in a modal window (i.e. a PageTable field or ListerPro set to use modal), when the page is saved the user is redirected to the front end of the page they just edited rather than back to the admin screen.

  • Like 1

Share this post


Link to post
Share on other sites

Antti, I'm not sure which one you read more often, so posting here too: could you take a look at issue #11? This is a potential fix for "modal admin issues", but I'd love to hear your views on it.. does it make sense, etc. :)

Share this post


Link to post
Share on other sites

Teppo, I read both, but finding time to actually respond and react is another story. Going through exciting, but busy times both home and work.

I'll get back to you at GitHub. Looks good, only thinking about using conditional autoload. We do have that now, wouldn't it be as simple as defining template!=admin in module info?

Share this post


Link to post
Share on other sites

Antti: that'd be great, but would that mean dropping compatibility with < 2.3.1? Or is conditional autoload backwards compatible? Should we care about that? :)

As a sidenote, perhaps, this would also make Inputfield::render hook useless (it's mostly useful when template is admin), though I'm not entirely sure at what point Admin started handling the 'modal' GET param properly either. Perhaps it's no longer an issue in 2.3.1.

.. oh, and didn't mean to rush you, by the way! Just wasn't sure about the best way to point this out :)

Share this post


Link to post
Share on other sites

Maybe tagging current commit with pw 2.3 tag and update master with 2.4 and up compatible. No idea how world takes it (modules directory, current sites etc).

Share this post


Link to post
Share on other sites

I'm not aware of any 100% safe way to break module backwards compatibility without risking some older sites having issues. Tagging and adding a note about it here and at the modules directory is an option, of course, and another option would be creating a new branch for 2.3+ and leaving master as-is.

Options, options..

Support for specifying where to find a version of a module suitable to specific ProcessWire version could be nice addition to the modules directory and/or native modules manager, but that won't help us much here. Sounds like a wishlist item to me :)

  • Like 1

Share this post


Link to post
Share on other sites

Howdy,

Just tried this module and it works great, but when used with some other markup manipulator module like TemplateEngineFactory which also hooks into Page::render, hook priority could be handy.

As TempalteEngineFactory, like any view engine should output first, before any other manipulator hits the ground. I looked into it and since PageRender::renderPage() runs prior 110, TemplateEngineFactory, cannot TemplateEngineFactory run lower than that, or else its overrided by original PageRender. Also if AdminBars is installed, it's natural load order becomes before TemplateEngineFactory, so it gets rendered before actual output and is never visible.

Therefore i suggest that either core priority level for PageRender::renderPage() is lowered or AdminBar::pageRender() is rised in order to get around this "problem".

Before:

$this->addHookAfter('Page::render', $this, "pageRender");

After:

$this->addHookAfter('Page::render', $this, "pageRender", array('priority'=>1000));

This is only reasonable solution i came around with.

Nice module btw, good job. 

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

Just tried this module with pw 2.5.3. I'm also using bootstrap-framework as a base for my theme and I found out that bootstrap has modal-class defined which make a pretty mess with adminbar.

I changed:

adminbar.module

line 181: $modalClass = 'modal'; --> $modalClass = 'ab-modal';

adminbar.js

line 10: var $modalLinks = $adminbar.find('a.modal'); --> var $modalLinks = $adminbar.find('a.ab-modal');

That fixed the mess. I don't know is it a good idea but maybe it would be wise to change that class to ab-modal so it won't interference with common css/js frameworks.

  • Like 1

Share this post


Link to post
Share on other sites

Hi all. Just came to processwire form modx. Think it was good choice. This is just the entrance word.))

I made simple shop for my client and wanted to add admin bar, but noticed that if template using bootstrap 3 so admin bar not working

(it's lookes like screenshot that i attached.) Please help or may be someone already met this error(bug)

Thanks a lot!

post-3359-0-47436100-1431257608_thumb.pn

Share this post


Link to post
Share on other sites

Adminbar needs to have its classes prefixed to prevent some conflicts with other libraries. I posted about it here:

https://github.com/apeisa/AdminBar/issues/12

I would also recommend using teppo's fork:

https://github.com/teppokoivula/AdminBar

It takes care of several issues with newer versions of PW, although I don't think it includes the class fixes.

Share this post


Link to post
Share on other sites

Just in case, you love the module as much as i do ... and you think it looks a bit old fashioned.
I did a little styling update (just the css and a few fether svg icons):

screenshot.thumb.png.34ef896619a0a66ce82cd4f8d0b43eb3.png

To use it just put the attached files to site\modules\AdminBar

@Apeisa: You may apply this to the original module if you like!

 

 

 

AdminBar.zip

  • Like 4

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.56
      Composer: rockett/jumplinks
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! :)
    • By BitPoet
      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
      Still very alpha, 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  









    • By Orkun
      Hi Guys
      I needed to add extended functionalities for the InputfieldDatetime Module (module is from processwire version 2.7.3) because of a Request of Customer.
      So I duplicated the module and placed it under /site/modules/.
      I have added 3 new Settings to the InputfieldDatetime Module.
      1. Day Restriction - Restrict different days based on weekdays selection (e.g. saturday, sunday) - WORKING

       
      2. Time Slots - Define Time slots based on custom Integer Value (max is 60 for 1 hour) - WORKING

       
      3. Time Range Rules per Weekday - Define a minTime and MaxTime per Weekday (e.g. Opening Hours of a Restaurant) - NOT WORKING PROPERLY

       
      The Problem
      Time Slots and Day Restriction working fine so far. But the Time Range Rules per Weekday doesn't work right.
      What should happen is, that when you click on a date, it should update the minTime and maxTime of the Time Select.
      But the change on the select only happens if you select a date 2 times or when you select a date 1 time and then close the datepicker and reopen it again.
      The time select doesn't get change when you select a date 1 time and don't close the picker.
      Here is the whole extended InputfieldDatetime Module.
      The Files that I have changed:
      InputfieldDatetime.module InputfieldDatetime.js jquery-ui-timepicker-addon.js (https://trentrichardson.com/examples/timepicker/) - updated it to the newest version, because minTime and maxTime Option was only available in the new version  
      Thats the Part of the JS that is not working correctly:
      if(datetimerules && datetimerules.length){ options.onSelect = function(date, inst) { var day = $(this).datetimepicker("getDate").getDay(); day = day.toString(); var mintime = $(this).attr('data-weekday'+day+'-mintime'); var maxtime = $(this).attr('data-weekday'+day+'-maxtime'); console.log("weekday: "+day); console.log("minTime: "+mintime); console.log("maxTime: "+maxtime); var optionsAll = $(this).datetimepicker( "option", "all" ); optionsAll.minTime = mintime; optionsAll.maxTime = maxtime; $(this).datetimepicker('destroy'); $(this).datetimepicker(optionsAll); $(this).datetimepicker('refresh'); //$.datepicker._selectDate($(this).attr("id"),date); //$.datepicker._base_getDateDatepicker(); // var inst = $.datepicker._getInst($(this)); // $.datepicker._updateDatepicker(inst); /*$(this).datetimepicker('destroy'); InputfieldDatetimeDatepicker($(this), mintime, maxtime); $(this).datetimepicker('refresh'); */ // $(this).datetimepicker('option', {minTime: mintime, maxTime: maxtime}); } } Can you have a look and find out what the Problem is?
      InputfieldDatetime.zip
       
      Kind Regards
      Orkun
    • By teppo
      This module tracks changes, additions, removals etc. of public (as in "not under admin") pages of your site. Like it's name says, it doesn't attempt to be a version control system or anything like that - just a log of what's happened.
      At the moment it's still a work in progress and will most likely be a victim of many ruthless this-won't-work-let's-try-that-instead cycles, but I believe I've nailed basic functionality well enough to post it here.. so, once again, I'll be happy to hear any comments you folks can provide
      https://modules.processwire.com/modules/process-changelog/
      https://github.com/teppokoivula/ProcessChangelog
      How does it work?
      Exactly like it's (sort of) predecessor, Process Changelog actually consists of two modules: Process Changelog and Process Changelog Hooks. Hooks module exists only to serve main module by hooking into various functions within Pages class, collecting data of performed operations, refining it and keeping up a log of events in it's own custom database table (process_changelog.) Visible part is managed by Process Changelog, which provides users a (relatively) pretty view of the contents of said log table.
      How do you use it?
      When installed this module adds new page called Changelog under Admin > Setup which provides you with a table view of collected data and basic filtering tools See attached screenshots to get a general idea about what that page should look like after a while.
      For detailed installation instructions etc. see README.md.
       


    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




×
×
  • Create New...