Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/18/2016 in all areas

  1. A good place to start reading would also be the Map Marker field module, which Ryan created as an example. In short: The Fieldtype is responsible for taking care of saving to and loading from the database as well as sanitizing values, creating the database table(s) and assembling the correct database query from a selector. The Inputfield renders the input form elements and processes form input. InputfieldMapMarker generates its input elements manually in the render method, but you can also use InputfieldXXX modules (like it does in ___getConfigInputfields) and add those to an InputfieldWrapper, then render that.
    4 points
  2. This information may help you https://processwire.com/api/fieldtypes/validation-fieldtypes-vs-inputfields/
    2 points
  3. This is my experience as well. A lightweight JS call to an external file was the best solution in most of these cases.
    2 points
  4. Sorry, I still really don't get the point. Using number_format to round a value with less than 4 decimal places ends up displaying blank/non significant zeros, eg: echo number_format(0.12, 4) results in: 0.1200 Why do you want to display the extra zeros? I still don't see why "round" isn't working for you. I think this is a very useful addition - stay tuned - hopefully coming soon! It doesn't allow for breakpoints and step-throughs. Its features are: Logging dump() to DOM barDump() to the debugger bar log() to file fireLog() to the console (both Chrome and Firefox) objects and arrays are presented in a fully expandable tree interface Error reporting Visualization of errors, exceptions, warning, notices etc with a full expandable and linked Call stack, which I find incredibly helpful in isolating the source of the error. Can be to DOM or debugger bar Automatic emailing of errors in production mode Timing Total execution time Logging of custom calls for sections of code System Info Details on php and apache versions Max memory allocation for the page Number of includes files, classes and traits ProcessWire Information Access to all the info from the Debug Mode Tools on the front-end via the PW panel in the debugger bar Extra sections to the PW panel with details of the current page, its template, the fields of this template Debug Mode indicator - nice reminder/warning in case you forget to turn it off once the site is live Links to various context relevant places in the admin, as well as general admin links Hope that helps to answer your question. I am looking for feature suggestions, like @matjazp's idea for showing all available variables. I will probably also add functions and classes too. I am also looking to include some other Tracy plugins, like performance monitoring panels. I haven't seen that issue with the bar taking up more than one line. I have tested in Chrome, Firefox, and Safari. What browser are you using? Can you show me the dom of the bar so I can see what might be causing that? I have added the option to disable the bar on the backend. I went with just two checkboxes, one for the frontend, and one for the backend. I think this works well and I agree, the module is often not needed in the backend, although I am really enjoying using it for module development - it's so nice to be able to dump variables to the debugger bar, or console when it would otherwise be impossible to get them to display without logging to a log file. I have changed the description for the email address - thanks for picking that up. I have also added options to disable the Methods Info panel and the DebugMode Indicator - users upgrading will need to revisit your config settings to enable these.
    2 points
  5. Hey teppo - I like Google's translation of your role on the board of directors of Street Workout Pori ry. How do you look in a maid's uniform? PS No sexual stereotyping intended - just a lame attempt at humor PPS Maybe that translation is legitimate - just sounds strange to an English speaker as it's not a term we would use for a role on a board of directors.
    2 points
  6. This module allows users to subscribe and unsubscribe to a newsletter, it doesn't handle newsletter creation and delivery (I use a foreign service for this). There is one method to subscribe (by using a form) and there are two methods to unsubscribe (by using a form or by providing a link in the newsletter). Furthermore you can notify any person e.g. an administator via email when an user has subscribed/unsubscribed. For detailed information have a look at Github.
    1 point
  7. It occurred to me that a good addition to the forums would be some way for PW users to indicate support for a module idea. Similar to the Wishlist subforum but for functionality that belongs in a module rather than in the core. I'm thinking mainly of commercial modules, although if someone wanted to take up a module request and release it freely that would be cool. So users could propose a module idea, then others would vote for it (using likes or some special voting option) so that a vote means "I'd buy that", with the expectation of pricing in the general ballpark of Ryan's pro modules and Apeisa's PadLoper. As a beginner-intermediate developer I'm really enjoying working with PW and learning as I go - the API is so intuitive that I've been able to build my own solutions to things that in another CMS I would have been reliant on someone else's module to achieve. But there are things that I know are beyond my current skills, and for those things I look to third-party modules. My clients are non-profits and small businesses so I'm never likely to have the budget to commission a custom module alone. But there might be other PW users out there with similar needs and maybe that demand would make it worthwhile for an experienced developer to take on a proposal and release it as a commercial module. Currently there isn't a way to measure the demand for modules apart from occasional forum posts like "Is there a module that...?" Any thoughts on this? Here's a module request to start off with: I would be happy to buy a full-featured event calendar module. I've searched the module directory and the forums and Lindquist's module is the most feature-rich I've seen, but it's in an alpha proof-of-concept state and some important functions aren't implemented. Features I would be looking for are: Calendar grid interface in admin, allowing for easy addition and editing of events. (Nice but non-essential) Week and day views in admin, in addition to month view, with drag editing for event date and duration (I'm dreaming of something awesome like the dhtmlxScheduler interface or Fullcalendar interface). Although drag operations would really need an undo to correct accidental edits, so this may be more trouble than it's worth. Events are edited in a modal window, to avoid losing one's place in the calendar. Recurring events, with user-friendly selection of recurrence options. The ability to individually edit or remove an event that is a child of a recurring event (i.e. make an exception for that individual event). (Nice but non-essential) A couple of out-of-the-box minimal rendering options for the frontend (read-only calendar view, list view). This is the kind of module I need frequently. I've been lucky that I haven't had a client request a full event calendar since I've been using PW, but it's only a matter of time. I'm sure there are other PW users who need this and who would, like me, be happy to pay for such a module.
    1 point
  8. Or maybe we just wait for 'Media Manager' ...could save us a few brain cells, huge folders and a couple of monkeys at the zoo will be the merrier... The person developing MM...(I know him/her from the forums) has recently told me it should be out for sale very soon. Fingers crossed...
    1 point
  9. Kongondo, I had a d'oh moment, but I appreciate the quick response. I really felt dumb there ha ha . I realized I wasn't actually comparing it to anything so I changed it to: <?php $styleSwitcher = $pages->get('/url-one/'); $baseURL = $page->url; if($styleSwitcher == $baseURL){ echo "<link rel='stylesheet' href='{$config->urls->templates}css/one.css' />"; } else{ echo "<link rel='stylesheet' href='{$config->urls->templates}css/two.css' />"; } ?> And with that, problem solved. I actually think I understand the find/get for $pages a lot better as well (did a lot more reading).
    1 point
  10. Adrian, I give you – in the spirit of the Oscars – the golden medal for "Best Off-Topic Comment in February 2016" for this comment! Congratulations, you earned it!
    1 point
  11. Thank you for explaining it! Tying it to to ProcessWire's debug mode in this way does not seem to be the best idea if they can actually be independent. Why don't you just introduce another option in the settings to indicate that non-superusers with the tracy-debugger role have full access too? BTW, I like the idea of "tracy-debugger role". The only useful case of utilizing the state of the debug mode seems to be when with Tracy enabled, we get errors/warnings in the case of any non-superusers too, so that it works in a similar way as the debug mode does, which might be expected in the first place. By turning debug mode off, only superuser and/or "tracy-debugger role" users have access to Tracy. Thanx again, it has solved the issue!
    1 point
  12. @szabesz You're a genius! I probably should have figured that out Thanks so much for the help on this. I was getting pretty frustrated by it!
    1 point
  13. If you have any of the "Markup/HTML..." Content Types selected, then this is the normal behavior. Tags are converted to HTML Entities, so the <p> tags generated by CKeditor are also converted and show up as text. You need to remove the Text Formatter in this case.
    1 point
  14. @Shane: Actually, it is called "HTML Entity Encoder (htmlspecialchars)" and can be found: Setup > Fields > [your Textarea field] > Details tab
    1 point
  15. Definitely a CSS issue. (blog.css). Keep in mind thought that blog.css as well as the blog-xxxx.php template files that come with Blog are all demos just to get you started. In those demos I use pocketgrid.css which will apply a float:left to all divs with the class 'block'. If you wish to use the demo files, you will need to adjust your CSS to use whatever CSS framework you are using as well as check that all the code in the template files apply to your particular need..
    1 point
  16. About the off topic issue. I'd just message Ryan. I'm sure he'll add multiple users under a single license as well if needed.
    1 point
  17. At least in 2.7.0 it already removed pipe characters (this is from Sanitizer::selectorValue): $value = str_replace(array('*', '~', '`', '$', '^', '|', '<', '>', '=', '[', ']', '{', '}'), ' ', $value);
    1 point
  18. Uhm. Shouldn't it be $selection = implode("|", $input->get->filter); ?
    1 point
  19. Sorry, didn't look closely enough. I meant h2 span:hover { text-decoration: underline; } Though for that kind of styling you should always use classes or ids to avoid styling unrelated content. I'm assuming here that you want the text to underline when you hover over it. If you want to style the text on hovering over the image, it's a completely different topic.
    1 point
  20. Debug mode in PW does two main things - it allows PHP errors/warnings to be displayed, and it shows the Debug Mode Tools in the admin. With Tracy enabled, you get the errors/warnings, whether Debug Mode is on or off, so I am finding that I no longer need it on, and it also means that I can debug a live site easily without anyone seeing the errors and $variable testing output. I agree - we need to be able to use Tracy for non-superusers - just trying to figure out the most logical way. I feel like maybe it should simply be based on the PW Debug Mode setting and a dedicated "tracy-debugger" role. So if debug mode is off, then Tracy is only for superusers, but if debug mode is on, then non-superusers with the tracy-debugger role will have full access. This way you can create a test user with the required role and simply add the tracy-debugger role to their details and things will work. Does anyone have any thoughts on this? I have replaced all icons with inline SVG - that should deal with your issue - please let me know if it looks ok now.
    1 point
  21. Maybe this helps: https://processwire.com/talk/topic/9346-not-all-specified-templates-are-editable-only-includehidden-is-allowed/
    1 point
  22. Did you also read the link (source) that was referenced in the documentation, I referred you to? https://processwire.com/talk/topic/2588-feature-request-page-id-attribute/?p=28758
    1 point
  23. Hello I have installed the blog with the blank pages. Of course the wrong one.... I need the files with the blog-templates to get it working. Now I am wondering if I can just copy the files with blog-templates from another server onto this one and just overwrite the blank-blog templates. The blog is working on the older test-server ( http://jakubdegler.ch/user3/nojs/ ). Can it be that simple ( hope so ) Thanks for any help Jakob ____________________________________ IT WORKED! I WAS AFRAID SO I ASKED, BUT THEN I GATHERED SOME COURAGE...et voila Thanks again for the great Module Kongondo!
    1 point
  24. This week we've got a really nice improvement to ProcessWire's page tree, something that I believe everyone that uses the ProcessWire admin will appreciate. Also a big focus this week was on ProDrafts and wrapping that up so that we can release it and make it available to you. More on both here: https://processwire.com/blog/posts/processwire-3.0.8-brings-smarter-faster-page-tree/
    1 point
  25. yep I know it's messy but I need those pages directly under the home...my SEO requested so... and I don't want to create some htaccess tricks to remove the container page between home and those pages
    1 point
  26. I wouldn't rule out mod_security then, it's famous for returning that kind of random errors, as there are a lot of parameters that work together to trigger an exception. If possible, I'd look into mod_security's log file to either rule it out or confirm the exact trigger(s), and go from there.
    1 point
  27. Heythere, to run the XML sitemap module from pete you'll have to add 3 more lines to your config: location = /sitemap.xml { try_files $uri $uri/ /index.php?it=$uri&$args; } Otherwise you'll get an 404 error. Cheers from austria!
    1 point
  28. I'm having some issue with the new page tree. I have 163 home's children (+8k pages). In the first page it works fine if I open a page, go anywhere and come back, but is not working for paginated pages. Screen capture video http://sendvid.com/vyi8nkb2
    1 point
  29. Sorry - I didn't check non-superusers after the recent change to the Show Debugger Bar settings. The latest version (just committed) should fix that new error! PS, I'll be adding this to the modules directory in the next couple of days, so updates will be easy via the PW Upgrade module (http://modules.processwire.com/modules/process-wire-upgrade/).
    1 point
  30. Thank you adrian! How should I update the module? I simply downloaded it from GitHub (about 10 minutes ago ), replaced the entire directory but it only works if I'm logged in (superuser), otherwise I get this: Fatal error: Access to undeclared static property: Tracy\Debugger::$showBar in .../site/assets/cache/FileCompiler/site/modules/TracyDebugger/TracyDebugger.module on line 160 I re-saved the config settings a few times and I also used "Modules > Refresh", but these actions did not help.
    1 point
  31. There's also a danger of decreasing perfomance instead of the opposite if you aren't careful with includes, as you may be introducing round trips to the content server or trading a few lines of PHP code for separate request parsing and additional file IO. Even if you speed up nine out of ten requests, the one that has to fetch every dynamic part from scratch may simply take too long in the user's eyes. Thus, Varnish ESI / NGINX SSI usually come hand in hand with in-memory caching, and if you plan for really high traffic, you'll want to make that cache distributed and add some kind of boot-up script to fill (most of) the memory cache in case of a purge (this is a point where I realized how convenient elastic cloud servers could be in heavy load environments, as you could fire up a copy of your PW server and run the boot-up script there without slowing down the life instance). I've been thinking about approaches there for a while as I'm working on my forum project, and it can be quite a headache. There's all kinds of partial, dynamic content like forum statistics, login boxes, thread updates, last posting lists or PM information, and each has different requirements regarding actuality and load impact. Add different levels of visiblity to that (i.e. through forum roles or user settings) and the flow chart becomes one of the feared many-legged spiders Expiry of memory-cached contents is another minefield in itself. I guess one generic rule, for PW as for every other web application, is that the right key already brings you half the way to the goal. If you can have your backend (PW) fill the memory cache with dynamic content and either pass the right key in a cookie to the user, use a unique URL or use GET/POST parameters to form the key, the cache can fetch that content easily. Of course, not every content is easily cacheable, and sometimes it may make sense to keep the memory footprint of cached content small by breaking it up so one doesn't end up trying to cache every single one of a thousand possibilities for every single user. In NGINX, this could e.g. mean that, instead of caching the complete logout box for each user, to render it once into memcache with placeholders and letting NGINX substitute ("echo") the necessary keywords it has retrieved through earlier calls to the memory cache (and stored the results with "set"). That's just a small brain dump and mostly theoretical, but it is an interesting topic and one I'll have to face sooner or later, so if anybody has practical experience, it would be interesting to hear about that.
    1 point
  32. To work on PW 3+, you need to change two lines on AmazonS3Cloudfront.module: Line 1 - Add PW namespace: <?php namespace ProcessWire; Line 21 - Add a slash before the class name. This references it on global namespace, not on PW's: use \Aws\S3\S3Client;
    1 point
  33. @adrian First of all, thank you for this wonderful module! I have just found the time to check it out and have a few questions: 1) Is it normal that I have this strange looking layout on the public frontend? (see attached image) It would be nice to have a bar that is only one row tall. 2) Show Debug Bar option: a select or two checkboxes please Show on public frontend only Show on admin only Show on both Do not show Currently I am only using it on the public frontend so it is just an obstacle on the admin. 3) email option: Quote: "Receive emails when an error occurs in production mode." you wrote in the forum, which is a much better description than the one you actually used in the module: "This email address will receive notification of errors." thanks again!
    1 point
  34. This looks awesome @adrian, thanks! I've just a quick glance, could this do breakpoints and step-throughs as well or its more of a logger?
    1 point
  35. Maybe: $roundedTime = number_format(Debugger::timer($name),4); How about displaying a list of local variables, without PW variables, something like get_defined_vars() but without fuel, wire, classLoader, hooks, config etc.
    1 point
  36. Greetings, Good discussion... There are many ways to go. SVGs are more like DOMs within your main DOM instead of classic images. They can be used like images, but the real power comes from being able to dynamically manipulate the code behind the images. There are a couple of different paths here. Generally: - Start with something like Adobe Illustrator or Sketch to create your SVGs. - Create CSS classes to manipulate the lines of the SVG files. - Use a simple code editor to tweak the SVG elements just like you would with an HTML document. How to include the SVGs: 1. Embed the SVGs inline using <img> tags. Simply upload the SVG to your "images" directory and reference it like any other image in your ProcessWire application. 2. "Include" the SVGs in your template. You can either (A) use the same "include" function you use for other ProcessWire files, or (B) directly load the SVG code into your template. Option A is easier to maintain and allows the same SVGs to be dynamic in multiple templates, which then opens up all kinds of other possibilities! 3. Use something like Raphael to manipulate the SVG further. But this is not necessary, especially for relatively simple examples. The syntax for manipulating SVG styles is not always the same as HTML styling. Here are a couple of good references: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/SVG_and_CSS https://www.w3.org/TR/SVG/propidx.html https://www.w3.org/TR/SVG/styling.html As for help and resources, here are some general discussions: http://tympanus.net/codrops/2015/07/16/styling-svg-use-content-css/ https://css-tricks.com/using-svg/ https://www.smashingmagazine.com/2014/11/styling-and-animating-svgs-with-css/ Thanks, Matthew
    1 point
  37. I read this article from WordFence recently. It gives you an idea as to how these attacks are done in detail. Worth a read/watch: https://www.wordfence.com/blog/2016/02/wordpress-security-attack-platform/
    1 point
  38. Yup... On a sidenote: The wp-admin Wordpress template / code / PHP editor is by itself a huge security-risk. I would immediately uninstall it.
    1 point
  39. After so many times for so long, being in the news being compromised makes you wonder if wordpress is still worth anyones time and effort.
    1 point
  40. Take a look at this one: https://gist.github.com/somatonic/5233338
    1 point
  41. I have to refresh that subject! I am looking for a long term business relation to a freelance php/pw developer starting next early year. After 10 years of cooperation, my long term freelance developer is now employed. For this reason I'm in need for a partner as php/pw Developer. I have several medium to big projects coming up. There are also some big projects, in which I need help from a qualified php developer. Please drop me a line, if interested to work together with me! More details in a private chat. Thanks a lot!
    1 point
  42. Thank you for the hint. I had not enabled that option. After enabling it, all is fine now. Should have looked at the module settings more carefully
    1 point
  43. Yes, I have read something similar in stackoverflow. I will do some tests. Maybe input type=text combined with the pattern you suggested is the safest way.
    1 point
×
×
  • Create New...