Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/05/2017 in all areas

  1. No problem – I've updated the "regular" demo site to use this latest version of the admin. It's not all that different from the one that was there, but does have the new offcanvas nav and several other minor tweaks that weren't present before. If you check it out, and you checked out the previous iteration, you probably want to clear your cache or login with incognito mode, as the demo site has some aggressive cache control headers and I neglected to update the css/js version links. http://demo.processwire.com/regular/processwire/ u: bloguser p: processwire3
    4 points
  2. This morning, after some adjustments and tests, the module run smoothly on ProcessWire 2.7, 2.8 and 3.x.
    4 points
  3. What rendering issues do you mean? The problem is that you cannot measure performance in printing out objects. If objects contain a lot of references to other objects, this may take time to print out. In terms of page types, you have references to other pages and there may be a recursion problem, e.g. print a parent page with references to its children pages, each child page has again a reference to the parent) etc. The Page field is one main features in ProcessWire, at least for me. It makes the whole system powerful in terms of data modeling. If you want to measure performance, you should do it right, for example with a PHP profiler. Btw I'm also fan of clean code and good performance, that's why I'm working with ProcessWire Cheers
    3 points
  4. Some basics when working in OO software. If you print_r() a object (ie page or field), PHP will traverse the object (try to) and load all its references recursively. It unfolds the object which isn't really present in the original object and only loaded or accesses it if you would do call stuff on this object. This doesn't mean the object contains all the stuff you see printed at that time before you call print_r(). Edit: Oh a page field contains only a reference (by the id) to the page and loads the page object and not even its content unless you call it (except autojoin fields).
    2 points
  5. $page->blocks->render() will output the content of the selected blocks page based on its template. Does that do what you need?
    2 points
  6. <?php $x = 0; foreach($page->SlideImagesRepeater as $SlideImagesRepeat) : $class = ($x === 0) ? "active" : ""; ?> <div class="item <?= $class ?>"> rest of code </div> <?php $x++; endforeach; ?> http://php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary
    2 points
  7. As someone maintaining a project with lots of different frontend templates I'd imagine you'd get into trouble way fast with such an approach. As soon as you've more than a few of those calls in your code base it'll get hard to reason about what's currently visible and what's not part of the markup, as you've to go through all those steps in your head. There's no scope of interaction. Each of those calls could potentially change everything in your page. I don't think it's a good idea to let you junior dev remove some class in some part of your website, which by accident could break other parts of it because the class is duplicated. With the current markup implementation you're at least bound to a (hopefully limited) number of named regions. I imagine it a bit like those early jquery webapp javascript files: a mess of spaghetti code which nobody but the creator can understand in a reasonable timeframe.
    2 points
  8. A little humorous PW vs Drupal comparison https://www.slant.co/versus/14277/4267/~drupal_vs_processwire When comparing Drupal vs ProcessWire, the Slant community recommends Drupal for most people. In the question“What are the best web content management systems?” Drupal is ranked 2nd while ProcessWire is ranked 13th.The most important reason people chose Drupal is: A more complex Drupal installation can easily exhaust 256 MB of RAM with only one or two visitors.
    2 points
  9. DEPRECATED - this module will not see any updates. I'm short before releasing RockGrid as commercial module. If you are interested contact me via PM this is a preview of a module that i'm working on for quite a long time. I needed it for an intranet office management application that i'm still working on. It makes it very easy to create very customized Datatables using the awesome jquery datatables plugin (www.datatables.net) Download - sorry, removed as it changes too frequently; closed alpha - contact me if you think you can contribute Remarks: The module is intended to be used on the backend. Loading styles is at the moment only done via adding files to the $config->styles/scripts arrays. Also the communicaton to javascript is done via the $config->js() method that is built into the admin and would have to be implemented manually on frontend use. But it would not be difficult of course Installation: Nothing special here, just download + install edit: removed some parts, because i made a complete rewrite of the module (and may not have been the last one)! [...] removed Why i created this module: of course i know @Soma s module but i needed a lot more features and the newer datatables version. also i like to define all the columns as objects and have everything on one place. lister & markupadmindatatable: nice for basic tables but lacks of features to modify the appearance of the cell values (like rendering icons, background colors and so on) datatables provides a great frontend API for filtering, showing/hiding columns, getting data, modifying it... it also plays well together with frontend charts like google chart api in this case: todo / roadmap: reload only one row add filters to all columns (in future also dropdowns, smaller than, bigger than, Regex, ...) make it possible to add table on frontend pages make buttons look like pw buttons make it possible to set settings globally and only for one table provide easy way of colorbars (percentage, red/green), maybe at different positions (left, top, right, bottom) provide easy way of adding action items (edit, show, link etc - visible or onhover) make own layout for tables (topleft, topright, bottom etc to make it easy to create extensions and show messages) privide way of simple javascript plugins (like I already have for row sums etc) provide easy way of handling actions for all selected items (delete selected, update selected...) provide easy way of reloading data (--> easy when using ajax source) easy way of showing/hiding columns excel/csv/clipboard export GUI for table setup processmodule to show different tables (lister replacement)
    1 point
  10. It is normal to be logged out after the browser session is closed. You can use the LoginPersist module if you want to stay logged in across sessions.
    1 point
  11. Okay, I got it ! Forgot to put <?php $p = $pages->get("/main/"); Thanks Adrian!
    1 point
  12. I think you might be confusing templates and pages. main.php would be template file that controls the output of pages with the "main" template, but usually main.php is used as based template that is included or modified by other templates. That aside, you need to get the repeater content from the page where it exists, so something like this: $p = $pages->get(selector to get page where repeater content is); foreach($p->repeaterfield as $repeateritem) { //usual repeater output }
    1 point
  13. Yes! Thanks that's exactly what i need. I missed render() in the docs. Just searched for that function and saw a page that i need to know more about (and may be useful to other newcomers): https://processwire.com/api/arrays/page/
    1 point
  14. I agree that @Robin S solution is definitely the easiest if that works for you. But, if you do need to dynamically order with a hook, then this should work for you. Don't forget to change 'options_field_name' to the appropriate value. $this->addHookAfter('Field::getInputfield', null, function($event) { if($event->object->name == 'options_field_name') { $inputfield = $event->return; $options = $inputfield->options; foreach($options as $id => $title) { $inputfield->removeOption($id, $title); } asort($options); foreach($options as $id => $title) { $inputfield->addOption($id, $title); } $event->return = $inputfield; } }); I am a little under the weather today and I feel like I am missing an easier way to remove all existing options before sorting and adding them back. I feel like there is probably a better way to do this in general, but it doesn't look like you can use PW's sort() here. Maybe I am just not seeing it right now
    1 point
  15. In a single-language site the description is just a plain string, so a user would want to modify the hook accordingly. I like this new feature allowing the select option label to be determined in a hook, but I wonder if choosing a single column in the field config makes the hookable method too limited. For example, in the case of using the description column as a label for an images select, having the label fall back to the sort integer if an image has no description is worse than having the image filename. Is there a way to conditionally grab a different column value from the row inside the label hook? So you could for example get the "data" (filename) column if the description column is empty. Not sure if it's practical but I think it would be cool if there was a hookable method that receives an argument of all the row columns as an array lets you return both the option value and label.
    1 point
  16. I have some automated scripts that dump the whole database into a file and uploads that to a dbserver and db of choice. I use this to do my deployments for testing and going live. I normally don't touch config.php unless there's been a version upgrade of PW. Let me know if you're interested and I can post it here.
    1 point
  17. Are you using a VPN or anything that is changing your IP Address? I normally see this when my IP address has changed and I try to login to the backend again.
    1 point
  18. I just tested this using the "Text List" and "JSON settings" options and it should now work with Core modules as well, but it's not well tested, so please let me know how it goes.
    1 point
  19. Just a heads up that I have committed a new version with lots of bug fixes (although I expect there are still some more to come). Also, there was a spelling mistake in the class name of the old version (as noted by @tpr above), so you should uninstall the old version and install this new version from scratch. Would like to get an idea of how many people are using this - I'd like to get it working well, but it's already been a substantial effort and want to make sure this is in demand over the Module Settings Import / Export that I released yesterday. Obviously this is way more powerful, but maybe it's more than most people want. Thanks for any feedback. Cheers, Adrian
    1 point
  20. I believe this requested change: https://github.com/processwire/processwire-requests/issues/25 to PW will fix it so long as the server is 64bit.
    1 point
  21. @Zeka hi! This file has only declaration of constants. There should be better sources to learn
    1 point
  22. Pushed another update with new function added which allows to modify the option labels via hook. Scenario: You want to provide a select drop down for image fields stored in another page as described in this post In the next step we want to provide labels pulled from the description field (default language in multilanguage environment) instead from the data field providing ugly file names. How can we achieve that? The description is stored as a json string. We need to extract the label from it. To do so choose 'description' as option label and put the following hook in your /site/ready.php $this->addHookAfter('FieldtypeSelectExtOption::label', function ($e) { $array = json_decode($e->return, true); $e->return = $array[0]; // image description in default language }); Function label() always provides the default lable, the option value, the page to which the field is assigned and the specific field that uses the field type to facilitate customizations. Default return is the unmodified label pulled from the database column. ATTENTION: Arguments changed since Version 1.3.5 // Version >= 1.3.5 $this->addHookAfter('FieldtypeSelectExtOption::label', function ($e) { $optionLabel = $e->arguments[0]; $optionValue = $e->arguments[1]; $page = $e->arguments[2]; $field = $e->arguments[3]; });
    1 point
  23. You can put emoji in the database (use it in text fields), but you need to use the utf8mb4 charset for your tables, which you can choose on install. You can change it later as well, but I think there's no official upgrade path to do so.
    1 point
  24. This should be seriously considered, even better: in a configurable way. Best thing would be to support user level configuration, meaning the user could overwrite the default (defined by the site's developer) on its Profile page, similarly to current Default/Reno option, but in this case the base of the layout could be configurable. We even have mockups of this!
    1 point
  25. I would also love to see this - I think it would be great if we could define it in a Github repo changelog.md file and have the automatically imported into the text in the modules directory, and perhaps even displayed in the module info within a PW install. Perhaps it would even be nice to have a way to add a flag about breaking changes that would show up in the ProcessWire Upgrades module so you are warned before upgrading. @ryan - any thoughts on this? I'd be happy to work on it - obviously I could do the PW side of it from the repo, but would need access to the php files for the modules directory to make that side of things work.
    1 point
  26. Another quick update. Both the new "Copy Repeater Items To Other Page" and "Copy Table Field Rows To Other Page" actions now include an optional selector so you can define what repeater items / table rows will be copied.
    1 point
  27. The "Add New" link is automatically hidden when the max is reached. To hide the repeater item label for repeaters with min and max of 1 you can use a CSS rule like this in AdminCustomFiles or AdminOnSteroids: .InputfieldRepeater[data-min="1"][data-max="1"] .InputfieldRepeaterHeaderInit { display:none; } If you do this you would want to have your repeater set to "Items always open".
    1 point
  28. Or you might want to do it by using Google. Ryan's blog post might help you get started: https://processwire.com/blog/posts/composer-google-calendars-and-processwire/#the-google-client-api-module To tell the truth, I've never used Google Calendars myself, so I do not know how well it could fit your needs, but some of my friends rely on these Calendars and use them to manage reservations.
    1 point
  29. Auto https does have the disadvantage, that as soon as there's some issue with the certificate the site is essentially down, even though it's running fine via http. As processwire.com is mostly running with guest users and mostly there to supply public information I'm not sure it that's worth the hassle to disallow http.
    1 point
  30. I have done something like this half a year ago. I made an intranet for a company with 200 employees. There are no problems I heard of so far. It has a full text search, a searchable image repository with thousands of photos, every user has his own profile with his portrait... Most important thing was: every download of this intranet (PDF, Word, Excel, image files and so on...) is a page. I have build a small multi file importer which allows to upload many files at once, which leads to creation of the according amount of pages with these files attached. I did this to give each file more properties (think of it as an" asset management" - every file can have properties like view rights, tags, relations, descriptions, authors etc.). To assign this download pages to their parent "content pages" (the page the visitor sees in frontend view) I did use page tables very much. I think it works very good and I enjoyed it to develop and customize.
    1 point
  31. This website is a recent conversion from a Joomla version built over 2 years ago: https://www.olddominionmc.com My client, Old Dominion Medical Center (ODMC), simply loved the ProcessWire-based colors when I showed them the original "FoundWire" demonstration prototype. This website is a modified version of the original FoundWire Demo Profile that is now using the straight CSS version of Foundation 5. It's my personal preference until I can find the time to install Ruby and LESS/Sass tools on my new development desktop. For this project, our primary objective has always been to have a simple customer-facing website that presents their patients with vital information about the practice. Our secondary objective is to continue to use the website as an information portal for their back office day-to-day operations. Some of the first ProcessWire applications I built (over a year ago) were in direct support of ODMC. I continue to expand their Intranet to incorporate many administrative and support functions not covered by their EMR/EHR system. The following are the critical ProcessWire modules that make this website, especially the Intranet shine: Form Builder Pro Cache Modules Manager Images Manager (which, to me, is the greatest of Soma's many useful modules) Hanna Code Page Edit Field Permission Changelog Custom Upload Names Login History Redirects Template Editor Import Pages From CSV JQuery DataTables Plugin AIOM+ (All In One Minify) I have special thanks for Joss Sanglier (for his fantastic FoundWire Demo Profile) and Ryan Cramer (for his Foundation 4 Profile which got me very interested in Zurb Foundation). There are many others out there to thank (mainly the developers of the above listed modules) that have made my transition to ProcessWire most enjoyable. I'm still learning.
    1 point
  32. Technology evolves and you just have to evolve when things change. The basics I learned in the 80's are still applicable today. Each new technology builds on, circumvents or basically changes what was hot yesterday. If you are serious about learning you will keep up and prosper. Don't look at new ways of doing things as a challenge, look at it as an opportunity. Don't be scared or hostile to reinventing yourself. Good Luck in your endeavours.
    1 point
  33. Peter, You can easily exclude pages in the trash by using, for example, has_parent!=7. The ID of the trash page is 7 by default...OR...example code from Trashman (the module) if ($page->parent->id != $this->config->trashPageID) { //blah blah}//used in function/method context $config->trashPageID returns the Page ID of the trash page. Pages sent to the Trash have their parents changed to the Trash page (ID=7). They don't become orphan or lost pages Edited: Added Trashman code example
    1 point
  34. I would stick with PW, really I remember getting dizzy when I had to make pages in Drupal look the way I wanted: Where this margin is coming from? Ok, this module generates this HTML with 4 wrappers. Where it takes its css from? Let's see it has cached css-file which is generated every time I save module settings. Ok, let's take a look at its real css-file. Well, it's not really css-file, but css template written in php. Ok, what we see, it generates css depending on the options we set in module's properties, but I still can't see where this margin is set. I've spent already about 20 minutes trying to find this goddamn margin property. Ok, if it isn't here it should be somewhere else, let's dig through module's source files. Haveng spent another 10 minutes looking through module's source files I finally found this margin in module_name_API.php!!! WTF? Why put it here? Ok, I fixed my margin, but I have another page where this module's markup is output next to another's and now they overlay, because that another module generates its own markup and now I have to repeat this crazy procedure again for another module. No, not anymore! I have a lot of other things to do! Yes, Drupal is very powerful, but this continuos, never-ending hacking makes me suicidal I would rather spend time creating using the system then struggling with it. As for MODx, I really liked Evolution and still do, but PW makes it look unnecessary complex and is light years ahead in terms of intuitiveness and flexibility. I also tried to use Revolution, but to me it over-complicates things and I can't stand its sluggish back-end (thanks ExtJS). Their announcement IMO is pretty logical step to take as Revolution haven't equaled the hopes, but it gave really good understanding of what's really important for this CMS. I wish MODx team good luck with MODX3 because they've already made one of the best CMSs that I really like and just because they are great guys. Wish them to repeat their success with third version. Processwire brings joy to development, this is why I will keep using it It makes me learn and create rather then hack. And it has a brilliant community, in life of which I wish could participate much more then I do now.
    1 point
×
×
  • Create New...