Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/24/2016 in all areas

  1. Maybe your file compiler settings are not compiling included files:
    3 points
  2. I set all my templates up initially as "no-file" templates, using the Create a new template without a file... option, then go to the Files tab and enter "main" as the Alternate Template Filename. This points all my "logical" templates to a single "physical" template at /site/templates/main.php. From there, you can include the actual template any number of ways, the simplest being something like this: echo wireRenderFile('./views/'.$page->template->name.'/'.$page->template->name.'.inc'); The main reason I do it this way is that I also use AllInOneMinify for asset management, and I have it set up to automatically include an associated javascript and/or LESS file for each template if present, so for the "home" template, instead of having home.php loose in the templates directory, I have: /site/templates/views/home/ ...which contains: home.inc home.js home.less
    3 points
  3. Very good initiative @adrian! What I think could be useful is: max_execution_time (and if it can be increased) max_input_nesting_level xdebug & xdebug.max_nesting_level function_exists('gd_info') $gd = gd_info(); $ver = isset($gd['GD Version']) ? $gd['GD Version'] : $this->_('Version-Info not available'); $jpg = isset($gd['JPEG Support']) ? $gd['JPEG Support'] : false; $png = isset($gd['PNG Support']) ? $gd['PNG Support'] : false; $gif = isset($gd['GIF Read Support']) && isset($gd['GIF Create Support']) ? $gd['GIF Create Support'] : false; $freetype = isset($gd['FreeType Support']) ? $gd['FreeType Support'] : false; function_exists('exif_read_data') class_exists('Imagick') In regard of mysql, I think the version is important. For more, you may have a look at DiagnoseDatabase.module or ask @netcarver & @ryan.
    2 points
  4. I am tempted to add a few key PHP settings in another sub-section of this list - I think it could really help with quickly identifying some issues. What do you guys think of this list of metrics? mod_rewrite mod_security allow_url_fopen post_max_size upload_max_filesize max_input_time max_execution_time max_input_vars memory_limit Adding in @ryan and @horst to see if you guys have any other specific Apache/PHP settings that you think would be useful to include in Debug info. I think these (together with the pw/php/mysql/apache and module version details mentioned above should cover most common issues (including image uploading problems). Btw, if you're confused what I am talking about, scan a few posts up to see this new feature in Tracy for copying a Github-friendly formatted collpased/expandable list of debug info for inclusion in Github Issue reports.
    2 points
  5. https://clipboardjs.com/ Of course I could have just put the markdown code in the textarea, but I wanted to keep that simply for viewing and copy/pasting into the forum (in a spoiler), etc.
    2 points
  6. I am a total offender of using a ridiculous amount of templates, but there are many ways around this. Most of the time you can standardize your templates so that every different type of page doesn't need to use a different template, and just includes the functions that are applicable for that part of your site. Over the years there have been several discussions on this subject, and what I have seen everything come down to is just a matter of implementation. If you find that you are getting too many templates then possibly look into how you can make your code a bit more reusable and aware of its context. Here is a good starter, but I recommend googling our forum and focus on posts in relation to page structure.
    2 points
  7. FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/ GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin). The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen. The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages. The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan! Warning/Consideration Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API Backend Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer. FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. A very simple example. return 'Hello'; Simple example. return $page->title; Simple example with markup. return '<h2>' . $page->title . '</h2>'; Another simple example with markup. $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example. $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example. $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do: return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows: return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup') Access the field on the current page (just like any other field) echo $page->runtime_markup; Access the field on another page echo $pages->get('/about-us/')->runtime_markup; Screenshots Backend Frontend
    1 point
  8. Hi all, I am new to ProcessWire module development. Just recently getting back to using PW again after a couple of years away from it. I was looking for a SASS/SCSS/Compass pre-processor module for PW and couldn't find any. The closest I could find was AllInOneMinify but it doesn't do SASS/SCSS. I decided to make this module (with heavy inspiration from AOIM). This is a pretty basic module that takes one or more sass/scss/compass file(s) and compile them automatically in your template. Github link https://github.com/lesaff/ProcessWire-Sassify I really appreciate any comments, suggestions, bug fixes, etc. Hopefully this is the first of many modules. Thanks Rudy Note: Added to Modules directory, under http://modules.processwire.com/modules/sassify/
    1 point
  9. Could the modules list in the Versions List be in alphabetical order? It's hard to find a given module if it's not.
    1 point
  10. Yeah, let's do it - I'll look into it more later. For now, here is what the latest info looks like when pasted into Github: Thanks again @horst and @szabesz for your feedback and suggestions.
    1 point
  11. $max_execution_time = trim(ini_get('max_execution_time')); $can_change = set_time_limit($max_execution_time); I only know: simply testing if it can change. That image processing feature shouldn't belong to the Version List. Just wanted to throw it in and ask, if this would be useful to integrate somehow into Tracy.
    1 point
  12. Ah, sorry. No, there are no other needs in regard of mysql. I just mentioned this and pointed to Steve and Ryan, as I don't have much knowledge of mysql. But throwing in another thought, that I have had some time ago, what can be useful in regard of troubleshooting image processing issues: Selecting / defining a problematic image, and var_dump all infos of ImageInspector + the current image settings, calculated / merged like here.https://processwire.com/talk/topic/13125-get-image-quality-value-from-image-instance/ But I don't know if this could be something practicable for Tracy. (?)
    1 point
  13. Thanks @horst - great ideas! I'll add all those xdebug, GD and Imagick metrics. As for MySQL version - I am already capturing that in the Server Details section (along with PW, PHP, and Apache versions). Does that cover your needs, or are you thinking of something else?
    1 point
  14. Ah, welcome back sanity! Spot on thanks Adrian. Mine was set to 'Yes (template file only)'. Had no idea what this section actually did, now I have a better idea.
    1 point
  15. Looks like you have a namespace issue. Have you tried clearing the FileCompiler cache? I don't think it should matter, but do you have the ProcessWire namespace added to your home template, but not others?
    1 point
  16. I haven't tried this but come across with it a few times. Perhaps I could use it for a few things in my modules, I think there could be some cool usage of this
    1 point
  17. Nice! What did you use for copy? As I know some browsers doesn't allow interacting with the clipboard.
    1 point
  18. Pretty stoked by this morning's update The Versions List now has a "Copy for Github" button, as well as a "Copy plain text" button. The Github button copies MarkDown code to your clipboard that results in this formatted output: Absolutely no excuses now for not including all your server and module info details in your Github Issue reports. Please let me know if anyone has any problems or suggestions for improvements / things to include.
    1 point
  19. Hello adrian, forget what I have written. After I have updated to the latest version this error message was gone. So everthing works fine.
    1 point
  20. Welcome to the forums @mciccone I haven't purchased ProDrafts so I can't give a definitive answer on whether the module has a schedule feature, but it wouldn't be too difficult to code your own solution using the API method for publishing draft pages: $page->publishDraft(); You would take a similar approach to the Schedule Pages module. That is, add a "publish_from" date field to your page template, and use a Lazy Cron hook to find unpublished draft pages with a publish_from date < now and publish them.
    1 point
  21. Hmmm, works properly for me. You should get a warning message after changing the sort order by drag.
    1 point
  22. Do you have so many templates that you need them in separated sub dirs ? Its all about organizing the site folder tree with your page tree ! Through time I also restructured things in the site folder but I keep my templates in the root of the templates folder. Instead I keep html format for different web site pages on the front in separate folders (page views) and any navigation (topnav, subnav) in separated folders. I also create separated associated css files for them in the styles folder. This speeded up my editing and maintenance time.
    1 point
  23. OH, I thought you were talking about posts automatically being merged within a certain time period. This particular feature is just regular "flood control" to prevent member accounts being able to spam lots of posts all over the place before a staff member can intervene. I think we probably have enough staff now though that it can be lowered to 30 seconds from the current setting of 60 seconds - does that help?
    1 point
  24. I'm not sure, but isn't this more what people might be looking for when creating a new project: composer create-project processwire/processwire Otherwise processwire will be pulled inside the vendor folder, where it's from questionable use besides for being bootstrapped into other applications.
    1 point
  25. Sorry @Juergen - it looks like that function doesn't exist in all environments - Windows perhaps? The latest version checks if it exists before trying to use it. There was also a problem with the checkbox not actually disabling this panel which is also fixed now. Can you please confirm that this fixes it for you, both checked and unchecked? Thanks!
    1 point
  26. Just uploaded v068 which adds template edit link tooltips to the main pagelist items plus has some CSS improvements to a few CKE plugins (some seem to be written at least 10 yrs ago :)). And also see the ProcessPageList.js attached that was modified to enable opening collapsed pagelist items when hovering over them during drag-and-drop. It's still not perfect but it's still much better than the original imo - please feel free to modify the code (see line 1035, "change" property of "sortOptions"). The file's location is "/wire/modules/Process/ProcessPageList/". The main problem is that I check the next item after the placeholder (.PageListSortPlaceholder) so expand-collapse occurs only when moving the placholder above on item and not directly on it. I think this could be improved somehow. The reason I uploaded this here is because AOS v068 contains a few lines of CSS that modifies the appearance of dragging. Of course it works without AOS too. Here is what it looks now: ProcessPageList.js
    1 point
  27. 1 point
  28. Thanks @Robin S for your comments/suggestions. I will try to incorporate them in the next version. I think adding a checkbox for cache bust is very useful. Rudy
    1 point
  29. Today I've experienced interface issue - input fields were hidden (address, etc). After some inspection, I found that reason was in css - map has changed its relative position. I guess Google has changed smth in script that draws map as there were no changes in css locally. Do you have the same issue? To fix the issue I had to add custom style clear tag to InputfieldMapMarker.module line 161 "style='height: {$height}px;clear:left;' " .
    1 point
  30. By the way, I don't remember which version introduced this, but you can use $field->getLabel() instead http://processwire.com/api/ref/field/get-label/
    1 point
  31. Spaces in passwords take up empty space. That consumes more energy on yor minotor. FREE poasswords now.
    1 point
  32. Passwords aren’t stored as plain text in the DB, so that shouldn’t be an issue. If one is worried about leading/trailing whitespace, one might as well disallow that specifically, or routinely trim passwords (and tell the user about it). Plus, we deal with spaces in POST data all the time anyway?! Even this forum allows spaces in usernames, which kind of blew my mind the first time I logged in. I really dig it. I’m a big proponent of long passwords and I feel, calling them “passwords” instead of “pass phrases” was a major mistake, leading to the stupid password policies we see everywhere, when in reality, the best thing you can do is just have a long-ass combination. Personal sentences are great for this. Easily typed, because that’s what we’re used to type, and easy to remember, because unlike cryptic alphanumeric combinations with an obligatory exclamation point at the end, they make sense even without thinking up mnemonics first…
    1 point
×
×
  • Create New...