Jump to content

Search the Community

Showing results for 'pagelist'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hey @adrian I'm using ProcessPageList() to render a pagelist in my custom process module. I wondered why I only get bd() calls in the debug bar for ajax requests when collapsing a tree item, but not for the very first one. This is my code: <div id='pageviews'></div> <script> $('#pageviews').ProcessPageList({ rootPageID: 1, showRootPage: true, ajaxParams: {'rockcounter': true}, }); </script> I then tried wrapping that code in setTimeout() with a delay of 1000ms and then I got the bd() calls also for the very first request. Is there any recommended way of dealing with this? I tried to wait for dom ready, but that seems to be too early and tracy didn't catch the first request. On my laptop it works with a delay of 100ms, but in other setups it might be different, so I'm wondering if there is a solid way of waiting for tracy to capture the ajax call?
  2. What is your intention with this module? I think it would make more sense to add the tweaks directly to RockAdminTweaks, no? https://github.com/netcarver/RockAdminTweaksPool/blob/697240eb651dd873585b7f2630a81f2d905192ca/assets/RockAdminTweaks/AdminOnSteroids/BypassTrash.php#L28 --> this is not needed any more, because tweaks are only loaded in the backend, so it will always be template == 'admin' Regarding styles and scripts: I've added a "loadJS()" method on the Tweak base class. This will automatically load the corresponding js file from the tweak. See docs here: https://github.com/baumrock/RockAdminTweaks/tree/main/docs/assets Personally I'd prefer to have all the JS in dedicated JS files. It's a lot easier to write, a lot easier to read (no escaping, working color highlighting etc) and it's also easier to develop and debug (as you can set breakpoints, for example). I think the same concept makes sense for CSS files as well, what do you think? I'm just not sure from a performance perspective. Does it matter if we load multiple scripts with just a few lines of code? Would it be better to inline them into the HTML? But I don't like this ugly script and style injections via str_replace... So I've just added loadCSS() method as well! Regarding the AdminOnSteroids folder: I think it's nice to mention tpr's module, but I'd like to group tweaks based on what they do or where they add magic. For example I've added a "PageList" folder for tweaks that relate to the pagelist/pagetree and a "Forms" folder that relates to all kinds of forms or inputfields (page edit etc). If you have suggestions for other folders please let me know. The folder "AdminOnSteroids" makes no sense in my opinion.
  3. The admin page list seems to be hiding the content of page labels inside square brackets. For a page titled Some Title [old], it will display as Some Title, removing the content inside the brackets. Oddly enough, a page titled Some Title [old content] displays correctly as Some Title [old content]. My guess is that ProcessWire is trying to interpret the part in square brackets as dot-field notation and trying to access a field value. Since there's no field named 'old', it will drop the brackets and everything inside entirely. Is this documented behavior? Can this be turned off? (Tested on latest dev branch, 3.0.171 and 3.0.181)
  4. I'd need some advice how to search for specific pages that have use a certain value in a page reference field. The task is quite simple: find all pages with a certain template that also use a page reference field with a specific title. $pageList = $pages->find("template=myTemplate, {PRField->title}={$input->urlSegment1}"); I also tried to split it but to no avail: $pageList = $pages->find("template=myTemplate, {PRField->title}={$input->urlSegment1}"); $finalpageList = $pages->find("{$pageList->PRField->title}={$input->urlSegment1}"); I'm absolutely positive that I'm missing a crucial point here.
  5. Hi I'm currently developing a website for a photographer and the most of the editing needs I#m using FrontEndEditLightbox. https://github.com/rolandtoth/FrontEndEditLightbox So far so good. Now I also want to show the PageList sliding in from the side, like when clicking on the little tree in the admin area. How can I achieve this? I've already seen the xhr - request that is done when clicking and have implemented a javascript doing the same request and parsing that json. But i'm wondering if that is the right way to go? Thanks. robig
  6. Make sure: in myTemplate settings>URLs you Allow URL Segments then // decomposed example $title = $input->urlSegment1; // single $ref = $pages->get("template=myTemplate, title=$title"); // get retrieve a single result $pageList = $pages->find("template=myTemplate, prfield=$ref"); // or if many is needed $refs = $pages->find("template=myTemplate, title=$title|Foo|Bar"); // find retrieve a page array $pageList = $pages->find("template=myTemplate, prfield=$refs");
  7. Another way you could do it... In my example the parent template is "countries" and the child template is "country", and there are 195 child country pages. Using the PageEditPerUser module the user is only allowed to edit country pages "Zambia" and "Zimbabwe": Page List before: The problem being that lots of uneditable pages are included, with the two editable pages being at the end of the 4th pagination. I'm not using Admin Restrict Branch here so (presumably) that's why all the non-editable pages are listed, but that doesn't matter for the purposes of this example. A solution is to add the following hook to /site/ready.php: // Only for a particular role if($user->hasRole('editor')) { $wire->addHookBefore('ProcessPageList::find', function(HookEvent $event) { $selector = $event->arguments(0); /* @var Page $page */ $page = $event->arguments(1); $user = $event->wire()->user; // If the parent template is "countries", restrict the children list to only the pages that the user may edit if($page->template == 'countries') { $selector .= ", id=$user->editable_pages"; $event->arguments(0, $selector); } }); } That fixes it so that only the editable child pages are shown, but the incorrect child count and unnecessary pagination controls are still visible: So the simplest thing is just to hide those things with some custom admin CSS only for the relevant role (if you're not sure how to do that something like this should work, with a check first for the user role). /* Adjust the parent template name to suit */ .PageListTemplate_countries > .PageListNumChildren { display:none; } .PageListTemplate_countries + .PageList > .uk-pagination { display:none; } .PageListTemplate_countries + .PageList > .PageListActions { display:none; } End result:
  8. Hi I don't know if it's me. I have searched the forum and have found some related issues but no valuable answers. I just want to sort the page tree in admin in a natural order, like natsort does. I have experimented with RecursiveIteratorIterator and array_walk_recursive and a usort with strnatcmp. Nothing works as expected. Do you guys have a solution? I just want to sort my pages by page name in a natural way. There has to be a switch for that! Thanks for your help. jones
  9. With the Less Module you can place a admin.less inside your templates folder. .PageList .PageListItem { &[class*="PageListTemplate_component"], &[class*="PageListTemplate_section"] { background: #f3f3f3; border-bottom: 1px solid #e0e0e0; &.PageListItemOpen { background: #e0e0e0; border-bottom: 1px solid #c9c9c9; } > a { padding-left: 10px; &:before { content: "\f061" !important; margin-right: 10px; } } } } so all Component Template begins with „component…“ (section is only a older version)
  10. Hi! I need to restrict page tree to two branches of pages under homepage. And I don't want to show not editable pages for a user in page tree. What is the right way to do that?
  11. Thanks a lot! Do you know if someone has ever thought about to insert those kind of features into the core? *edit* If sombody may need the same behaviour of Pagelist cloning (with unpublished status), I made a little hack to the @bernhard code: ... if($action === 'clone') { // get original page status $status = $page->status(); // set unpublished $page->setStatus(2049); $page->save(); // clone $copy = $this->wire->pages->clone($page); // get original name and store in an array $nameArr = explode('-',$page->name); // save cloned name (microtime style + 1) $copy->setAndSave('name', $nameArr[0] . '-' . ($nameArr[1] + 1)); // add ' (copy ... + incremented timestamp)' to title $copy->setAndSave('title', $page->title . ' (copy ' . ($nameArr[1] + 1) . ')'); // set unpublished status $copy->setStatus(2049); $copy->save(); // restore original status to original page $page->setStatus($status); $page->save(); $this->wire->session->redirect($copy->editUrl); } ... N.B. I used this trick (unpublishing the original page) due a personal hook that checks pages with same title (and warn if found one or more dupicates). Without the unpublished status for the original page, it seems that at first saving the title is the same also for cloned item... The same results is obtained with the @Robin S hook, but flagging "Keep page unpublished" in the cloning mask.
  12. Hi to all, I would need to create a pagelist with the children of one parent page, but exclude some of the children. I found ProcessPageList find but have no clue how it works (it either lists all the children of home or only shows the page itself). Could anyone help me with an example? Thanks in advance, Bernhard
  13. The PageList panel uses ProcessWire's internal ProcessPageList component. As far as I know, it works by displaying the actual children of a parent page and doesn't support rendering arbitrary pages that aren't siblings.
  14. First, thanks for the lovely module! Is there any possibility to select the pages for the PageList with a selector instead of their parent? I would need for example to show only newsletters that have not been sent now ("checkbox_sent=0").
  15. Attention: please don't install this module at the time being! It is not compatible with current PW versions, and it will be some time until I can work in all the changes. Due to a discussion here in the forums, I was inspired to finally have a take on datetime fields and see if I couldn't get them to be searched a little more conveniently. Here's a small module - still in alpha state, but I'd be happy to get some feedback - that allows searching for individual components of a date like year, month, day, hour or even day_of_week or day_of_year, and also returning them. Github repo: DatetimeAdvanced Current version: 0.0.5 Tested in: ProcessWire 2.8 + 3.0 Possible subfields: day month year hour minute second day_of_week day_of_year week_of_year Examples: // Database search: $pagelist = $pages->find("mydatefield.year=2016"); // Filtering PageArray in memory: $maypages = $pagelist->filter("mydatefield.month=5"); // Back to our starting point: $start = date('z'); $end = $start + 7; $sevendays = $pages->find("mydatefield.day_of_year>=$start, mydatefield.day_of_year<$end"); // Nice side effect: subfields are now directly accessible $blogentry = $pages->get('blog-entry-1'); echo $blogentry->title . "(" . $blogentry->publishdate->year . ")"; // New in 0.0.4: shorthand methods echo $blogentry->publishdate->strftime("%Y-%m-%d %H:%M:%S") . PHP_EOL; echo $blogentry->publishdate->date("Y-m-d H:i:s") . PHP_EOL; ToDos for the future: See if there's a possibility to specify ranges more conveniently Check if this can perhaps wiggle its way into the PW core Changes: example for direct subfield access and shorthand methods to strftime() and date() added.
  16. Hey, is there a way to render the PageList manually in the backend? Something like: $modules->get('PageList')->render(); / Nico
  17. Isn't AdminOnSteroids pagelist tweaks suit your needs? https://github.com/rolandtoth/AdminOnSteroids/wiki/PageListTweaks Show pagelist actions on full row hover: makes pagelist actions visible on hovering anywhere in the pagelist, not only on the page title
  18. What if we make the animation able to configure so you could set a time or turn it off with 0. I'm sick of the animation taking long time when it needs to open a branch on 3-4 level. something like in the module settings of ProcessPageList or through $config? $config->pageListAnimationDuration = 100; $config->js(array('pagelist' => array('pagelistAnimationDuration'=> 0)));
  19. I guess they are able to trash pages but just don't see the trash button on the page list? Modules > Core > ProcessPageList > Check the checkbox to allow non-superusers to use the trash button from the pagelist
  20. Thanks, glad you guys like it. I've lately worked on some projects here with a lot of pages deep in the site (and paginated no less), and the PageList bookmarks weren't cutting it. I found myself keeping two browser tabs open all the time so that I could keep my spot in the PageList. So I've been motivated to make this work better, but always got held up trying to figure out exactly how. Basically the goal has been to make the PageList behave as if it was an offcanvas panel that was always ready for you where you last left it. Back in PW 2.5 dev I was experimenting caches of the PageList, but the problem was that any changes in PageEdit could then make that cache stale, really limiting the utility of it. Last week I started messing with <link rel='prerender' href='...'> tags to the opened page list in order to keep a ready-to-use pre-rendered PageList that I could get to whenever clicking the "Pages" tab... it was quite cool, and instant, but also a real waste of background resources to be pre-rendering a PageList (and all the ajax requests) in the background while in the page editor. But just going through that process led to the current result, which uses JS cookies to remember the spot, and lets PageList perform a pre-render of what was previously split into multiple ajax requests. It's not as fast as using the link prerender tags but a lot more reliable and less wasteful of resources, so seemed like a good compromise. I had not seen that, wish I could say I had. But sounds like we're all on the same wavelength here! Great! Yeah it should run at the same speed regardless of quantity of children. I think one of the next improvements we'll want to look at is the ability to filter by text in the PageList. For instance, if you typed "something" in a text input, it would open all the branches directly to pages having the word "something" in their label. I think this has been brought up by others in the past too. The current search box in the masthead kind of does this already, but without any context of where those matches are, which is something the PageList could do. This could be handy in so many instances.
  21. Since yesterday, i suddenly get a 404 in the admin backend, trying to access ( /page/list/?id=1&render=RSS&start=0&open=undefined ). Everything else on the page works fine (as far as it possible to navigate) I enabled the debug-mode, but there are no clues given. RewriteBase is set correctly, all other pages (frontent as well as backend /setup/templates, etc) are shown - but not the page-list.. I have no clue whats wrong...?
  22. Adam had an idea and preference for making PageEdit return to PageList after saving, and he posted a snippet to make it happen in the FAQ section (thanks Adam!). I followed up with an alternate way using a module (something that won't get wiped out during upgrades). Posting again here since this is the Modules forum so the original topic can stay in the FAQ forum. Also thought this was a good example of how to make a simple module to customize ProcessWire for your preferences. Once installed, every time you save a page, it'll return to the PageList drilled down to the page you were editing. Some people prefer this behavior (though I'm not one of them). To install, paste the following (or download the attached module) into /site/modules/RedirectPageEdit.module. /site/modules/RedirectPageEdit.module <?php class RedirectPageEdit extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Redirect PageEdit', 'version' => 100, 'summary' => 'Redirects PageEdit to return to PageList after save rather than edit again.', 'singular' => true, 'autoload' => true, ); } public function init() { $this->session->addHookBefore('redirect', $this, 'myRedirect'); } public function myRedirect(HookEvent $event) { if($this->process == 'ProcessPageEdit' && preg_match('{^\./\?id=(\d+)$}', $event->arguments[0], $m)) { $event->arguments = array($this->config->urls->admin . "page/?open=$m[1]"); } } } RedirectPageEdit.module
  23. Hello everyone , I'm trying to deploy processwire on heroku but I'm getting this " Unknown error, please try again later " as well when I want to login directly to the pagelist. If I login on another admin page (modules, etc...) I don't get this error. And if I navigate then to the pagelist from there it works as well. It seems that this error only appears when I go directly to this "pagelist" or I reload the page. I tried to investigate a bit and I found that this issue is caused by an incorrect response to this request: "/processwire/page/list/?id=1&render=JSON&start=0&lang=0&open=0-0&mode=actions" I get this HTML: <form id="ProcessLoginForm" class="InputfieldFormFocusFirst InputfieldFormNoWidths InputfieldFormVertical uk-form-vertical InputfieldForm" method="post" action="./?id=1" data-colspacing="0"><ul class='Inputfields uk-grid-collapse uk-grid-match' uk-grid uk-height-match='target: > .Inputfield:not(.InputfieldStateCollapsed) > .InputfieldContent'><li class='Inputfield InputfieldText Inputfield_login_name collapsed9 uk-width-1-1@m' id='wrap_login_name'><label class='InputfieldHeader uk-form-label' for='login_name'>Username</label><div class='InputfieldContent uk-form-controls'><input id="login_name" class="ProcessLoginName uk-input InputfieldMaxWidth" name="login_name" type="text" maxlength="2048" /></div></li><li class='Inputfield InputfieldText Inputfield_login_pass collapsed9 uk-width-1-1@m' id='wrap_login_pass'><label class='InputfieldHeader uk-form-label' for='login_pass'>Password</label><div class='InputfieldContent uk-form-controls'><input id="login_pass" class="ProcessLoginPass uk-input InputfieldMaxWidth" name="login_pass" type="password" maxlength="2048" /></div></li><li class='Inputfield InputfieldSubmit Inputfield_login_submit uk-width-auto uk-margin-top' id='wrap_Inputfield_login_submit'><div class='InputfieldContent uk-form-controls'><button id="Inputfield_login_submit" class="ui-button ui-widget ui-state-default ui-corner-all" name="login_submit" value="Login" type="submit"><span class='ui-button-text'>Login</span></button></div></li><li class='Inputfield InputfieldHidden Inputfield_login_hidpi uk-width-1-1@m' id='wrap_login_hidpi'><label class='InputfieldHeader uk-form-label' for='login_hidpi'>login_hidpi<i title='Toggle open/close' class='toggle-icon fa fa-fw fa-angle-down' data-to='fa-angle-down fa-angle-right'></i></label><div class='InputfieldContent uk-form-controls'><input id="login_hidpi" name="login_hidpi" value="0" type="hidden" /></div></li><li class='Inputfield InputfieldHidden Inputfield_login_touch uk-width-1-1@m' id='wrap_login_touch'><label class='InputfieldHeader uk-form-label' for='login_touch'>login_touch<i title='Toggle open/close' class='toggle-icon fa fa-fw fa-angle-down' data-to='fa-angle-down fa-angle-right'></i></label><div class='InputfieldContent uk-form-controls'><input id="login_touch" name="login_touch" value="0" type="hidden" /></div></li><li class='Inputfield InputfieldHidden Inputfield_login_width uk-width-1-1@m' id='wrap_login_width'><label class='InputfieldHeader uk-form-label' for='login_width'>login_width<i title='Toggle open/close' class='toggle-icon fa fa-fw fa-angle-down' data-to='fa-angle-down fa-angle-right'></i></label><div class='InputfieldContent uk-form-controls'><input id="login_width" name="login_width" value="0" type="hidden" /></div></li></ul><input type='hidden' name='TOKEN1386143469X1544888824' value='U/pmG2Z5NxG4lJvHui1x13TpsYhdGZ0L' class='_post_token' /></form><p><div><a href='/'><i class='fa fa-home'></i> Home</a></div></p> instead of the correct JSON file. And this is causing the "PageList" script to fail at some point because it can't parse the response. I tried several ways to fix that problem from the answers above but none worked. Any ideas of what can I do to solve this problem? Thank you!!
  24. Did a little tinkering since I'm going to need another API endpoint for a new project soon and came up with this PoC: https://github.com/BitPoet/WireApi-PoC It's very crude and all as its just meant as a playground for ideas for now (wouldn't dare to clutter up the Wire namespace), and it does still use pages behind the scene (though not the implicit 404 redirect). Perhaps hiding the endpoints from the tree for everybody but superusers might be an option, but I haven't fully thought that out. Here are a few very simple examples of an API template (in fact, very close to what I thought up above): <?php namespace ProcessWire; $api->routeGET('/api/hello/{name}/', null, 'helloWorldApi', true); $api->routeGET('/api/pagelist/', 'apitemplates/pagelist') ->roles('superuser') ->setDebug(true) ; $api->route(['GET'], '/api/custom/{value}/', function($url, $values) { wire('api')->jsonResponse([ 'success' => true, 'youare' => wire('user')->name, 'data' => $values ]); })->check(function($url, $route, $check, $values) { return ctype_digit($values['value']); }); $api->handleRequest(['debug' => true]); // ________________Only function declarations below_____________________ function helloWorldApi($url, $values) { wire('api')->jsonResponse(['Hello', $values['name']]); } Oh, and it ships with a near-one-click endpoint installer ? Let me know what you think, and if you have any ideas about improvements or doing things differently, bring it on.
  25. Edit: THIS HACK HAS BEEN SURPASSED BY THIS PLUGIN: http://processwire.com/talk/index.php/topic,255.0.html PLEASE USE IT INSTEAD OF THIS QUICK TIP/HACK Are you one of those assholes, who just love to fiddle with everything so it suits your needs? No worries. Me too. And I really hate the fact, that processwire stays on the 'Edit page' after saving page, so here is a quick tip: [non-tested with the fantastic Antti's AdminBar]: Locate the file /wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module and change line 143 from: <?php if(!$this->redirectUrl) $this->redirectUrl = "./?id={$this->page->id}"; to <?php if(!$this->redirectUrl) $this->redirectUrl = "/processwire/page/?open={$this->page->id}"; And voilà! ProcessWire now opens PageList with awesome list animation after saving. Note: Do not look for '<?php' near that line. That was added here just kick in code coloring. Important is just that if(!$this... part
×
×
  • Create New...