-
Posts
4,054 -
Joined
-
Last visited
-
Days Won
67
Everything posted by Pete
-
Closed this topic as this functionality is now part of the core in 2.3/2.4.
-
I forgot modules take a little while to become approved in the directory - you should be able to download and test this module out now.
-
I've got two notices and a fatal error from your latest version on GitHub: Notice: Trying to get property of non-object in D:\wamp\www\echofinance\site\modules\ProcessPageTreeMigrator.module on line 879 Notice: Trying to get property of non-object in D:\wamp\www\echofinance\site\modules\ProcessPageTreeMigrator.module on line 1049 Fatal error: Call to a member function getArray() on a non-object in D:\wamp\www\echofinance\site\modules\ProcessPageTreeMigrator.module on line 1052
-
Marco - as Soma says, use json_decode to turn the JSON you posted into an array, then just use ProcessWire's API as normal to create pages and add this content to your pages if that's what you want to do: http://processwire.com/talk/topic/352-creating-pages-via-api/ If you just want to simply output that data and not save it, then as Soma says, just use json_decode and it will be a normal PHP array that you can use. I think you're thinking there's more to it than that, but there's really not
-
For me, all I wanted it for was to create dashboards which I've just created a module for: http://processwire.com/talk/topic/5785-processdashboard/ Whilst I've made it really easy in my module for people to use a template file instead of touching the module, you're right in that ProcessModules are fairly easy to get along with once you take the plunge, so I've been sure to mention the ProcessHello module there as some encouragement for folks to roll their own modules.
-
It's worth mentioning that whilst I've made it easy for newcomers to modules to create a dashboard template, it is worth learning how Process modules work so that you can create your own to do some amazing stuff in the ProcessWire admin. See the ProcessHello module as a starting point: https://github.com/ryancramerdesign/ProcessHello EDIT: There was also another way to do this module - I could have skipped creating a separate dashboard page under the admin page and simply made the admin page load the dashboard, however I quite like having the link in the menu at the top of the page so it's really obvious how to get back there.
-
Cool stuff - I like the PW and PHP version requirements. Since we have a way to automatically install modules, can we have "installs" go and try to fetch the module from the modules directory? It would be really neat if it did that as long as people don't abuse it.
-
This module creates a blank dashboard page in your site admin and sets it as default when you login instead of the page list. It came from a need in a few projects where I was creating modules for various user roles to use and I didn't want them to see the page list at all, but needed to display various stats and quick access buttons. For example, if you have a person who is creating invoices or doing other back-office stuff in various other Process modules then as an admin you wouldn't want them to access the page tree anyway, and there are other scenarios where you might want to have a dashboard instead of launching straight into the page list. It also requires (and adds) a permission - "dashboard" - so you can create new roles and assign the dashboard permission to those roles - something you might want to do fairly commonly if you have a lot of admin modules that you want to restrict access to. Editing the template is simple - there is a dashboard.php template file in the /site/modules/ProcessDashboard/ folder (decided to leave it in there to keep it safe, but I might be tempted to move it into /site/templates/ ) as well as .js and .css files ready to add your code to. You can use the API as you usually would to create your dashboard experience. For example, display data based on user roles or even specific users using code like this: if ($user->hasRole('invoices') { echo "Hi staff member $user->name. View invoices to be processed below: ... ..."; } if ($user->name == 'pete') { // Show some super-awesome stuff here } You can also do away with the dashboard.php template file and edit the module directly, putting your code and output in the execute() function (the way most Process modules are written) but I decided to include the separate template file to make it easier for more people to use. This does touch on areas a few other modules have addressed to some degree (like diogo's Custom Admin Pages) but this is designed for one purpose - instant dashboard creation. You can download the module here: http://modules.processwire.com/modules/process-dashboard/ This module also uses code from diogo's ProcessHomeAdmin module so that the default admin page can be overridden.
- 18 replies
-
- 20
-
-
It did indeed resolve my problem - thanks again to a 2 year old solution from Soma
-
This may have my answer as long as admin roles aren't required to see Pages list to log into the admin: http://processwire.com/talk/topic/916-admin-page-permissions/ Will try it when I'm home and report back.
-
Hi chaps I've created a custom admin page to act as a dashboard and used one of diogo's modules to set it as default. What I'm struggling with is creating a role that can see the dashboard but not the Pages tab for staff that I don't want to be able to edit or see the page tree. If I give my dashboard page a new template then I can assign that role, but if I take away the page edit permission from that role then they can't see the admin. If I give them the page edit permission then they can see the Pages tab but they can't see the admin page in the page tree so they also can't see my dashboard. Is there a way around this? Seems like something that would really restrict being able to create custom admin pages with associated permissions.
-
@Diogo - with this module in PW 2.4, it loads the theme from /wire/templates-admin/ instead of the new admin theme. Not sure why there is still an admin theme in /wire/templates-admin/ in the latest download I have no idea why it's not defaulting to the new theme as every other admin page does
-
Sorry diogo - bit of a late reply It does work if you actually follow the instructions and change the default admin page to use the Process (I was being an idiot and changing my new admin page to use the process).
-
I added that to the layout.css file to fix the issue - thanks. I also set the top buttons back to display: none in global.css as ryan mentioned they should be hidden on mobile.
-
Fixed that - thanks for the code
-
I don't think there's any need in changing the homepage to "core" and putting a "home" page underneath it. The way it's setup by default is that all content is a child of the homepage - the homepage being the start of the website. Why not simply create a "Profile" page under home and put these pages under the Profile page: Calendar | Messages | Projects | etc ? If the user is logged in you then show the Profile page else show a Login page. Or are you trying to have customised home pages for each user?
-
I've changed the PHP version on that page, but I feel it should also mention PDO and maybe some other things - I'll PM ryan in a bit to make sure he sees this. If all else fails though, the installer tells you which PHP version you need - hence the message. Granted the website should be kept up to date, but if the installer requests something then that's the required version. Squeeze seems to be something to do with Debian perhaps: https://packages.debian.org/squeeze/ ? Not sure what it is and never seen it before to be honest.
-
Hehe, it's a case of no jobs coming along for a while and then three coming along at once. Not that I'm complaining!
-
Yeah, in my version you don't need it to be in a function unless you are using this code on many different templates? If it's just in one template then the function isn't needed.
-
It doesn't particularly need to be in a function, also I'm not sure why you're using wire() since in a template you can just use $page directly - anyway, you can get rid of the } else { if you start it a bit like this instead: $out = ''; // Starting with this means you don't need } else { as it's defined and empty to begin with if ($page->slider->count() > 0) { // There's no overhead in just doing this count directly instead of assigning it to another variable // ... more of your code here foreach ($page->slider as $albumimage) { // Again, you can just user $page->slider directly here // ... the rest of your code here
-
If I had any spare capacity I'd be interested in working with you further Nik, however I'm booked solid for several months at least.
-
But he needs to find the page with that JSON string I think, which is much more difficult given single and double quotes. The only way I can think of to do this is have another JSON field called something like "sanitizedmyjson" and on page save, strip out all quotes and store that copy in that field, then do the sanitized selector based on that field. Sanitizer probably strips out other stuff too, but you get the idea.
-
GoCardless is for Direct Debits, and you don't get the money as quick as other solutions (minimum 7 days I think for the first payment whilst the DD is being set up) but it is good for certain things, especially as credit/debit cards expire but DD's are based on your bank account details - and how often do people change bank? Less often than their cards expire Stripe is really good - better fees than PayPal and better interface. You can pretty much implement their Checkout example and you're up and running in no time (relatively speaking): https://stripe.com/docs/checkout
-
Oops, at the same time I've been changing display: none to display: block in global.css Is this going to cause an issue ryan? I'll leave it to you since two people editing CSS at the same time usually ends in disaster and overwritten styles!
-
I spotted the buttons were missing and assumed ryan removed them for some reason. @kngondo and houseofdeadleg - this appears to happen in Chrome and not FF. Weird. I assume it's been doing it all the time.