Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/15/2015 in all areas

  1. 3 points
    Hi, after looking at the 300 open "issues" on Github, it turns out that a lot of them, including some of mine, are labeled "enhancement" / "feature request". To get the increasing number of issues down there (which might give a wrong impression on how well maintained PW is), and to do sort of a cleanup I was planning to set all of my "issues" which are labeled "enhancement"/"feature request" as closed. I am assuming that the idea was either good enough and had been recognized for an enhancement consideration and thus stored in a to-do list somewhere else, or the the idea was not good enough and did not survive. In either case, an "issue" like this,does not need to be open forever, imho. Is closing it the best way to deal with it - or should we leave the step to Ryan (or anyone maintaining this)? (Also there are many "fixed" / "completed" issues that could be closed eventually.)
  2. 2 points
    I figured it out. The problem was that I didn't have a Title field for the page I was trying to reference. So how it was working at all, I don't know. I'm now using the Title field to store the company name instead of a separate company_name field. No issues with commas or periods.
  3. 2 points
    I thank both of you (Teppo and Adrian) for your thoughtful responses. As you know, getting involved with this field is a complicated proposition, I'm a retired mechanical engineer on a new start, lol. It is good to know that PW is so flexible and inclusive,although, I'm sure there are limits. My primary interests run in the areas of machine learning and data visualization. That field is exploding as you know. I am now confident that PW can play a significant role in my web site development. Thanks
  4. 1 point
    Just wanted to share what I recently used to create forms in modules and in frontend using the API and Inputfield modules PW provides and uses on its own. I think many newcomers or also advanced user aren't aware what is already possible in templates with some simple and flexible code. Learning this can greatly help in any aspect when you develop with PW. It's not as easy and powerful as FormBuilder but a great example of what can be archieved within PW. Really? Tell me more The output markup generated with something like echo $form->render(); will be a like the one you get with FormBuilder or admin forms in backend. It's what PW is made of. Now since 2.2.5~ somewhere, the "required" option is possible for all fields (previous not) and that makes it easier a lot for validation and also it renders inline errors already nicely (due to Ryan FormBuilder yah!). For example the Password inputfield already provides two field to confirm the password and will validate it. De- and encryption method also exists. Or you can also use columns width setting for a field, which was added not so long ago. Some fields like Asm MultiSelect would require to also include their css and js to work but haven't tried. Also file uploads isn't there, but maybe at some point there will be more options. It would be still possible to code your own uploader when the form is submitted. Validation? If you understand a little more how PW works with forms and inputfields you can simply add you own validation, do hooks and lots of magic with very easy code to read and maintain. You can also use the processInput($input->post) method of a form that PW uses itself to validate a form. So getting to see if there was any errors is simply checking for $form->getErrors();. Also the $form->processInput($input->post) will prevent CSRF attacks and the form will append a hidden field automaticly. It's also worth noting that processInput() will work also with an array (key=>value) of data it doesn't have to be the one from $input->post. Styling? It works well if you take your own CSS or just pick the inputfields.css from the templates-admin folder as a start. Also the CSS file from the wire/modules/InputfieldRadios module can be helpful to add. And that's it. It's not very hard to get it display nicely. Here an code example of a simple form. <?php $out = ''; // create a new form field (also field wrapper) $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'subscribe-form'); // create a text input $field = $modules->get("InputfieldText"); $field->label = "Name"; $field->attr('id+name','name'); $field->required = 1; $form->append($field); // append the field to the form // create email field $field = $modules->get("InputfieldEmail"); $field->label = "E-Mail"; $field->attr('id+name','email'); $field->required = 1; $form->append($field); // append the field // you get the idea $field = $modules->get("InputfieldPassword"); $field->label = "Passwort"; $field->attr("id+name","pass"); $field->required = 1; $form->append($field); // oh a submit button! $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","Subscribe"); $submit->attr("id+name","submit"); $form->append($submit); // form was submitted so we process the form if($input->post->submit) { // user submitted the form, process it and check for errors $form->processInput($input->post); // here is a good point for extra/custom validation and manipulate fields $email = $form->get("email"); if($email && (strpos($email->value,'@hotmail') !== FALSE)){ // attach an error to the field // and it will get displayed along the field $email->error("Sorry we don't accept hotmail addresses for now."); } if($form->getErrors()) { // the form is processed and populated // but contains errors $out .= $form->render(); } else { // do with the form what you like, create and save it as page // or send emails. to get the values you can use // $email = $form->get("email")->value; // $name = $form->get("name")->value; // $pass = $form->get("pass")->value; // // to sanitize input // $name = $sanitizer->text($input->post->name); // $email = $sanitizer->email($form->get("email")->value); $out .= "<p>Thanks! Your submission was successful."; } } else { // render out form without processing $out .= $form->render(); } include("./head.inc"); echo $out; include("./foot.inc"); Here the code snippet as gist github: https://gist.github.com/4027908 Maybe there's something I'm not aware of yet, so if there something to still care about just let me know. Maybe some example of hooks could be appended here too. Thanks Edit March 2017: This code still works in PW2.8 and PW3.
  5. 1 point
    As requested an example on how to output the star rating on the front-end. This one is based on Font Awesome, but you can adept this to any font or even plain images if you prefer. <?php /** * Small example output for FieldtypeStarRating on the front-end * */ ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $page->title; ?></title> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> <style> .star { color: #d9d9d9; } .star.selected { color: #FFAE00; } </style> </head> <body> <h1><?php echo $page->title; ?></h1> <span> <?php $star_count = $fields->star_rating_field->star_count; for ($i = 1; $i <= $star_count; $i++) { if ($i <= $page->star_rating_field) { echo "<span class='fa fa-star star selected'></span>"; } else { echo "<span class='fa fa-star star'></span>"; } } ?> </span> <?php if($page->editable()) echo "<p><a href='$page->editURL'>Edit</a></p>"; ?> </body> </html>
  6. 1 point
    Works perfectly ! I sometimes use 'file based' url segments. Then I create for every URL segment a (nested) folder. // urlsegments folder in the templates folder, when the urlsegment is there, load it! if ($input->urlSegmentStr && $page->id !== $config->http404PageID) { $segment = './urlsegments' . $page->url . $input->urlSegmentStr . '/segment.php'; if (!is_file($segment)) { throw new Wire404Exception(); } return include($segment); }
  7. 1 point
    For the pdf-invoice you could try this great module from wanze: http://modules.processwire.com/modules/pages2-pdf/
  8. 1 point
    You could use the DynamicRoles module to do so or write a custom hook, which extends Page::publishable to allow the editing of tags.
  9. 1 point
    The problem is that you are choosing 6 from each category, and not 6 from all. The ideal would be to get all the portfolio pages with one selector. There are several ways of doing this, the one that looks more logical in your case is to select by template: $portfolio_pages = $pages->find("template=portfolio-item, limit=6, sort=random"); foreach($portfolio_pages as $item) { // echo here }
  10. 1 point
    In your inline style you are missing the url() part. And the api call to the image is also not correct. Is the image field storing only 1 ore multiple images? If it is multiple, you need to do something like <div class="thumbnail"> <a href="..."> (Link to my gallery) <div class="flex-item6" style="background-image: url(<?php echo $page->images->first()->url; ?>)"> <span class="overlay">stuff</span> </a> </div>
  11. 1 point
    There seems to be something was changed with the newer smtp class that we have changed 2 weeks ago. But anyways, it seems to be fixed now. @Pete, please can you have a look to it? I haven't changed anything on the behave of To-Recipients, only CC and BCC.
  12. 1 point
    http://www.radiologische-allianz.de Step1. Homepage uses a classic design. Purpose was to make complex information look easy for patients. If you use the homepage with a mobile, you get a special view with only the things you need when you are on the road. (The most time-consuming action was organizing all this data and find an easy to maintain ways to link this all together.) We have 11 centers. This homepage is a portal page for all of them and includes individual homepages of each center at the same time: If you access things for only one center through their homepage, you get a filtered view with only items offered there. There is also an individually built center-finder which uses Google maps to find the right center for your therapy, using Processwire technology. Processwire was chosen mainly because of the enormous flexibility to build links between all different sorts of information (without it being rocket science), especially because we were able to handle even non-hierachical data (e.g. a child is allowed to have 2 parents - doctors think that's normal ), and because we could offer the client a very clean and easy to use backend, hiding all the complexity of the homepage away from him: They started using it with only 2 hours of training. Not sure you could do this with Wordpress... (This is the first homepage we did with UIkit, which was a recommendation from this forum.) (Step2 will add some speed optimizations...)
  13. 1 point
    As a more general response (since you have asked other questions lately about compatibility with other tools - PW can be used in conjunction with just about anything because it doesn't dictate any front-end markup. I use PW together with D3js (and various mapping, charting, visualization tools based on D3) and AngularJS. I have also built sites that use Mapnik (using python) with the resulting maps displayed on a PW site. In some cases I let PW handle the data (use the Profields Table field) and sometimes I write manual DB queries to dedicated database tables (if I am dealing with huge amounts of data). In one case I use some custom scripts to query a database of "big data", run it through some algorithms to analyze and synthesize the data, and then populate a Profields Table with the final values that need to be mapped/charted - in this case the analyses is only run once a year and the queries take too long to do on-the-fly. My point in all that is that you can use PW in many different ways to handle certain aspects of a site and still use other tools to query and analyze the data and/or contribute to the final user interface. Hope that helps to provide some insights about what can be done with PW. That said, if there is no need for content management (text, images), user management etc, and the front-end interface is purely about data analysis and manipulation then you might be better off with custom written server-side code that displays your data on the front-end - maybe even something built on nodejs - maybe meteorjs or a MEAN stack which includes Angularjs. So many options
  14. 1 point
    I'm not too familiar with the whole concept of predictive analytics, or big data for that matter, but taking a look at the tools you mentioned they seem to focus on visualising collected data (D3.js, scikit-learn) and making mathematical predictions based on it (scikit-learn). Please correct me if I'm wrong, though; the thick cloud of buzzwords surrounding some of these tools and concepts makes it very hard to figure out what it is that they actually do/mean. As such, I'd say that "compatibility with ProcessWire" as a question makes little sense. ProcessWire is a great tool for defining data types and storing huge amounts of data, if that's what you're looking for. It's also a great tool for formatting and outputting said data in any way you – or another application – needs it. What it isn't, though, is an out-of-the-box tool for collecting data (but you could always build something like that yourself). I'm not sure what kind of data you want to collect and analyse, so that's just about the extent I can go into this topic If you're looking into technical details regarding the tools you've mentioned above, scikit-learn is based on Python, so you'd need hosting that supports that. I'm not sure if the "python" you mentioned is a specific tool or the Python language, but I'm assuming you mean the latter, which again leads to the conclusion that you need to look for a web host offering Python support. D3.js is a JavaScript library running client-side, and thus server-side considerations don't apply there. Note: I've just moved this topic to the Off Topic / Dev Talk area of the forum, which seems like a better fit here. This question is very loosely related to ProcessWire itself, and has a lot more to do with other tools.
  15. 1 point
    looks very nice! like albert asked on the module page i would also be curious if this module is only thought to be used in the backend?
  16. 1 point
    Just change the "guest" users language to the one you want to have by default.
  17. 1 point
    It's looking really nice and clean. Even if it's stuffed with navigational elements all the time. I have some small things which I noticed. The calendar icon in the header is not clickable, while being the most poping thing of the navigation. Also I don't know if the phrase "zu den Privatpraxen" will be noticed as standalone link easily, es every other link in the header is a button. It could also be an additional label vor the "Ärzte" button. The other thing is more to please my typographical background. You're using the wrong dashes for the timetables. The normal dash " - " is a "Divis", only to be used for hyphenation or appending units to numbers and such things. The little larger one " – " is the "–" html-entity or also "Gedankenstrich" in german. It's one usage is kinda like a comma to divide different thoughts in a subordinal cause, but a little bit more visible. The other big usage is in things like timetables. Every time you're calling stuff "von … bis …" the "bis" should be replaced with the ndash. This fits not only for times, but also for example for routes: Berlin to Paris. There's also the really long one " — " (—), which is called "Geviertstrich" but it has no distinct usage in modern typography. Shortcuts for Mac: Alt + - => – Shift + Alt + - => — Shortcuts for Win: Hold Alt and hit 0150 on the number block => – Hold Alt and hit 0151 on the number block => —
  18. 1 point
    Just add something like this to the top of your events index page. You could compartmentalize this into a LazyCron call, but for such a simple thing it's really not necessary. $events = $pages->find('parent=/events/, date<"-3 months"'); foreach($events as $event) { $event->of(false); $event->addStatus(Page::statusUnpublished); $event->save(); } Btw, when testing something out like this, always comment out the $event->save(); the first time and take a look at what pages get affected by echoing them rather than saving them, the first time around. i.e. // $event->save(); echo "<p>Unpublishing: $event->url</p>"; Once confirmed that it is behaving the way you want, then remove the echo and uncomment your save();
  19. 1 point
    I don't really understand what you're trying to say, but I can have as many levels and segments still work perfect. http://pw2-dev.ch/about/what/again-another/level/test/ ...is a page http://pw2-dev.ch/about/what/again-another/level/test/xxx I get xxx as the $input->urlSemment1 Edit: Just to make sure the segments you're trying doesn't actually resolve to a page? Because if PW finds a page it won't have url segments.
  20. 1 point
    Regardless of whether handling this with processwire you should change your server variables to handle such a request. Your php.ini should be adjusted for it (at least): upload_max_filesize = 350M post_max_size = 350M And your apache should be configured too: memory_limit = 400M Update (thx Wanze) You should also adjust settings like max_execution_time max_input_time in your php.ini... I don't know if your clients host has such capabilities (-> memory limitations for such one vhost) but you should consider to convince your client to upload such files with ftp (not with http) and it is less error-prone for you and him with ftp...
×
×
  • Create New...