mr-fan Posted September 17, 2016 Share Posted September 17, 2016 Quote I wanted to loop pages in a category. The https://processwire.com/api/selectors/ page didn't help me properly, as there is no example given with foreach so I copied that from the foreach Smashing Magazine article. I read that docs "properly", too and find out that the main magic with PW is something strange like $page and $pages and of course "selectors" hmm foreach a category...let me see where i as noob could find such things...;) https://processwire.com/api/variables/pages/ (with some foreach examples) So ok pages are something like "WireArrays" what is that im curious maybe i should read this one... https://processwire.com/api/arrays/ (even there is a foreach example) Don't get me wrong but my heart is fighting a little for every newbies....and with your posts the other newbies get a wrong view... 3 hours ago, Sephiroth said: I think you over-thinking things, it could be any button, the code i have is just an helper and nothing more..... 3 hours ago, BitPoet said: It's actually not difficult at all to add the button and make it do what you want. PW is all about HTML + PHP, no fancy magical layers and MV(V)C patterns to bump your head against (unless you really want them, that is). Take a breath - take the time to experiement yourself with the API in combination with YOUR HTML of choice at start with AdminCustomPage you don't have to use MarkupModules or Core UI Elements...you are free to build what ever you want and pull the data with the PW API in your Output....and ask question nice and calm. There is no way to do things right so there is no doc that say "step 1 - step 2 - step 3 - finished" Your only get many many many options to get to your goal - you have to choose yourself All that options are not documentated only the API and the whole core codebase is there....plus tutorials....plus a real great forum with posts from 2012 thats code is today working good!!! ->plus helpfull and friendly people here that offers everyone help! If you had read throw my links and studied the code from the MarkupAdminTables you have had found things like this one: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupAdminDataTable/MarkupAdminDataTable.module#L171 //for the lazy people i cp all important here... if(count($this->actions)) { $out .= "\n<p>"; foreach($this->actions as $label => $url) { $button = $this->modules->get("InputfieldButton"); $button->href = $url; $button->value = $label; $out .= $button->render(); } $out .= "\n</p>"; } Ohh i learnd that i can add action buttons to the rendering of the MarkupAdminTable module...nice and second i learnd how to create UI buttons with the Core Inputfield...from reading simple the code and don't search some documentation and the great thing in PW is i can use that Markup everywhere frontend, backend.... Quote I hate to ask noobish questions, but there is no documentation page I can go on, which will teach me how to do it. Documentation "teach" you nothing - documentation only describes what and how you can to do with software....like i wrote in PW you only need to learn and use the API and you can do all how you want it be done.....this is the point of the matter. There is no and i hope will never be a documentation that teach me how i have to build up my system or programm my websites and applications - this task is on my own. Since this is a forum of a free opensource software, no one has to aswer carp and claiming questions in his sparetime...there are no noobish questions in this forum - al things get sorted well with this community but always with a friendly and dedicated attitude on both sides. Sorry for my harsh words but all your post seems to be impatient and reproachful - exept i'm mislead your words. Best regards mr-fan 6 Link to comment Share on other sites More sharing options...
desbest Posted September 19, 2016 Author Share Posted September 19, 2016 How do I make a button appear only where the arrow is? I searched google for head_button_clone and browsed the documentation and couldn't find anything. Also you'll see an [edit] link in my custom admin panel (above). Is there any way to change it to the type of edit/view/new, as the lister does below. I looked inside function ___buildListerTableColActions(Page $p, $value) { in ProcessPageLister.module and it doesn't appear that code can be copied to my admin page. Link to comment Share on other sites More sharing options...
qtguru Posted September 19, 2016 Share Posted September 19, 2016 41 minutes ago, desbest said: head_button_clone That's a CSS class there's nothing more to it, is your project online ? or can you dump an SQL of the project with the files. Link to comment Share on other sites More sharing options...
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