Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/19/2017 in all areas

  1. Hey guys, some light reading: https://supertiny.agency/en/blog/how-secure-is-your-website/ This discussion pops up from time to time, and this is something I usually point out every time I show PW to a new client, so I thought it would be nice to write a permanent post on the subject. Enjoy.
    12 points
  2. Rather than chartjs, can I suggest something that outputs SVG (not canvas) and is potentially based on D3js to make it easy to manipulate beyond the charting library's built-in options. SVG gives more options for exporting the charts for use in vector graphics editors. I admit I haven't done a chart heavy project in a couple of years so I am not fully up to date, but I quite like http://c3js.org/ - they are not the sexiest charts by default, but you can manipulate however you want via CSS and D3js making it incredibly flexible. There might be other good/better options out there now also so definitely worth some research time.
    5 points
  3. Hi everyone, @bbeer has kindly sponsored support for CSV import creation of multilanguage content in child pages. You can "Add" new pages in your default language, and then use "Update" mode to add the content for other languages - this is done with separate CSV files for each language. This feature should be considered an early beta version at the moment, so please backup your database first and test carefully on a dev version before deploying live. Let me know if you come across any issues. Thanks again to @bbeer !
    4 points
  4. I've done quite a number of forms with this type of setup, not sure if any of this js would help but just in case... (using custom timepicker init and callbacks)
    3 points
  5. Exactly. If any vulnerabilites show up, there will be listings of it, either on Secunia or somewhere else. Certainly here in this forum, at least. And I do state that none of the listed vulnerabilities on the other platforms are scandalously dangerous. Of course PW benefits from freshness. I used a similar argument when I defended a proprietary CMS. But in the end, excuses aside, the fact is a compromised PW site is something unheard of in a 10 years old CMS. That's time enough for something to show up. Whereas if you own a Wordpress site which is "way more mature", you should check for updates every two weeks, just in case, and you risk breaking your site when you update. Basically the point here was to raise awareness that vulnerabilities do exist and pop up regularly. PW comes out ahead? Great! Hey, 2 alerts a month on WP on average? Come on!
    3 points
  6. IMHO the topic that pw is secure than other CMS is not a good strategy to promote pw itself. Drupal is one of the oldest CMS, and there are a lot of hackers around the world eager to test it. WP as well. PW is quite new in cms world and not popular yet. So if until today PW is not listed in Secunia, it doesn't mean that pw tough enough from hackers. Maybe yes maybe not ...
    3 points
  7. I updated the Cheatsheet just today to contain the latest dev.
    3 points
  8. Too many copywriters out of a job? I have a hard time getting clients to write 300 chars on the whole page, let alone the meta description.
    2 points
  9. No. I am using D3 itself. Early on, I researched quite a number of charting libraries (including all the usual suspects). I also looked at C3 (and similar). It is a wrapper around D3 to help you avoid the D3 learning curve. I decided to stick with D3 itself for a number of reasons. I didn't mind the D3 learning curve. In fact, I didn't find it as challenging as some sell it to be. No disrespect to C3 and maybe it is the ProcessWire in me but I wanted to get my hands dirty instead of being on the other side of some other library. Besides, if I was going to learn C3 API, I might as well learn D3. There's thousands of D3 examples with thousands of developers around the world using it. Whatever you want to do, there's a high likelihood that somebody else has already done it; So, there is already an existing solution to your problem .
    2 points
  10. you just have to use a regular multi select, and then init that with the chosen JS on your form; In other words you wouldn't setup the formbuilder field to use chosen select, you would setup a page select multiple with a InputfieldSelectMultiple as the input; then you would config add the chosen assets from within your formbuilder.inc file in your templates folder, using either a conditional or a switch statement; you would also need to add a init js file that would init the inputfield.. (see https://harvesthq.github.io/chosen/ for examples)
    2 points
  11. You have a few peculiar selectors in there. I'm not sure what you are trying to do but it looks to me like there is some confusion between $pages and $page, and between get() and find(). $pages is all the published (and not hidden) pages in the site (that the current user can view). $page is the current page only. get($selector) will return the first one item matching $selector. find($selector) will return all items matching $selector. Take a look at http://cheatsheet.processwire.com/
    2 points
  12. To point it down: For everything you want to do, but can't do with built in functionality, you need to find the appropriate hook and then use it!
    2 points
  13. @heldercervantes Oops... shared your great blog post on FaceBook and concerned it may have gone viral
    2 points
  14. You are right. This is somewhat convoluted. However, I did manage to solve my problem using the information from the post you linked. I also remember now where that selectable options array error came from. With debug=true and advanced=true you normally hover over the collapse icon to view the field you use when defining your API fields. In this case the field shows as "_options". There is also a link to an article which describes the means by which you can manipulate this type of field. The article is incomplete, in that it does not describe checkboxes (multiple value). The selectable options error occurs when you try and use the article information with this type of field. The following is how you can create a multiple selection field via API utilizing checkboxes should anyone else come across this. if( !$f = $this->wire( 'fields' )->get( 'myOptionsField' ) ) { // check if field already exists $f = $this->wire( new Field ); $f->name = 'myOptionsField'; $f->label = __( 'My Options Field Label', __FILE__ ); $f->description = __( 'My Options Field Description.', __FILE__ ); $f->notes = __( "My Options Field Notes.\nCan be more than one line.", __FILE__ ); // We want this field to store our options $f->type = $this->wire( 'modules' )->get( "FieldtypeOptions" ); // You must save your field definition at this point, which is the same procedure through the admin interface. // You cannot modify other field parameters until the field is first saved. $f->save(); // assign a group tag to group like fields if you want. $f->tags = 'groupTag'; $f->required = 1; // required field = 1 // This is the same as selecting Checkboxes (Multiple values) on details tab. $f->inputfieldClass = 'InputfieldCheckboxes'; // Create a function (if needed) to retrieve your desired options from whatever source. $myOptions = $this->getMyOptions(); // return a sorted array of options // Set the number of columns based on the number of options. // Here I hardcoded 15 options as the break point for a new column. $f->optionColumns = ( count( $myOptions ) % 15 ) + 1; // Create a function (if needed) to convert your array of options to newline delimited string. $myOptions = $this->getOptionString( $myOptions ); // Fire up the option manager and add your option string to this field. $manager = new SelectableOptionManager(); $manager->setOptionsString( $f, $myOptions, false ); // Now you can save the modified field definition. $f->save(); } Now your process module can work with the available options. In your form process function, you will need the form ($f) and page ($p): private function processMyOptionsForm( $f, $p ) { $input = wire('input'); if ( !$input->post->submit ) { // Is form submitted return false; } $f->processInput( $input->post ); if ( $f->getErrors() ) { // Does form have errors $this->wire()->error( $f->getErrors() ); return false; } // turn off page formatting before changing values. $p->of(false); // remove any checkbox options previously selected. $p->myOptionsField->removeAll(); // loop through the page fields foreach( $p->fields as $fld ) { if( $fld->name == 'title' ) continue; // We don't want to change the page name // Is this our options field? if( $fld->name == 'myOptionsField' ) { // Here the array of user selected values is assigned to the selectable options of our field. $p->myOptionsField = $input->post('myOptionsField'); } else { // Set page fields to form field values $p->set( $fld->name, $input->post($fld->name) ); } } // Save the page with our new values $p->save(); } I hope this saves someone from a headache or three.
    2 points
  15. Hi I'm using the CKEditor for my articles and when I view the page, all the HTML tags are visible. How do I get rid of them? Thanks for any help Simon ### Hi Silly me - I couldn't figure out how to get the CKEditor, but now I've figured it out. Thanks all the same... Simon
    1 point
  16. Hi Simon, Please make sure that the field is not set up to do HTML Entity Encoding. To do this, edit the field for which you setup the CKEditor and go to the "Details" Tab and then remove the HTML Entity Encoder from the list of Text Formatters to be applied to that field. Just hit the little trashcan/dustbin icon at the right. This will be applied when you save the field. You should also make sure that the content type further down the page is setup for Markup/HTML. Hope that helps!
    1 point
  17. Hi all! Sorry I'm little late for the party. Key validation on every page load is surely not necessary and it was just a simple stupidity be set like that. It's fixed now and I just pushed it to github. Thanks for the notice! (not been using the module after couple of tryouts)
    1 point
  18. Interesting read - https://moz.com/blog/how-long-should-your-meta-description-be-2018 TL;DR 300 chars, up from 155
    1 point
  19. I agree with @kongondo that D3 isn't really that hard - I think it comes down the how much flexibility you need. I think you have to take the approach that best fits the task - as always. PS - this was my original D3 type approach to generating SVG and PNG diagrams/charts programmatically: https://pear.php.net/package/Image_Canvas It was very cool back in the day
    1 point
  20. It really is supercool - so incredibly flexible. I think it's initial look might put some people off, but you have so much control over what is output which is what makes it so powerful - sounds like something else we all love around here
    1 point
  21. but @heldercervantes has not said any lie there .. you know any security issue? .. If not, then PW is the safest until proven otherwise
    1 point
  22. I wonder why I am getting 830 on dev vs your 800? Can you figure out which ones are missing?
    1 point
  23. yes but now i'm pointed to the next questoins... i'l try to find it with you google link
    1 point
  24. I know what you meant And that's why I said it sounds weird. Because it seems you are doing it "wrong". I say it again: Take yourself 20minutes and do the Hello Worlds Tutorial. Step by Step. And I mean DO it, not just read. Especially when you have some programming background the concepts of ProcessWire will be different than you expect. And I bet when you are done with the tutorial you can answer your questions from the first post yourself. I don't want to sound lecturing... haha, I knew it and I just wanted to add: Invest that 20minutes and have fun for the next years enjoying the ease of pw PS: Seems it made click in 7 minutes, not in 20 ^^
    1 point
  25. hi timberwolf, welcome to the forum 2 hints here: many of us are using google to easily search the forum: https://processwire.com/talk/topic/6196-easy-search-on-pw-forums-with-google/ maybe you did'nt find anything because getting data from the database is just too simple with processwire that's a common problem when starting with processwire: you look for problems/compexity that you know from other systems but that simply don't exist in the pw world here it already starts sounding strange... also in your code example you are mixing some things up and are making things more complex than they need to be! give yourself 20minutes and do the https://processwire.com/docs/tutorials/hello-worlds/ tutorial step by step. I'm sure it'll make "click" after that PS: you are mixing up $pages->find() and $page->get() in your example! see https://processwire.com/api/ref/pages/find/ and https://processwire.com/api/ref/page/get/
    1 point
  26. Hi Soma, Just wondering if you would consider implementing the latest code from the Tracy Captain Hook parser. It us returning 830 core hooks compared to the 770 listed on this Captain Hook page. Also, you have this error showing at the bottom of the new version: Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/philippurlich/Documents/projekte/pw2.1/PWCaptainHookCLI/generate-html.php on line 82 Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/philippurlich/Documents/projekte/pw2.1/PWCaptainHookCLI/generate-html.php on line 83
    1 point
  27. @bernhard thanks! 1. Good idea! I'll ask the client if they want this change. 2. I think we'll skip this one. I'm not a big fan of too many things happening on hover.
    1 point
  28. Thanks at @adrian – I've also found TextformatterTagParser which also meets my needs…
    1 point
  29. yes, you can do anything you want... https://processwire.com/api/hooks/ https://processwire.com/api/hooks/captain-hook/ send an email when a field changed, modify the description of an inputfield, inject custom javascript into your page... anything.
    1 point
  30. I'm wondering about this part... If these options (checkboxes) are added dynamically, are all the options also defined in the selectable options for the Select Options field? You cannot save an option to a Select Options field if it is not one of the pre-configured selectable options. If you want to dynamically add to the selectable options then this reply has some example code:
    1 point
  31. Let me join you in that shame! Just spent an infuriating 30mins on this. My template? <?php namespace ProcessWire; ?> <?= $page->body; ?> So glad this thread exists!
    1 point
  32. Hey there! https://magenta.pt/en/ This is my latest release. A company that does digital textile printing. In this one I went way beyond just designing and building the site. I designed the logo and illustrations, shot the video in the homepage and the samples in the gallery as well. I have some tweaks planned after having tested the site with real people, such as adding a visual cue to scroll down on some pages. These will come in later, after gathering all input and planning the update. Technically this follows my usual recipe. Repeaters for building pages in a modular way (see the slideshows in the middle of the text in the services page), AIOM, MarkupSEO, Sitemap... The gallery is hand-built with a custom zooming engine that lets users drag with a finger on touch devices, or reacts to the mouse's position on desktops. Could be smarter loading the images, but for now there are only a handful, so I didn't bother for now and will revise on the 1.1 update. There's also a blog section that is currently hidden until they have enough content to launch it. Hope you like it. EDIT: Here's the case-study on my portfolio: https://supertiny.agency/en/folio/magenta/
    1 point
  33. actually that's a good point because requesting the data from the server is one thing whereas presenting it is another. at datatables you have cell renderers that render your values differently in different situations. so your datefield would ideally be an integer (making it sortable) and be DISPLAYED in the table as a formatted string (using moment.js). so you would not need to format the date via sql because that is done on the client maybe that's why i was not really eager about it and you thought it would be more important. but having a findObject/Array method in the core would justify that feature to some extend. regarding the datatables there will also be an option for defining php functions (see here https://processwire.com/talk/topic/15524-preview-rockdatatables/?do=findComment&comment=158061 ). $table->data( $pages->find('template=item'), [ ['col_name1', 'label of this column', function() { return $this->page->title; }], ... So that would make it really simple to setup tables - you would not have to know or write anything related to SQL. You could just use php's date('Ymd', $page->yourdatefield) function. So all the SQL options are really only meant to be used for complex tables. I think every developer working with that kind of complex tables should not be afraid of using some (very simple btw) sql queries thanks for all your input!
    1 point
  34. hi francis, thanks for your suggestions! You mean something like "make a piechart of column x and y"? I'm already thinking of that but don't know if it's really worth the effort when you can write nice charts with some lines of chartjs code... maybe a simple example/tutorial would be of more help... Thanks, I already knew kendo and like the style very much. Though I'm sure I cannot provide all those features. But I already built my module to be extendable via plugins so everybody will be welcome to contribute. The filter plugin will for sure be one of the most important ones and your examples are nice starting points! and https://demos.telerik.com/kendo-ui/grid/filter-menu-customization Yeah, I also thought of that option. Would be quite easy. Could be used like this: $pages->findObjects('template=basic-page', [ 'id', 'templates_id', 'mydate' => 'SELECT YEAR(data) FROM field_mydate WHERE pages_id = p.id', 'multilang_example' => 'SELECT GROUP_CONCAT(#data# separator '|') FROM field_test_page WHERE pages_id = p.id' ]); 2 things here to mention: using subqueries makes this very easy to implement multilang would be possible replacing #data# by data1234 (data + langid) I really like where this goes so far
    1 point
  35. It seems to me that a good definition of a ''Modern Site Profile'' should be: an mix of the UIKit Site Profile and Multilingual Profile. Multilingual: of course, does not need further explanations why this profile is important for many of us. UIKit : for those who ask them selves about the hype around UIKit, I suggest a very basic test: Take a tablet, a smartphone, or any device with a touch screen, and then, go on the documentation page of each of the majors CSS frameworks: -Bootstrap -Foundation -UIkit Try EACH function, like it is supposed to work on a touch screen device: with the help of your ...finger. At the end, I am pretty sure you will understand why UIKit is a good choice for PW: Because IT WORKS. (No more: expand..ooops... retract....Re expand...ooopss keep the finger too long on the item...f...k...try again.... @£¦@@$....will plug a mouse....) Everything works. It could be UIKit 2. Married with PW, It is way enough to make a terrific couple. And.... Santa is coming...
    1 point
  36. nice site 2 suggestions (or maybe more 1 suggestion and 1 feedback): it would be nice to have different markers for sold/available - can save lots of clicking. i would prefer opening the details on hover and not on click (needing a little caution on mobile of course)
    1 point
  37. Hello @desbest. Below I've added 2 short video how to install Blog profiles for Processwire: REGULAR SITE PROFILE: TWILIGHT PROFILE:
    1 point
  38. Like @K4mil I had to put 'nl_NL' in C (nl_NL for Dutch) to get rid of the warning, because the field C was empty.
    1 point
  39. Seems like the main problem is that the setKeyAndValidate() method is called on every PW ready(). I just commented that out and load times go back to being normal. I don't know the Tiny API, but I would think it would be possible to either just do this once, the first time the API key is entered, or perhaps if it's needed for each call to Tiny, then it could be called only when one of the hooks is triggered. Perhaps @Roope can take a better look since it's his module.
    1 point
  40. There was a suggestion here in the forum recently that front-end editing works best when you are using the same version of jQuery in your template that PW uses in the admin back-end. So that is something to try.
    1 point
  41. Thank you so much, everybody. I discovered the culprit which is me... I studied the module and the first this it checks is the presence of the <html> tag... and it was missing! Go figure! After all these years making websites!!!! I am ashamed... ;-) Thank you again!
    1 point
×
×
  • Create New...