Jump to content

Leaderboard

Popular Content

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

  1. Is your page unpublished? InputfieldPassword is set to required on unpublished pages regardless of what you might have chosen in the field settings - see here. Probably only @ryan could tell you why this is so. You can work around the issue with a hook in /site/ready.php: // You may need to modify "pass" to whatever your password field is named $wire->addHookBefore('Field(name=pass)::getInputfield', function(HookEvent $event) { $page = $event->arguments(0); $field = $event->object; // Do some test on $page and/or $field to identify the cases where the password field should not be required // Then... $field->required = false; });
    3 points
  2. Today's update: The inline editor for the backend can now save the changes. And the visual resize tool works now on the breakpoint which corresponds to the current screen size. So you can define the layout for every size visually. http://theowp.bplaced.net/upload/prev3.html
    3 points
  3. Don't forget to also take a look at it when editing a field, template, or module - shows all the settings for those in addition to the normal sections. Can be very handy for certain dev needs.
    2 points
  4. Hey @bernhard - sorry for the delay on this - had family in town. Please try the latest version - it prevents all siblings from being loaded by the prev/next links in the Request Info panel (which was a bug I hadn't noticed). This should actually make a huge different to anyone using Tracy on a page with a lot of siblings - can't believe I didn't come across this till now - thanks for bringing it to my attention. One caveat - if you are running AOS with the "Add links to edit previous and next pages" feature enabled you might still have problems, although it shouldn't affect page load speed. I have made a note here:
    2 points
  5. I maybe be wrong but it seems, you want to render a certain info based on the data provided, ideally most Table give options to enable you have power over the rendering process. Does this satisfy your feat, and also it's like a plugin too https://www.ag-grid.com/javascript-grid-cell-rendering-components/
    2 points
  6. Today's update: More "wysiywig" for the backend Visual resizing. "Snap to grid". http://theowp.bplaced.net/upload/prev1.html Thank you.
    2 points
  7. EDIT: Demo version download here: Hello I've been looking for a way to give "editors" a little bit more freedom regarding the layout, without having to care about CSS, Fields, Templates etc. After playing with PageTable(-Extended) and Bootstrap, this is the (intermediate) result: http://theowp.bplaced.net/upload/prev.html It is just a proof of concept atm. Does anything like this already exist for PW?
    1 point
  8. FieldtypeFields Fieldtype for storing field references with various filter possibilities. See Modules directory Download at GitHub
    1 point
  9. 1 point
  10. Thanks @bernhard and @Robin S - a little more detail on PW's implementation of __debugInfo() is here: https://processwire.com/blog/posts/processwire-core-updates-2.5.27/#php-5.6-and-debuginfo and also point "8" from https://processwire.com/blog/posts/processwire-2.6-rc1-2.5.29-and-more/#processwire-and-phps-interactive-mode Robin, you are correct that the output will depend on what the developer of the class makes available. You end up with something like this which I think in general is much more helpful than the default: I think in general Ryan has done a great job with what is returned and I think for most Tracy users most of the time, this will be preferable to the full object. I think the best option might be to make it on by default, but you can either override this in the config settings globally, or you could pass: debugInfo => false in the d() or bd() call's $options parameter if you want the full object. Sound ok?
    1 point
  11. You'll know more about this than me, but my understanding is that what is available in a dump from __debugInfo() depends on what the developer of the class makes available in the method. So if that method in a class was quite limited in what it made available (either intentionally or not intentionally) then the Tracy user potentially misses out on a lot of relevant information. To give a silly example, if I do this in a class... public function __debugInfo() { return ['Nothing to see here.']; } ...then dumping an instance of it will be useless. It looks like most of the __debugInfo() work is done in the dedicated WireDebugInfo class. If you think that Ryan has covered everything that anyone could ever need here then I guess shorter/tidier is better. But if you have doubts I'd rather get all the data as per the status quo than be wondering about what might have been overlooked.
    1 point
  12. Would you mind adding some additional information to your question? What is the difference between the two? What would be the pros/cons? I use dumping a lot but I use only very basic features I guess. Most of the information in the first screencap does not seem to be very helpful to me (at least most of the time, or at least not yet). The second looks cleaner to me, but what I do not like is that "template" is a string and not a ProcessWire\Template as shown in the first pic (though that's a tiny detail and i guess dumping $page->template would show the correct classname?). [2min later] To me, the second looks cleaner and more helpful.
    1 point
  13. thx, I confirm everything is still working great
    1 point
  14. Doesn't the previous output the link already for download?? You can use an if statement to check if there is an uploaded file: <?php if($publication->repeater_download):?> <p><?=$publication->repeater_description?></p> <a href="<?=$publication->repeater_download->url?>">Download</a> <?php endif ?> It uses naming convention, the following code will render the file content in site/template/fields/Repeater_publication.php : (EDIT: Edited some code on previous post, I was mixing Repeater Matrix field rendering with normal Repeaters) <?php //Render the repeater field in the current page $page->render("Repeater_publication"); And inside site/template/fields/Repeater_publication.php : <?php foreach($value as $publication):?> <p> <?=$publication->publication_year?></p> <?php endforeach?> Maybe you can save this for later if you already got the rendering almost done with a more common approach
    1 point
  15. @bernhard - could you please check the latest version for me - I left out "include=all" for the prev/next links in the last commit. Everything still seems fast here, but would appreciate it if you could confirm it's ok at your end too please?
    1 point
  16. Thx adrian! Didn't use the request info panel so far, but I'll start using it
    1 point
  17. Thanks @adrian, that solves the issue and my pw admin is lightning fast again I've experienced slower loading with tracy several times, but I was not able to identify when it occured. Maybe this was the reason, I'll keep an eye. BTW: Where do I find the prev/next links?
    1 point
  18. I think you might have a mistake here: $publications = $subpage->publication_year(); If I understand your setup correctly that returns a year integer, so looping on that will have no relevant effect. I think the final code could look like this: <?php foreach($page->children() as $subpage): ?> <!-- $subpage are the "year" pages --> <h1>Publications on: <?php $subpage->title </h2> <!-- eg. Publications on 1997 --> <?php foreach($subpage->Repeater_publications as $publication): ?> <p><?=$publication->repeater_description?></p> <a href="<?=$publication->repeater_download->url?>">Download</a> <?php endforeach; ?> <?php endforeach; There is a way to render the repeater field as its own template (or any field for what matters) with a feature called field rendering, you would have to create a template file as: templates/fields/Repeater_publication.php that actually renders some markup when calling the render method on the repeater field reference. <?php foreach($page->children() as $subpage): ?> <!-- $subpage are the "year" pages --> <h1>Publications on: <?php $subpage->title </h2> <!-- eg. Publications on 1997 --> <?php echo $page->render("Repeater_publications"); ?> <?php endforeach; And inside site/template/fields/Repeater_publication.php : <?php foreach($value as $publication):?> <p> <?=$publication->publication_year?></p> <?php endforeach?> Check this blog post for more info on field rendering, to see which variables are available in the template file: https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/#processwire-3.0.5-introduces-field-rendering-with-template-files
    1 point
  19. Hi psy and pideluxe, thanks for your responses. I took the first solution. Processwire is cool for learning php. thanks P.S. For all php newbies: http://php.net/manual/en/language.operators.php
    1 point
  20. Glad to hear JeevanisM, even recently I was thinking of a Github open book about Processwire, but I am somehow a bit of a procrastinator sometimes, I guess I will map out something for that.
    1 point
  21. Depending on your use case, here's two other options Clone PageAutocomplete, rename the file and class, .e.g PageAutocompleteCustom, edit it to do what you need. The advantage here is portability, no need to Hook into anything, get to know the inner workings of ProcessWire (especially Pagefields, etc). Lister/Lister pro: This option depends on what you mean by 'keyword'. If it means some other ProcessWire property, you can easily filter results in Lister using various criteria
    1 point
  22. hi try : $mail = WireMail(); $mail->header('Reply-To', 'foobar@example.com'); [...] https://processwire.com/api/ref/wire-mail/
    1 point
  23. Try: <?php if ($page->id == 1 ) : ?> <div>your content</div> <?php else: ?> xxx <?php endif; ?>
    1 point
  24. Update: Seems like I'll switch to agGrid for my module. It is also MIT licensed in the basic version. It can handle multiple thousands of rows (loading 30k rows with pages->findObjects needs 6 seconds here; 10k pages = 800ms; without caching, of course) It has very nice filters built in (contains, starts with, not equal, etc) It is easy to create custom filters -> the regex filter is built by myself It has the possibility of custom cell renderers (see the percent bars; though I will have to adopt how this works for my module) It looks cleaner then datatables It has CSV export that seems to work just as good as the excel export of datatables (it is also possible to modify the cell values before export) I managed to rebuild the column statistics functionality (for all rows and only selected rows) that I have built for datatables. This is a must have feature, making it easy to show eg. the sum of all revenues in a specific month. It is pure JavaScript, so no dependencies have to be installed. It should also be possible to use this module on the frontend quite easily. Only thing that I'm missing from datatables is an easy way to access data. datatables seems to be superior in this regard. But I've also rebuilt this functionality making things like this possible, showing the average value of the grid's "rand" column, taking into account all filters and returning all rows (not only selected ones): return grid.avg('rand', {filter:true, selected:false}); This statement is used for the stats row at the bottom of the grid. Todos: Action items for pw-panel editing Anything else that you think is necessary?
    1 point
  25. Awesome!!! Thanks!! Thought I've read the whole docs and examples and googled for an hour but found nothing... now it will be a lot more fun working on this tomorrow Maybe I should change the topic title to "everybody who can rtfm better than me, raise your hands" ??
    1 point
  26. I built this one on bootstrap 4 with a number of extras. ie. Animate on scroll for photos and carousels, navbar animate on scroll, lightbox, facebook sdk for page embed, google map embed, and font awesome. I am using the page tree as a row builder instead of navigation. I detached the menu system from the page tree to give more control on external links, single page website situations that need to link to sections, and add new window target options. It also lets you have different footer links vs header links this way. You can add something like a privacy policy to the footer and not the header and still have one place that controls your menus. Extensions used: Color Picker, Inputfield ACE Extended, Google map marker, MarkInPageTree, Media Library, and Hana Code. I made a little module that will combine all of my ACE code fields into one merged javascript file and one merged css file on page save also. (Filename time stamped for cache busting.) Its pretty neat! I have code tabs on pages that contain css and js ace fields tied to various things. containers, themes, quick styles, and my sitewide code snippets can all have css or js that are merged on page save. While the page rows are great for adding elements to single pages, the sitewide snippet template is very powerful also. Located under the template page, these are filed under the location name. It has fields for files, css, js, php, and html code. By adding this one page to the correct location; Top, Head, Body, Bottom, it will autoload and add code to various locations all at the same time and keep everything organized. ie. Install a header file, and it pulls in all of the related css styles and javascript code at the same time for you. You can check out my screenshots to see how it all works! You can insert bootstrap rows, columns, and add bootstrap elements to columns. https://www.lakehamiltonoutfitters.com/
    1 point
  27. $page->images->eq(1); // second image
    1 point
  28. can you just foreach the images and output each slide? otherwise $page->images->eq($n);
    1 point
  29. This is another way to accomplish it, perhaps more efficiently: $n = 0; $total = count($page->thingy); foreach($page->thingy as $data) { $n++; $data->isFirst = ($n === 1); $data->isLast = ($n === $total); echo $data->render(); } Your repeater_thingy.php template should now be able to compare against $page->isFirst and $page->isLast
    1 point
×
×
  • Create New...