kongondo Posted July 10, 2014 Posted July 10, 2014 What do you mean by no success? I also see that you haven't rendered your form...i.e. echo $form->render();//or return if in a function... 1
Alexander Posted July 10, 2014 Posted July 10, 2014 Kongondo, yes and no. I know, that is not elegant way, but I try to find page parent that have the same name with user to provide access. $p->set('id', 15729) = working $p->set('id', $p_page) = no $p_user = $user->name; // set user name $p_page = $pages->find("title=$user->name"); // try to find page with the same with user name $p = $this->modules->get('ProcessPageList'); // kongondo's code goes here $p->set('id', $p_page); // setting the parent page to user name page May be you know the reason?
kongondo Posted July 10, 2014 Posted July 10, 2014 (edited) I think $p->set('id', '12345') requires and integer. $p_page is not an id but an object. Try: $p->set('id', $p_page->id) Untested... If that is not the problem, then it is the $pages->find. If you are getting only one page, use $pages->get instead...since you only need one ID.. Edited July 10, 2014 by kongondo
kongondo Posted July 10, 2014 Posted July 10, 2014 (edited) Tested. This should work... $p_user = wire('user')->name;// set user name $p_page = wire('pages')->get("title=$p_user");// try to get page with the same with user name $p = $this->modules->get('ProcessPageList'); $p->set('id', $p_page->id);// setting the parent page to user name page Edits: Edited code above to show class/module use context... Also edited some typos in your original code (which I also subsequently copy pasted ) Edited July 10, 2014 by kongondo 2
Alexander Posted July 10, 2014 Posted July 10, 2014 Brilliant! It's 100% works! Now I can sleep well. Kongondo, thank you very much for your help!
mr-fan Posted September 3, 2014 Posted September 3, 2014 I took this code https://processwire.com/talk/topic/6315-processpagelist-to-hide-some-pages/?hl=backend for custom page template: <?php $form = $this->modules->get('InputfieldForm'); // prep the form $wrapper = new InputfieldWrapper; // a wrapper $wrapper->attr('value', 'List of available articles'); $p = $this->modules->get('ProcessPageList'); // kongondo's code goes here $p->set('id', 4049); // setting the parent page $pageTree = new InputfieldMarkup; // the placeholder $pageTree->value = $p->execute(); // fill the InputfieldMarkup form field... $wrapper->add($pageTree); // put inside the wrapper... $form->append($wrapper); // append the wrapper ?> One question: what should i consider if i wanna two or tree pageList's in the same template? i've different "main" contentareas that would be great to show up in a dashboard like adminpage Tree 1 Images -images -cat -img -img Tree 2 News -news -post -post -post ... i did run the code above twice with different id's but it seems that the last id overwrite the first one? Could ProcessPageList only run once on a page? For that i will only create a dashboard for "fast create" the mainthings (image, newspost, special of the week and so on).
mr-fan Posted September 5, 2014 Posted September 5, 2014 One question: what should i consider if i wanna two or tree pageList's in the same template? anyone? or a hint if this was possible or is it not possbible to get two pagelist's working on one page, i don't think since i've seen this in other complicated processadmintools, too but i didn't get an idea what i've overlooked?
diogo Posted September 6, 2014 Author Posted September 6, 2014 Can you post the code with that you tried for the two lists? Did you change also the variables?
mr-fan Posted September 7, 2014 Posted September 7, 2014 did change all the varnames into different on the two calls: <?php $formImages = $this->modules->get('InputfieldForm'); // prep the form $wrapperImages = new InputfieldWrapper; // a wrapper $wrapperImages->attr('value', '<h2>Bilder</h2>'); $i = $this->modules->get('ProcessPageList'); // kongondo's code goes here $i->set('id', 1015); // setting the parent page $pageTreeImages = new InputfieldMarkup; // the placeholder $pageTreeImages->value = $i->execute(); // fill the InputfieldMarkup form field... $wrapperImages->add($pageTreeImages); // put inside the wrapper... $formImages->append($wrapperImages); // append the wrapper echo $formImages->render(); $formFiles = $this->modules->get('InputfieldForm'); // prep the form $wrapperFiles = new InputfieldWrapper; // a wrapper $wrapperFiles->attr('value', '<h2>Dateien</h2>'); $f = $this->modules->get('ProcessPageList'); // kongondo's code goes here $f->set('id', 1033); // setting the parent page $pageTreeFiles = new InputfieldMarkup; // the placeholder $pageTreeFiles->value = $f->execute(); // fill the InputfieldMarkup form field... $wrapperFiles->add($pageTreeFiles); // put inside the wrapper... $formFiles->append($wrapperFiles); // append the wrapper echo $formFiles->render(); if i comment out the first - second works if i comment out the second - first works.... so that was my base question: One question: what should i consider if i wanna two or tree pageList's in the same template? if this doesn't work with the PageList i could work arround with a own created list with pagination and a add new button.....with the tree it would be more comfortable...
mobility Posted October 13, 2014 Posted October 13, 2014 Hi, I am trying to setup this as a new page and I am getting this error: You have to assign a template file to this 'Admin Custom Page'. But when I go in and edit the page I do not see anywhere to add a template as described in the setup instructions.
mr-fan Posted October 13, 2014 Posted October 13, 2014 1. First you have to create a new page with the admin template (under the admin!) 2. Choose the right "Admin" Process on this adminpage on the first tab (content) 3. Then a new row shows up and you can choose your own template that lives in /site/templates/ In this template you could work like with Frontendtemplate with the API and show some stuff there no borders...
Macrura Posted October 27, 2014 Posted October 27, 2014 i just upgraded this module and installed the helper module, but i don't get a field to select a template do i need to also add ACP scripts to the admin template? ... edit: i uninstalled the main module and then reinstalled, and it added the necessary field to the admin template.. it's all working now... btw - thanks Nico for working on this, it's great to be able to use the custom pages with the new admin themes..
mr-fan Posted October 27, 2014 Posted October 27, 2014 What version? I use 1.1.1. from http://modules.processwire.com/modules/process-admin-custom-pages/ ACP scripts and styles are optional to load .js and .css on the template but the choice for template on the admin page should appear if you choose the Process - see screenshot? You even didn't need a template under the template section since the template select lists all .php files in site/templates.... regards mr-fan 1
Robin S Posted June 28, 2015 Posted June 28, 2015 (edited) I'm confused about how to add styles and scripts to my custom admin page. The docs say: Create a new page under "Admin" and give it the "admin" template. ...and then... Add the "ACP_scripts_and_styles" to the page template (the field that was created automaticaly on instalation) So I take this to mean I have to add the "ACP_scripts_and_styles" field to the "admin" template, but admin is a system template and so is hidden unless Advanced Mode is activated. So do I need to activate Advanced Mode in order to add this field? --- Edit: After going ahead and trying it I think I can answer my question above with a "yes". This isn't obvious though, and I think the module would be easier to get started with if the "ACP_scripts_and_styles" field was added to the admin template when the module is installed, like the "ACP_template" field is. Edited June 28, 2015 by Cerulean
diogo Posted June 28, 2015 Author Posted June 28, 2015 Hi Cerulean, Thanks for the feedback. I think adding a field to a system template should be done in an informed way by the user of the module, especially if it's a quite quick thing to do and if it won't be needed in all cases. I will update the documentation to be more explicit, though.
bernhard Posted October 30, 2015 Posted October 30, 2015 hi diogo, thanks for the great module! i just moved a site from dev to live server and got an open basedir restriction error. it looked for the template file unter /var/www/site/... instead of /var/www/vhosts/xyz.com/site/... i had to go to that page and assign the template again. maybe you can change this to use relative paths down the PW rootpath? thanks PS: no problems with the scripts and styles paths! 1
diogo Posted November 3, 2015 Author Posted November 3, 2015 Bernhard, I have on my todo list answering to this, but still couldn't have a proper look at it. Just to let you know. 1
bernhard Posted November 3, 2015 Posted November 3, 2015 not urgent at all, as it works once updated manually - i just wanted to report it to further improve the module 1
Jon Posted January 21, 2016 Posted January 21, 2016 Hello Great Module, Just wondering if its possible to not show to show a dashboard in the I have 2. The first one links into the other but I dont want people going to the second one without clicking the link in the first.
adrian Posted January 21, 2016 Posted January 21, 2016 Hello Great Module, Just wondering if its possible to not show to show a dashboard in the I have 2. The first one links into the other but I dont want people going to the second one without clicking the link in the first. I think it should just be a matter of setting the page to hidden. 1
Jon Posted January 21, 2016 Posted January 21, 2016 Thanks Adrian! Such a simple solution! Ill just delete that css display:none I added
Jon Posted January 28, 2016 Posted January 28, 2016 Just wondering how you would go about changing the icon for custom admin pages?
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