Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/09/2017 in all areas

  1. Hey! My pull request with an integration for PW for the Toggl Chrome button was just accepted, yay! https://github.com/toggl/toggl-button/pull/788 For those who don't know, Toggl is a really great time tracker, and they have a handy Chrome extension that integrates with web apps by adding Toggl buttons to tasks and projects. Generally, these integrations are with task manager apps and CRMs, but I thought I could develop an integration for the PW admin. Although I did it mostly for the fun of it, I think this can be useful in some cases, and definitely it's great to see PW featured on their extension and github page!. They also seem to be quite picky with these integrations, so I'm glad they accepted the pull request. Here are some images to give you a taste of it
    5 points
  2. Note: this functionality is now built into AdminOnSteroids. I wanted to hide the Tree dropdown menu for some roles, so I made this simple module. https://github.com/Toutouwai/RestrictTreeDropdown RestrictTreeDropdown Allows the Tree dropdown menu to be hidden for selected roles. Usage Install the RestrictTreeDropdown module. In the module config select one or more roles to hide the Tree dropdown menu from.
    3 points
  3. Done! The latest version now allows you to hook into getQuery & getMutation methods of the ProcessGraphQL class. Those hooks are solely there so you could modify the query and mutation operations. Here how it might look like in your template file. <?php namespace ProcessWire; use Youshido\GraphQL\Type\Scalar\StringType; $processGraphQL = $modules->get('ProcessGraphQL'); wire()->addHookAfter('ProcessGraphQL::getQuery', function ($event) { $query = $event->return; $query->addField('hello', [ 'type' => new StringType(), 'resolve' => function () { return 'world!'; } ]); }); echo $processGraphQL->executeGraphQL(); The above code will add a hello field into your GraphQL query that responds with the string "world!". You'll have to use the Youshido\GraphQL library that ProcessGraphQL module uses internally. The same thing could be done with the mutation operation via getMutation hook method.
    3 points
  4. For reference here's a simple mutation field implementation <?php wire()->addHookAfter('ProcessGraphQL::getMutation', function ($event) { $query = $event->return; $query->addField('log', [ // define return object under type 'type' => new ObjectType([ 'name' => 'Log', 'fields' => [ 'result' => [ 'type' => new StringType() ] ] ]), // available arguments for the query 'args' => [ 'text' => new StringType() ], // what to do with the request 'resolve' => function ($value, $args) { // process given input // return object outline should be same as 'type' return [ 'result' => 'done. ' . $args['text'] ]; } ]); }); When you refresh GraphiQL console, you get your new field!
    2 points
  5. @abdus First of all you don't need to import ProcesGraphQL's vendor.php file. It is done automatically when you do $processGraphQL = modules()->get('ProcessGraphQL'); Second is, I don't see where you include your /site/templates/api/SubscriptionField.php file into graphql.php. So replace the require_once '../modules/ProcessGraphQL/vendor/autoload.php'; with require_once "./api/SubscriptionType.php"; in your graphql.php and it should work. Also, your SubscriptionField class requires the public function getName().
    2 points
  6. @Pretobrazza trying to answer your questions: 1. As stated in the MarkupLeaflet.module file, you are required to add the link to leaflet.js yourself. You can change the version to 1.0.3. Then you also have to change the link to the leaflet css in the same file line 106. If you decide to use the getLeafletMapHeaderLines method for injecting JS and CSS then you need to change lines 168 and 173. 2. This module does not support wms layers out of the box. You would need to expand the JS logic to use them. Over at leafletjs.com they have a tutorial on how to implement wms layers. The relevant code section in the module can be found in MarkupLeafletMap.js line 47. Following the tutorial on leaflet.js you might have to alter some other code in that file, too. 3. There is a shapefile plugin for leaflet.js that you could use to draw layers from your shape file. You can use the PW API and some PHP logic to create that shape file from the data in your pages, but I'm afraid this goes beyond the scope of this thread. This module is designed to draw markers of locations on a map where you can choose different map tile providers and assign custom fontawesome icons to your markers. All in all I think ProcessWire fits the job very well. But you might be better off just using the inputfield from this module on your pages to input the location data. And then setup the map rendering from scratch in your template file rather then using the render method that MarkupLeaflet.module provides. This should be easier than tweaking the render logic that this module provides. I can definitly encourage you trying to do this with PW and leaflet.js.
    2 points
  7. Hi @tpr, could you please add a "word-wrap: break-word" rule for the filename link when the 'no-truncate' option is on for File fields? See the screenshot below where filenames with underscore word separators do not wrap. Thanks.
    2 points
  8. Hi all, I'm creating a website for a magazine publisher. This will include a supplier section with press releases attached to company profiles. The idea is that companies can register and manage their profile and press releases (CRUD) via a dashboard. The dashboard is a Process module. Ben Byford's RedirectAdminPages module is being used to lock out the rest of the backend, with a few modifications. The following code should redirect every admin page to the dashboard page but still allowing logging out. However logging out just redirects to the dashboard page: // do not redirect if page matches: if($this->page->template != "admin" // any non-admin page || $this->page->is($this->redirectPage) // the dashboard page (prevent infinite loop) || $this->page->parent->is('/admin/login/') // various attempts to allow logging out || $this->wire("process") == 'ProcessLogin' || strpos($this->page->url, $this->wire('config')->urls->admin . 'login/logout') !== false ) { return; } // find roles set in module configuration and create array $roles = explode(',', $this->userRoles); // for each user in module config check to see if current user foreach ($roles as $key => $val) { // get a role from the roles array $roles[$key] = trim($roles[$key]); // if current user found with role then redirect if($this->user->hasRole($roles[$key])){ // redirect session to page stored in config $this->session->redirect($this->redirectPage); // code should never get here but this is a simple fallback break; } } } } I'm surprised that this URL matching doesn't work: || strpos($this->page->url, $this->wire('config')->urls->admin . 'login/logout') !== false Because this does work for allowing page edit: || strpos($this->page->url, $this->wire('config')->urls->admin . 'page/edit') !== false Any ideas? That issue aside, as a learning process I'm going to re-implement the dashboard as front-end pages. I guess that the advantage of using the ProcessWire back-end is most of the functionality is already there, you don't need to create forms and handle the processing, create / import css etc. So it'll be interesting to see how much of a difference this makes, and how much control each approach provides. I'd love to have some thoughts and feedback from those of you who've tried both methods? PS this will be my third website created with ProcessWire and it's already been a lot of fun, and as a CMS it 'just feels right', so a big thanks to Ryan and everyone who has contributed. Thanks
    1 point
  9. Hi guys! I'm creating a module to manage, edit, publish ... pages. It is very similar to ProcessBatcher. Changelog: In progress Features: Select pages with your mouse like a desktop enviroment. If you press "edit" the selected pages will appear in a lightbox. Drag pages to do actions. Any feedback is welcome
    1 point
  10. Hi @bmacnaughton You can add a custom field to language template and put needed values there. Just choose "Show system fields" in the template manager.
    1 point
  11. Set $event->cancelHooks and $event->replace to true in your first hook. Edit: First one should be enough.
    1 point
  12. well, I created a new user and defined her roles / abilities. for some reason, I don't know why, all the right for "guest" user got unticked. So, anything coming from Processwire would not show on the website. put all the guest-rights back in, it worked again.
    1 point
  13. It's just a test version. I will do when the module works correctly. Thanks
    1 point
  14. Very impressive. Why not post in the modules main forum? Gideon
    1 point
  15. https://github.com/processwire/processwire-issues/issues/237
    1 point
  16. This config setting sounds like it should do what you're aiming for... $config->sessionCookieDomain null or string Domain to use for sessions, which enables a session to work across subdomains, or NULL to disable (default/recommended). ...but I see you have already tried that. Maybe try without the leading dot? If that setting still doesn't work I suggest opening a GitHub issue so Ryan can confirm if it's a bug or not. Sorry to hear this is proving so difficult to get working. If you want to investigate some more yourself you could install the essential Tracy Debugger and start dumping stuff inside /wire/core/Session.php to try and find out where the issue is occurring.
    1 point
  17. @M.O.Z.G - I think you must be running the Legacy version of the Tracy core? Do you have PHP 5.4+ so you can run the Master version? That said, I still don't know why all those "previous" bars are staying like that. Do they go away if you clear the PW session (log out and back in again)? Does the problem continue after that? When did this start happening for you - was it a PW or Tracy upgrade, or a move to a new server? Any unusual session settings on the server?
    1 point
  18. // save user default language $savedLanguage = wire("user")->language; $emailLangauge = wire("languages")->get("german"); wire("user")->language = $emailLangauge; $mail = $yourpage->render(); // restore the original language setting wire("user")->language = $savedLanguage; Not tested
    1 point
  19. You might need to override paths for other site specific directories, such as cache, logs, sessions to get a better separation. If it were possible override assets directory altogether, that would be much better, but for now, this should suffice. If anyone knows how to override /site/assets/ path, I'd love to be enlightened.
    1 point
  20. @PWaddict, if you want to hide just the Tree menu I made a module for that: AdminOnSteroids adds some classes to the body element that can help with this: https://github.com/rolandtoth/AdminOnSteroids/wiki#extra-classes-added-to-body-tag So you can prefix your CSS rule with body.role-nonsuperuser
    1 point
  21. The latest core dev branch coming soon to the master branch, plus several Pro module updates and more. https://processwire.com/blog/posts/processwire-3.0.59-module-updates-and-more/
    1 point
  22. I'll have a look on the above issues/requests later, nowadays I'm busy with a 4.04 kg newborn who thinks he can steal all the hours in a day (and night)
    1 point
  23. im looking to revamp the Subscribers module soon and create a site to show its implememtation - I was thinking a simple job listing CV site unless someone could think of anything better?
    1 point
  24. You might also try conditional hooks: https://processwire.com/blog/posts/new-ajax-driven-inputs-conditional-hooks-template-family-settings-and-more/#new-conditional-hooks
    1 point
  25. Handy shortcuts to edit translations in a textdomain file in other languages in the upcoming version:
    1 point
  26. You'll probably like the Bourbon family, on SCSS. http://bourbon.io -- Mixins http://neat.bourbon.io -- Semantic grid http://bitters.bourbon.io -- Bootstraping styles On bigger/more complex projects, have a look at the Susy SCSS layout framework, mixed with Bourbon and Bitters. http://susy.oddbird.net uikit and the like are nice, but I think there is too much overhead when modifying them.
    1 point
×
×
  • Create New...