Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/17/2018 in all areas

  1. https://ckeditor.com/blog/CKEditor-5-v1.0.0-beta-released/ Looks very clean. Hopefully we get to test it on PW soon.
    4 points
  2. @Ivan Gretsky i do have an inputfield version for ajax that is in development, i think it works pretty well; i can post back here once i am able to test it again - i will attach it to the post so you can try it out.
    3 points
  3. I went and had a shower, great place to think. I found a solution that doesn't require hooks. It's a simple CSS thing. For anyone in future thinking of using flex-box for the edit profile form, which does look and work better than floats, you can try this: The Inputfields class is common for all of the forms in the module and is where flex needs to be applied but the forms themselves have individual IDs which allows you to target the .Inputfields class as follows: .Inputfields { display: flex; } #LoginRegisterProfileForm > .Inputfields { flex-direction: row; justify-content: space-between; align-items: stretch; flex-wrap: wrap; } #LoginRegisterLoginForm > .Inputfields, #InputfieldForm1 > .Inputfields { flex-direction: column; justify-content: center; align-items: stretch; flex-wrap: nowrap; } #wrap_login_name, #wrap_login_pass, #wrap_username { display: block; max-width: 50%; margin: 0 auto 10px auto; } If that's helpful to anyone.
    3 points
  4. It's this part that probably has the most impact on performance. If that is just to find four random items it could be done a lot more efficiently as: $related = $pages->find("id!=$page, tags=$page->tags, (template=where-to-go-detail|meet-the-locals-detail), (template=events-detail, location_venue!=$page, events_detail_dates_final_date>=today), sort=random, limit=4"); When you are wanting a specific number of results, wherever possible you should do that via a limit in the database query i.e. in the $pages->find() selector.
    3 points
  5. You can find the answer in this thread:
    2 points
  6. Just chiming in to point out that this sounds like something that might be better solved by the Field Change Notifier module. I'm not sure what the state of said module is, and it doesn't currently seem to support selecting notified user based on the page being edited either, but perhaps it would be easier to adapt to this need?
    2 points
  7. What's the TTFB of a procached version of a page X (a complex one)? I think template cache will not get you any advantage over ProCache, but MarkupCache will as you can cache parts of the page before ProCache kicks in! Use markup cache for blocks of code that do complex queries or when querying multiple pages. Basic example: A website has hundreds of podcast episodes. You can cache a count of these episodes so you don't need to query it when the page cache is cleared in ProCache. $template = $templates->get("podcasts"); //episodes $all_episodes_count = $cache->get("all_episodes_count", $template, function($page) { return $page->NumChildren(true); }); $view->total_episodes = $all_episodes_count; The "all_episodes_count" cache file will only be cleared when a new page is created with the template "podcasts".
    2 points
  8. This module adds CSV import and export functionality to Profields Table fields on both the admin and front-end. http://modules.processwire.com/modules/table-csv-import-export/ https://github.com/adrianbj/TableCsvImportExport Access to the admin import/export for non-superusers is controlled by two automatically created permissions: table-csv-import and table-csv-export Another permission (table-csv-import-overwrite) allows you to control access to the overwrite option when importing. The overwrite option is also controlled at the field level. Go to the table field's Input tab and check the new "Allow overwrite option" if you want this enabled at all for the specific field. Please consider limiting import overwrite option to trusted roles as you could do a lot of damage very quickly with the overwrite option Front-end export of a table field to CSV can be achieved with the exportCsv() method: // export as CSV if csv_export=1 is in url if($input->get->csv_export==1){ $modules->get('ProcessTableCsvExport'); // load module // delimiter, enclosure, file extension, multiple fields separator, names in first row $page->fields->tablefield->exportCsv('tab', '"', 'tsv', '|', true); } // display content of template with link to same page with appended csv_export=1 else{ include("./head.inc"); echo $page->tablefield->render(); //render table - not necessary for export - just displaying the table echo "<a href='./?csv_export=1'>Export Table as CSV</a>"; //link to initiate export include("./foot.inc"); } Front-end import can be achieved with the importCsv() method: $modules->get('TableCsvImportExport'); // load module // data, delimiter, enclosure, convert decimals, ignore first row, multiple fields separator, append or overwrite $page->fields->tablefield->importCsv($csvData, ';', '"', true, false, '|', 'append'); Please let me know if you have any problems, or suggestions for improvements. Enjoy!
    1 point
  9. This module allows you to automatically send an email to a newly created user with their username and password. It also has the option to automatically generate a password for the user upon creation. http://modules.processwire.com/modules/email-new-user/ https://github.com/adrianbj/EmailNewUser The following things are configurable: Whether Send Email option should be automatically checked when creating new user - also affects new users created via API From email address (if left blank it will use the admin email set in the config/php file Email subject Email body - includes the ability to use any fields from the user template using {field_name} codes so these can be put into the body wherever you want. It's your choice if you want to include the password in the email or not. Whether to automatically generate a password. This can be toggled on/off, but even if it is on, you can override it by simply entering a password manually when creating the new user. Ability to control the length and character sets used to make up the automatically generated password. Option to send a test email to yourself to make sure it is configured the way you expect. Because it is generally not a good idea to email passwords, it is highly recommended to use the new Password Force Change module in conjunction with this module. That way the user has to change their password the first time they login which will somewhat reduce the vulnerability of emailing the password. It can also be used for API generated users: $modules->get("EmailNewUser"); // call the module since it is not autoload on the front end $newuser = new User(); $newuser->name = 'newuser'; $newuser->email = 'newuser@gmail.com'; $newuser->sendEmail = true; // only needed if Automatic Email Send is unchecked $newuser->save(); Please let me know if you have any ideas for improvements. PS Thanks to everyone in this post: https://processwire.com/talk/topic/2981-new-user-welcome-message/ for their thoughts and ideas on how to do this.
    1 point
  10. I've been searching for a CSS-only solution for a while to reveal a scroll-to-top link only after scrolling down the page, but no luck. Today I figured out that it's possible with position: sticky. The beauty of this is that you don't need to check the scroll position in a scroll event (+ in document ready, window resize), which makes it really lightweight. Update: added "html { scroll-behavior: smooth; }" and now there's animated scroll (Firefox 58+, Chrome 63+). It seems that Js is not required anymore to this feature. CodePen demo
    1 point
  11. Excellent. All works fine now. Thanks @Robin S. B.t.w., if anyone is reading this thread, ignore the remarks in my first post about different browsers. I was just getting in a muddle with how I was logged in with each :-( Also worth noting is that CKEditor Link Files works in a really neat way and is great for adapting if you want to insert PW content into CKEditor text. I've actually built a couple of modules based on it, and have one or two more in mind!
    1 point
  12. Sounds cool, I'm also interested. I do use a licensed Visual Page Selector but in my use case the UX of VPS is just too complex for the simple task I use it for, so your module might allow for better user experience.
    1 point
  13. Cool! I was guessing you will try to create something like this as soon as I tried the power of InputfieldSelectize .
    1 point
  14. Hello, @Macrura! Thanks for your wonderful modules. Used them on 2 projects with full success and satisfaction)) Now I have a need to implement something like this, but do not have the budget to buy it. I was wondering if your InputfieldSelectize module could do something alike. I can see that the limitation has to be the number of pages that the module can load without getting php and the server to through an error. Do you have any experience with managing relatively large amount of pages with this module? Like 100 to 1000? Did you do any kind of search and/or ajax loading?
    1 point
  15. Just because initially I had to set this with JS which uses zIndex, rather than z-index. I have just changed it locally and it will appear in the next commit.
    1 point
  16. You can always set the panel z-index value in the Tracy settings to something higher than 100060, but I would like to know still if those header elements need to be that high in the Reno sticky header.
    1 point
  17. Is there any reason the nav items in Reno have such a high z-index: @media only screen and (min-width: 960px) html.AdminThemeReno.headSticky:not(.modal) #masthead { width: 100%; z-index: 100060; } If I put that (and some others) below 100 the Tracy panels seem fine - am I missing something?
    1 point
  18. Hey @szabesz - I can reproduce, but it's fine with the default and Uikit themes with sticky headers so I think it's something that @tpr might need to fix. I know he made some recent changes on this front so maybe those changes need to be applied to the reno sticky header as well?
    1 point
  19. It's great that you are actively working to improve things on your website. I would also advise you to take a look at the following linked article for other things to look out for: https://blog.ezoic.com/ttfb-shouldnt-matter-test-this-instead-for-pagespeed/ Best Regards, Charles
    1 point
  20. thx @lokomotivan actually i was able to append a div with javascript and to use it as a overlay. ps: i also found this
    1 point
  21. Hey @Robin S - I think Request 2 would be pretty quick to implement, so might take a look at that when I am procrastinating from work.
    1 point
  22. Thanks @adrian, no worries. The needs of my current project are fairly specific/unique so I'm not sure yet whether I'll modify the Email New User module or make a new custom module. I'm sure your module will be a big help in either case, and if I do make some additions to Email New User that could be useful to others I'll certainly share them here.
    1 point
  23. Hi @Robin S All the "Automatic Email Send" option does is check the "Send welcome message" option when creating a new user. It doesn't have any impact on existing users, but there is an option to "Resend Welcome Message" to an existing user. This will re-generate a new password if that option is selected. As for your requests, unfortunately I just don't have time at the moment as those look relatively substantial, but they sound useful. I think "2" especially sounds like a good idea. I am not sure about "1" - it sounds like it might be beyond the scope of "Email New User", but I am happy to be convinced that it's a worthwhile addition. There's realistically no chance of me getting to this until late May, but of course PRs are always greatly appreciated Sorry I can't help out in a reasonable timeframe on this one!
    1 point
  24. Hi @adrian, My first time using this lovely module. A question and a couple of requests... When editing/saving a user in admin, under what circumstances is an email sent if the "Automatic Email Send" option is checked? For existing users (who may have already been sent their welcome message) will an email be sent if nothing is changed but the user just saved? Silly me, I was trying to work it out from the code rather than just trying it out. I see now that the interface changes to "Re-send welcome message" after the first user save. Request 1: It would be cool if there was an option in the module config to select key fields in the user template, where if any of those fields have changed the user is automatically sent an email. The obvious fields to trigger this would be "name" and "pass", but it would be nice to include custom fields too because in my case users log in with their email address. If other fields are changed no email would be sent. As I type this another thought occurs to me - maybe there could be different email templates for "new user" (password old value is blank) versus "modified user" (key field has changed)? Request 2: How about a module config option for not showing the "Send welcome message" checkbox and the "Email message" CKEditor field in Edit User? In my scenario there are several different roles with different user-admin privileges. I'd rather take the decisions out of their hands whether or not to send an email and what the message will be.
    1 point
  25. Ive done something simular recently, well not sure if this is what u looking for: Simple markup (number in a class represents opacity level) <div class="tm-overlay-dark-60"> <img src="" /> </div> If u want to use it with background image, just need to define height <div class="tm-overlay-dark-60" style="height:500px;background:url(./myimage.jpg) center center no-repeat;backgroudn-size:cover;"> </div> I usually use uikit framework and less @tm-overlay-dark-bg: #000; @tm-overlay-light-bg: #fff; /** * TM Overlay BG */ [class*='tm-overlay-'] { position:relative; } [class*='tm-overlay-']:before { content: ""; display:block; position: absolute; top:0; bottom:0; left:0; right:0; background: fade(@tm-overlay-dark-bg, 60%); z-index:0; } /** * Dark */ [class*='tm-overlay-10']:before, [class*='tm-overlay-dark-10']:before { background: fade(@tm-overlay-dark-bg, 10%); } [class*='tm-overlay-20']:before, [class*='tm-overlay-dark-20']:before { background: fade(@tm-overlay-dark-bg, 20%); } [class*='tm-overlay-30']:before, [class*='tm-overlay-dark-30']:before { background: fade(@tm-overlay-dark-bg, 30%); } [class*='tm-overlay-40']:before, [class*='tm-overlay-dark-40']:before { background: fade(@tm-overlay-dark-bg, 40%); } [class*='tm-overlay-50']:before, [class*='tm-overlay-dark-50']:before { background: fade(@tm-overlay-dark-bg, 50%); } [class*='tm-overlay-60']:before, [class*='tm-overlay-dark-60']:before { background: fade(@tm-overlay-dark-bg, 60%); } [class*='tm-overlay-70']:before, [class*='tm-overlay-dark-70']:before { background: fade(@tm-overlay-dark-bg, 70%); } [class*='tm-overlay-80']:before, [class*='tm-overlay-dark-80']:before { background: fade(@tm-overlay-dark-bg, 80%); } [class*='tm-overlay-90']:before, [class*='tm-overlay-dark-90']:before { background: fade(@tm-overlay-dark-bg, 90%); } /** * Light */ [class*='tm-overlay-light-10']:before { background: fade(@tm-overlay-light-bg, 10%); } [class*='tm-overlay-light-20']:before { background: fade(@tm-overlay-light-bg, 20%); } [class*='tm-overlay-light-30']:before { background: fade(@tm-overlay-light-bg, 30%); } [class*='tm-overlay-light-40']:before { background: fade(@tm-overlay-light-bg, 40%); } [class*='tm-overlay-light-50']:before { background: fade(@tm-overlay-light-bg, 50%); } [class*='tm-overlay-light-60']:before { background: fade(@tm-overlay-light-bg, 60%); } [class*='tm-overlay-light-70']:before { background: fade(@tm-overlay-light-bg, 70%); } [class*='tm-overlay-light-80']:before { background: fade(@tm-overlay-light-bg, 80%); } [class*='tm-overlay-light-90']:before { background: fade(@tm-overlay-light-bg, 90%); } Maybe u need to change :before z-index if you dont use image as background image
    1 point
  26. Thanks for reporting this issue. It should be fixed in v0.1.5 of CKEditor Link Files. If you check the changes in this commit you can apply something similar in your module. @tpr, this issue will affect the version included in AdminOnSteroids too. I thought a hook before module edit would trigger before the access control kicks in but it seems not. Sort of obvious in hindsight. I really didn't want to have to add a page just for the AJAX response so went looking for some other process to hook into. I settled on ProcessLogin::executeLogout as this is one process module/method that should be accessible for any user. You might want to update AOS with a similar fix.
    1 point
  27. @Mike Rockett Thanks for your fast reply. It looks as if we’re getting closer: my images are of fieldtype CroppableImage3, resulting from the popular module with the same name. Do you think I could just change the field type where the check happens? Or extend the range of possible field types? I’m no big fan of module hacks, but in this case I could live with it. Would you mind to reveal the exact check location? Update: I’ve got the job done now – much easier than expected. Just in case somebody faces the same problem: in /site/modules/MarkupSitemap/MarkupSitemapConfig.php in line 90 I changed if ($imageFields = $this->fields->find('type=FieldtypeImage') and $imageFields->count) { to if ($imageFields = $this->fields->find('type=FieldtypeImage|FieldtypeCroppableImage3') and $imageFields->count) { to extend the range of considered field types. The option select appeared and everything works perfectly now. Another thanks for your help.
    1 point
  28. Hi @Sipho Sorry I missed your post. I don't know/use markup regions myself, so it's hard for me to help. Does your code work if you disable the TemplateEngineFactory module? If it works, then somehow markup regions are not respected when your ProcessWire templates are getting rendered by this module. I try to look into this at the end of this week. Cheers
    1 point
  29. @rash, the module checks to see if any image fields are available to your installation. To be more precise, the check is specific to FieldtypeImage, which might be where the problem is coming in... I'm not sure if there are other Image modules that extend FieldtypeImage out there (and if so, if you're using one). On my side though, a fresh install of PW with the latest MarkupSitemap and an image field added in results in the config showing the applicable selector:
    1 point
  30. Been looking at the issue, as i have this being used on 3 sites; none of the sites are displaying events anymore, clients not too happy ()... The module itself though is doing it's job, so nothing wrong with the module; rather, the feeds are returning an empty array; we can only assume that this is something to do with Facebook new security, however even looking through the app settings and documentation, can't see how to debug this through facebook.. UPDATE: I saw this announcement here https://www.codeofaninja.com/2011/07/display-facebook-events-to-your-website.html Guess we're waiting for FB at this point...
    1 point
  31. Hi @adrian_gp, Welcome to the forums. Let's say you have a category 'Technology' whose URL is /categories/technology/. In the template file of the template CategoriePage, you can do this: // @note: we set a limit here. You can use pagination if you have many posts $posts = $pages->find("template=BlogPost, limit=10, categories=$page"); $out = ''; // category title $out .= "<h2>{$page->title}</h2>"; // found posts in this category if($posts->count) { foreach($posts as $post) { $out .= "<h3><a href='{$post->url}'>{$post->title}</a></h3>" . "<p>{$post->summary}</p>";// assuming you have a summary field } // no posts in this category yet else $out .= "<p>No posts found in this category</p>"; echo $out; Quickly typed in the browser, check for errors, just an example. Btw, there are blog profiles and a Blog module you can look at for more examples.
    1 point
  32. I ? markup regions. I found Processwire arround a year ago when they where introduced and used MUR exclusively since. I use it like a template engine with layouts like this: //1. Append file app/index.php > Append file, init, loads Component() & Snippet() Methods app/theme/componen.php /snippet.php // 2. ProcessWire Template, extends layout Template.php > extends markup regions, can define layout or false // Template uses Components and Snipptes: src/components/component/component.php /component-varian.php /component.js > compiled by gulp /component.scss > compiled by gulp src/snippets/snippet/snippet.php src/snippets/snippet/snippet-varian.php /snippet.js > compiled by gulp /snippet.scss > compiled by gulp // 3.1 Layout app/layouts.php > Prependfile Handles include of layout: // 3.2 Load markup region layout src/layouts/default.php > Markup Regions /Template.php > Markup Regions Example Template, can assign a $page->layout variable or set it to false. I use custom Component and Snippet methods to render Parts that I use multiple times: <div id='pw-author' pw-remove></div> <div id='pw-header' pw-replace> <?= Component('header', 'profile') ?> // loads src/components/header/profile.php </div> <!-- Adding class to main --> <div id='pw-main' class="uk-padding-remove-bottom" pw-append></div> <div id='pw-body' pw-append> <?= Component('profile', 'page'); ?> // loads src/components/profile/profile-page.php <?= Snippet('buttons', 'logout'); ?> // loads src/snippets/buttons/profile-logout.php </div> <div id="pw-more" pw-remove></div> <div id="pw-aside" pw-remove></div> Prependfile: app/layout.php > this file loads a layout, if there is a layout file with the same name as the Template or a set $pages->layout variable: $layout = isset($page->layout) ? Wire('config')->paths->templates."src/layouts/$page->layout.php" : Wire('config')->paths->templates."src/layouts/{$page->template->name}.php"; $default = Wire('config')->paths->templates.'src/layouts/default.php'; switch (true) { // layout like Page-Template exists case is_file($layout): include $layout; break; // default template case is_file($default): include $default; break; default: return "<div class='uk-alert uk-alert-danger'>could not find layout. Searched for $layout / $default.</div>"; break; } Component Function: app/template/component.php – components should never be nested, can contain snippets (css & js namespaced) namespace ProcessWire; function Component($component, $variation = '', $vars = []) { if (is_array($variation)) { $vars = $variation; $filename = $component; } else { $filename = $variation ? $component.'-'.$variation : $component; } $file = Wire('config')->paths->templates."src/components/$component/$filename.php"; if (is_file($file)) { $vars['skin'] = isset($vars['skin']) ? $vars['skin'] : ''; $vars['class'] = isset($vars['class']) ? $vars['class'] : ''; $out = wireRenderFile($file, $vars); return $out; } wire('log')->error('Could not find '.$file); return null; } Snippet function: app/theme/snippet.php – can be used inside components (css & js namespaced) namespace ProcessWire; function Snippet($name, $file = null, $vars = []) { if (is_array($file)) { $vars = $file; $file = $name; } else { $file = $file ? $name.'-'.$file : $name; } $file = Wire('config')->paths->templates."src/snippets/$name/$file.php"; if (is_file($file)) { return wireRenderFile($file, $vars); } return "<div class='uk-alert uk-alert-danger'>could not find $file.</div>"; }
    1 point
  33. I've adjusted the CSS so now the scrolltop link doesn't extend the page height if the page has small amount of content. That is, if there is not enough content to scroll the scrrolltop link doesn't show up and the page doesn't get any vertical scrollbar. In older browsers the scrolltop link shows up fixed even in this case but that's a minor thing imo. I've updated the example to have content toggle button so it's easy to see.
    1 point
  34. I don't know if this is the exact method used by the developer, but there is a tutorial for using the variations module with padloper here: https://variations.kongondo.com/demo/ It's a great looking site, and an awesome demonstration of some premium modules I'm looking to use in a new project. I'm glad you mentioned ProFields as that looks like a big time saver I was aware of but hadn't really looked into before. Best of luck to your colleague, I also have a colleague recently diagnosed and it's a horrible disease.
    1 point
  35. Ok, I ended up looking into it and from what I can tell the only way is to use the "regular arrays" option, rather than the associative approach. This seems to work: foreach($input->get->amenities as $amenity) { $selector[] = ['amenities.title', $amenity]; } It gets converted to: and the final selector ends up having this, which is what I need. amenities.title=Kitchen, amenities.title=Laundry Maybe this is the only way, but if anyone else has another solution, let me know. Otherwise, hope this helps someone else down the road,
    1 point
  36. I have a suggestion for an "explanation" for such a client in form of an offer you could send him: Form with honeypot spam-protection: X € Form with recaptcha spam-protection: X + Y € And with the Y € we could fund the implementation of recaptcha into RockForms "Y" has to be totally overpriced, of course
    1 point
  37. You could start debugging around this line: https://github.com/adrianbj/TableCsvImportExport/blob/a4e6ad668fd92f668546ba62cf726d29871b6d05/TableCsvImportExport.module#L424 Make sure that $rows contains the data. Then continue through the rest of importCsv() to see if you can figure out where it's failing. If you don't have any luck, is this site live somewhere I can take a look? Do you have debug mode on and Tracy installed?
    1 point
  38. The Database class inherits from mysqli. You want to use WireDatabasePDO instead.
    1 point
  39. Hi all, I have just committed a major new version (2.0.0) on the dev branch (https://github.com/adrianbj/TableCsvImportExport/tree/dev). This version has breaking changes to the frontend export/import API methods!! Changes include: changed API methods - please see ReadMe for details: https://github.com/adrianbj/TableCsvImportExport/blob/dev/README.md module config settings to: set defaults for import and export parameters (delimiter, enclosure, etc) can users override the default parameters can users can select columns/order in exported CSV can users use an InputfieldSelector interface to filter table rows (this is an enhanced version of the built-in Table "Find" interface available when you have pagination enabled) I would like to make this the stable (master) version as soon as possible because the old API methods were not well constructed so I would really appreciate testing of this new version if you have any time. Thanks! PS - has anyone out there actually been using the API methods?
    1 point
  40. Hello @all, I use a pagetable field for events as children. For better visibility for active and cancelled events I use Jquery to manipulate the output of the pagetable field. Active events are green and cancelled events are red (see screenshot) This is the Jquery code snippet: jQuery(document).ready(function() { $("#wrap_Inputfield_singleeventtable table tbody tr[data-filter*='aktiv'] td:nth-child(2) ul li").wrapInner('<span class="uk-badge active"></span>'); $("#wrap_Inputfield_singleeventtable table tbody tr[data-filter*='abgesagt'] td:nth-child(2) ul li").wrapInner('<span class="uk-badge cancelled"></span>'); }); This works well until I open a childpage via a link in the modal. After closing the modal the pagetable will be updated via Ajax. This is the point where the ready function has no longer impact on the manipulation. I am not very familiar with coding Jquery. Has anyone an idea which event could be triggered after Ajax update to manipulate the markup once more or if there is a better solution than Jquery ready function in this case. Best regards
    1 point
  41. Yep, this was the mistake!!!!!! Now it works as expected. Thousand thanks!!!!
    1 point
  42. This happens when the user PHP runs as isn't the owner of the cache files. The file compiler tries to update the cache files with the modification time of their originals, and while writing to that file can succeed through group permissions, updating the modification time fails unless issued by the owner. Clearing the cache removes the cache files and recreates them with the PHP user as the owner, so the problem is gone.
    1 point
  43. Latest version supports: Column selection and ordering for CSV export. Exported rows also respect the Find filters that have been applied. Should be very handy for clients to be able to extract relevant info from large table datasets.
    1 point
  44. A few more tweaks - you can now specify the separator when importing and exporting tables with the new multi-value fields. Also a couple of bug fixes and a speed improvement when importing.
    1 point
  45. Hi everyone, I have just added support for single and multiple page-reference fields and multiple options - requires PW 2.6.4 and Table 7-beta that Ryan released last week. Export converts page IDs to the title of the page. Import looks up the titles and populates the table with the IDs of the matching pages. Please let me know if you have any problems with this new version.
    1 point
  46. There's an example on that page you linked... Let's look, to have PW pagination module work you need to use some search $pages->find() ..children() ..siblings() with a limit selector as explained above. But this alone isn't going to cut it. You'll also need to render the pager. This, you do by using the result you get from the find() and add a renderPager() to it. So the above code is missing that. Let's add the missing part. <?php if($page->numChildren) { $result = $page->children("limit=2"); // render the pager echo $result->renderPager(); // render the children echo "<ul class='nav'>"; foreach($result as $child) { echo "<li><a href='{$child->url}'>{$child->title}</a></li>"; } echo "</ul>"; // render pager again? ok echo $result->renderPager(); } Wasn't that easy?
    1 point
  47. Did you try using "limit=2" in your selector? The following should work. <?php if($page->numChildren) { echo "<ul class='nav'>"; foreach($page->children("limit=2")as $child) { echo "<li><a href='{$child->url}'>{$child->title}</a></li>"; } echo "</ul>"; }
    1 point
×
×
  • Create New...