diogo Posted June 24, 2013 Author Posted June 24, 2013 Sorry, I wasn't really thinking when I did that... I guess my head is still on vacation mode (does this answer to your question kongondo? ) Should be working now. 1
adrian Posted July 16, 2013 Posted July 16, 2013 Just used this for the first time - so easy! I am using 1.04 with the latest dev (as of today) Thought everything was working great, but then when I went to test to see if general admin users could see it, I discovered that they could see the new page just below "Access", but then when I clicked on it, I get a "You don't have permission" error. I have looked through all the permission options I can think of and can't seem to get it working. Any thoughts please?
kongondo Posted July 16, 2013 Posted July 16, 2013 Adrian, What do you mean by just below "Access". Is your new custom admin page appearing as a child of "Access" or as direct child of "Admin"?
diogo Posted July 16, 2013 Author Posted July 16, 2013 I confess I didn't think of this when I created the module... Thanks for finding it I already corrected it on github, but if you don't want to download it again, just add these changes to the module file: static public function getModuleInfo() { return array( 'title' => 'Admin Custom Pages', 'summary' => 'Create custom admin pages without building a Process Module', 'version' => 105, // <-- change the version number 'author' => 'Diogo Oliveira', // <-- add this comma 'permission' => 'page-view' // <-- add this line ); } This gives permission to anyone to use the process, but you still can control the permissions for the pages in their templates. Edit: kongondo, he means the process itself. Even if the page is viewable by the user, the process wouldn't run, and throw that message. 1
kongondo Posted July 16, 2013 Posted July 16, 2013 Aah. OK. Nice catch Adrian.. @Diogo...so the latest commit is version 1.05 then, no?
diogo Posted July 16, 2013 Author Posted July 16, 2013 @Diogo...so the latest commit is version 1.05 then, no? Already changed
adrian Posted July 16, 2013 Posted July 16, 2013 Awesome diogo - thanks for the quick fix - sorry i didn't think to look there last night - was too late
owzim Posted August 20, 2013 Posted August 20, 2013 Nikola, try this one (needs the DEV branch of PW because it uses render($filename)). Create a new template (can be named "customAdmin" for example) and put this on the template file: <?php $page->process = "ProcessAdminCustomPages2"; require($config->paths->adminTemplates . 'controller.php'); Create two fields and put them in the template: "render_file" (text field) "scripts_and_styles" (text area) Now, if you create a page under admin and assign this template to it, you can specify a file to render the page. To load scripts and styles add all the urls in each line (this is still a bit rough). To add custom fields to the page, just create a new template without file, and specify "customAdmin" as the alternate template filename. Use this one instead of the "customAdmin". Add the "render_file" field to it and, optionally the "scripts_and_styles" field. This version doesn't have configuration options Unfortunately this did not work for me, the custom admin page throws the following exception (by PageRender): Invalid output file location or specified file does not exist. I also checked in in ProcessAdminCustomPages2.module via: file_exists($this->config->paths->templates . $this->page->render_file . ".php") It is there. Tried it with 2.3.3.3
diogo Posted August 20, 2013 Author Posted August 20, 2013 owzim, that's an old one, use the version of the module that is on github, and follow the instructions from there https://github.com/ocorreiododiogo/pw-admin-custom-pages I will remove that file from that post... 1
NooseLadder Posted September 26, 2013 Posted September 26, 2013 Hi, I have just added the 'Admin Custom Page' module to a dev site. What I am not sure about is how to use it. This is what I have done so far. I am using PW 2.3.0. 1. Installed 'Admin Custom Page' module v1.05 via the admin. 2. Created template called 'test-custom-page' without a .php file. 3. Added 'admin' as the Alternate Template Filename. 4. Added the field 'ACP_scripts_and_styles' to 'test-custom-page' template. 5. Created new page under Admin called' test-custom-page' with template 'test-custom-page'. 6. Added the following scripts and styles url's to the 'ACP_scripts_and_styles' textarea: site/templates/scripts/jquery-ui-1.10.3.custom/css/ui-lightness/jquery-ui-1.10.3.custom.css site/templates/skeleton/stylesheets/skeleton.css site/templates/skeleton/stylesheets/base.css site/templates/styles/main.css site/templates/styles/theme.css site/templates/skeleton/stylesheets/layout.css site/templates/scripts/jquery-ui-1.10.3.custom/js/jquery-1.9.1.js site/templates/scripts/main.js site/templates/scripts/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.js 7. Created template called 'test-child' with fields: title; headline; body; images. This is based on my basic-page template and has a .php file called 'test-child.php'. 8. Created a child page of 'test-custom-page' called 'test-child' with template 'test-child'. Tree = Admin > Test Custom Page > Test Child. When I view Test Custom Page the page is loaded in the admin with mssg: 'This page has no Process assigned.' I'm not quite sure what should happen here? If I view the child page ('Test Child') it is rendered as normal with header, body, footer etc. Any help appreciated as always.
adrian Posted September 26, 2013 Posted September 26, 2013 Does this help? http://processwire.com/talk/topic/4570-implementing-small-tweet-like-thoughts/?p=44925 2
NooseLadder Posted September 26, 2013 Posted September 26, 2013 Thanks Adrian, that was the answer. Just to clarify for anyone else reading this, the admin.php file in the templates folder should have been modified to add this code when the module was installed, but for some reason it did not happen, so I manually added it and it now works. What I mean is the child page is now rendered in the parent in the admin. // line added for the Custom Admin Pages Module if($page->template->id !== 2) $page->process = "ProcessAdminCustomPages"; I wonder if someone could clarify if this is the right 'tool' for my needs: I would like to have an admin only page that produces a report (table), effectively a report generator where you select the fields (all existing fields) you want in the report from dropdowns in each column or just select the fields and the table is created based on the selected fields, one field per column. I haven't thought this through 100% but any ideas are welcome. 1
diogo Posted September 26, 2013 Author Posted September 26, 2013 I updated the README file on github with a troubleshooting section with the solution to this problem https://github.com/ocorreiododiogo/pw-admin-custom-pages/blob/master/README.md 1
BeardedCanadian Posted October 1, 2013 Posted October 1, 2013 A quick permissions question. I have this module installed and it works fine for the superuser. Are there any tricks involved in allowing another user to use this admin panel, i.e. I would like users with the role of 'author' to also see/use it.
diogo Posted October 1, 2013 Author Posted October 1, 2013 The pages of the module are normal PW pages, so the permissions apply like with any other page. Go to the page template and give the permissions there.
diogo Posted October 1, 2013 Author Posted October 1, 2013 I had a click while reading this post http://processwire.com/talk/topic/4642-keeping-a-page-in-a-fixed-position-last-in-the-sorting-order/ and quickly implemented something I was thinking about for some time already. I added a new functionality on the DEV version. Now the module allows to easily create a "settings" kind of page. Putting it simply, you can create a tab in the admin that shows the "edit" page of that same page. See it for yourself https://github.com/ocorreiododiogo/pw-admin-custom-pages/tree/dev edit: for those interested on how it works, don't look on the module file, look on the admin.php file. 4
FuturShoc Posted November 3, 2013 Posted November 3, 2013 I've installed the module and followed the most up to date instructions and I'm using PW 2.3.0. My new admin page's name does appear at the top of my PW admin area: "Pages", "Setup", "Modules", "Access", "myadminpage". BUT, when I click on myadminpage, I get a 500 server error. Is there something else I need to check?
diogo Posted November 3, 2013 Author Posted November 3, 2013 Did you follow the instruction for the stable version of PW? For the stable version you need to create a child of the page to hold the template.
Roope Posted November 13, 2013 Posted November 13, 2013 Hello diogo, thanks for great module! Has anybody used this with url segments? I tried but noticed some bug on latest dev. It throws TemplateFile: Unrecognized path error notice when there is some url segment in use. Not any content from template file.
diogo Posted November 13, 2013 Author Posted November 13, 2013 Hi Roope, thanks for reporting. I can't have a look at it now, but can you clarify how you are using the url segments? is it on the admin side? I never tried that... edit: ok, i can recreate this behaviour. I'm not sure if Ryan established some kind of limitation to using URL segments in the admin (all other admin pages use get), but it's something to find out 1
Roope Posted November 14, 2013 Posted November 14, 2013 Isn't /page/ and /page/add/ just url segments in admin?
diogo Posted November 14, 2013 Author Posted November 14, 2013 No, they are pages. You can see them on the tree.
Roope Posted November 14, 2013 Posted November 14, 2013 True, and sorry. Just made a quick assumption here.. Well, I'm totally fine with get if there is some limitation to url segments in admin. I'm sure Ryan will clarify us on this one.
Roope Posted November 14, 2013 Posted November 14, 2013 Admin Templates and Fields looks to have edit url segment.
diogo Posted November 14, 2013 Author Posted November 14, 2013 Can't be. The admin template doesn't have segments activated. I did activate them just to try out, and I get the same error anytime I add a segment to any page in the admin. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now