Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/17/2017 in all areas

  1. Field Descriptions Extended This module enables you to extend field descriptions by dividing short descriptions with a longer text that is revealed in a toggle. Modules Directory: http://modules.processwire.com/modules/field-descriptions-extended/ Github: https://github.com/outflux3/FieldDescriptionsExtended Extending your field descriptions using the standard field's description field. Once this module is installed, it will automatically search your description field for the presence of 5 dashes (-----). Any content above the 5 dashes will be visible and the content below the dashes will be hidden. A 'More...' link will appear at the end of the short description which when clicked will reveal the rest of the description. Using Simple Markdown Editor with the description field If you have Simple Markdown Editor (InputfieldSimpleMDE) installed, you can enable the field description to have that editor. *When using Simple MDE, you can use the button (Insert Horizontal Line) instead of typing 5 dashes. More about SimpleMDE. Extending your field descriptions using content from a ProcessWire Page for the field description. You may use the content from a ProcessWire page as a field description. This would allow you to easily insert images, links, and use hanna codes. To use page content for your field descriptions, please follow these instructions: Install Select Fields module (FieldtypeFields) http://modules.processwire.com/modules/fieldtype-fields/ Create a new field using this field type, e.g. field_select. Add the field to any template you will be using for your field descriptions. Setup your help pages (for example under a settings branch) where you will store the field description content,using the template containing the Field Select. Add content to a page and select the field where that content should show. To show a short text before the link to the longer content, separate them with 5 dashes Be sure to update your settings on this page, first enable page content descriptions,then specify the name of the Select Fields field, template to search, and content field. If you create a field description using this method, please note that the description field must be blank for contexts where you want the page content to appear. You can freely use template context for field descriptions, but the Page Content method is not context sensitive and will display under all contexts where the description is blank. ---- original post: This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways. The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text. This is achieved by separating the intro/visible text and the rest with 5 dashes. Example setup: the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.
    15 points
  2. This week we've got a newly updated ProcessWire installer, some nice upgrades to our user profile editor, along with more updates to the new Uikit admin theme that was recently added to the core. https://processwire.com/blog/posts/processwire-3.0.84-core-updates/
    11 points
  3. Easiest way that works for inputfields both inside and outside of repeaters is to match the name of the field associated with the inputfield: $wire->addHookBefore('Inputfield::render', function(HookEvent $event) { $inputfield = $event->object; if($inputfield->hasField == 'YOUR_FIELD_NAME') { //...
    4 points
  4. Okay, I've narrowed down the problem. It occurs whenever an image or file is uploaded and then the page is immediately saved via the hotkey. It seems to be related to the "Choose File" button having focus after a image/file is uploaded - like the first click() just shifts the focus but does not trigger a submit. What fixed it for me was, at the end of aos_triggerSave() where the button click is triggered, first focus the button: aos_saveButton.focus().click();
    3 points
  5. Another possibility is GitBook, i haven't used it much, but can generate PDF, epub, mobi etc; it also integrates with GitHub
    2 points
  6. I don't see a problem here with regular fields. Any chance it's just ImageExtra fields that cause the problem?
    2 points
  7. ok didn't know there is a difference. if you do not do already i recommend using adrians awesome tracy debugger module. then you see that inside a repeader the field has a different name: $wire->addHookBefore('Inputfield::render', function(HookEvent $event) { $field = $event->object; bd($field->name); }); hope that helps and you find your solution on your own i'm busy
    2 points
  8. Took it one step further, and with a bit of hackery on the templates and the module file, got my sidebar in and various other tweaks. Not properly responsive, breaks some theme settings, the breadcrumbs are ropey, the sidebar is not full height (or fixed), less needs serious refactoring. Not sure why the masthead is a fixed height, but anyway, this is what I want my admin theme to look like I personally think you don't need theme settings for layout, for me it just makes the admin theme harder to tweak. Why not just have a theme that does one thing? I don't want to use jquery layout, or any fly in anythings, other than the sidebar on mobile. It doesn't need to be overcomplicated. Would be awesome to get something like this working properly so it could be a proper admin theme. I'm a bit stuck on the php side of things, I can handle the less (need more practice with uikit though for sure). I'm more than willing to team up with someone if they like the idea/look of this.
    2 points
  9. https://auth0.com/blog/converting-your-web-app-to-mobile/
    2 points
  10. Literally Phonegap, Marmalade or Cordova, does this... soooooooo give it a go
    2 points
  11. Thanks to a request from @Rudy this module now supports "Allowed Roles". This is basically the same as the option in the Page Protector module, but I thought it might be nice here as well. It allows you to limit access when in Protected Mode to a defined list of roles.
    2 points
  12. Part 1 of a 2 part Module & Service Reveal. I'm currently working on a new module: ModuleReleaseNotes that was inspired by the work I originally did on making Ryan's ProcessWireUpgrades module "release" aware. In the end, I decided to ditch the approach I was originally taking and instead work on a module that hooked in to the UpgradeConfirmation dialog and the module edit page. Aims My aims for this module are as follows... Make discovery of a module's changes prior to an upgrade a trivial task. Make breaking changes very obvious. Make reading of a module's support documentation post-install a trivial task. Make module authors start to think about how they can improve the change discovery process for their modules. Make sure the display of information from the module support files/commit messages doesn't introduce a vulnerability. Looking at these in turn... Making discovery of a module's changes prior to upgrade a trivial task. This is done by adding a "What's changed section" to the upgrade confirmation dialog. This section takes a best-effort approach to showing what's changed between the installed version and the updated version that's available via the module repository. At present, it is only able to talk to github-hosted repositories in order to ask them for the release notes, the changelog file (if present) and a list of commits between the git tag that matches the installed version and the tag matching the latest version. It will display the Release Notes (if the author is using the feature), else it will display the commits between the tags (if tagging is used by the module author) else it will show the changelog file (if present) else it will show the latest N commits on the master branch (N, of course, being configurable to your liking.) An example of the Github Release Notes pulled in for you, taken from Mike Rockett's TextformatterTypographer Module... An example of a tag-to-tag commit list from the same module... An example of a changelog - formatted to show just the changes (formatting styles will change)... Finally, an example of a fallback list of commits - sorry Adrian ... Making breaking changes obvious. This is currently done by searching for a set of configurable search strings. Later versions may be able to support breaking change detection via use of Semantic Versioning - but this may require some way of signalling the use of this versioning standard on a module-by-module basis. For now, then, you can customise the default set of change markers. Here I have added my own alias to the list of breaking change markers and the changes section of the changelog is styled accordingly (these will be improved)... Make reading of a module's support documentation, post-install, a trivial task. This is done by making some of the support files (like the README, CHANGELOG and LICENSE files) readable from the module's information/settings screen. There is an option to control the initial open/closed state of this section... Here is Tracy's README file from within the module settings page... Make module authors start to think about how they can improve the change discovery process for their modules. There are notes in each of the sections displayed on the upgrade confirmation page that help authors use each of the features... Make sure display of external information doesn't introduce a vulnerability. This is an ongoing concern, and is the thing that is most likely to delay or prevent this module's release lead to this module's withdrawl should a vulnerability be found. Currently, output is formatted either via Markdown + HTML Purifier (if it was originally a Markdown file) or via htmlspecialchars() if it has come from a plaintext file. If you discover a vulnerability, please get in contact with me via the forum PM system. Ongoing... For now, I've concentrated on integration with GitHub, as most people use that platform to host their code. I know a few people are hosting their repositories with BitBucket (PWFoo comes to mind) and some with GitLab (Mike Rockett?) and I would eventually like to have adaptor implementations for these providers (and perhaps GitKraken) - but for now, GitHub rules and the other hosts are unsupported. Links Github: ModuleReleaseNotes PW Module Repository: Here
    1 point
  13. As a general issue... It's a tricky one, how pages that are already selected in a Page Reference field should be handled if they no longer meet the requirements for selectable pages for that field. When getting the value of the Page Reference field via the API, I think the value should be validated through the isValidPage() method when it is "woken up" from the database. Currently the field value is validated on sleep but not on wakeup. Validating on wakeup would solve the situation where the value of the field when accessed from the API is different to the apparent value when viewing the field in Page Edit. But wouldn't solve the fact that the database value still includes an invalid page and so could give unwanted matches in $pages->find() for example. Or if that is not desirable for some reason then I think there should be some improvement to how invalid items are handled in the inputfield. Currently they are hidden in the inputfield, but that means that if you just view the page in Page Edit but do not save then you get a false impression of what the value of the field is. Maybe if invalid items were shown in the inputfield but highlighted in a warning colour, and then those items removed when the page is saved. Would be good to hear what others think about how invalid selected pages should be handled. For your specific issue... If you are foreaching the pages in your template, you could check the template and date of each item to determine if it should be output or not. Edit: you could actually use FieldtypePage::isValidPage() to validate each page in the Page Reference field value in your template, e.g. /* @var FieldtypePage $field */ $field = $fields->home_whatson; foreach($page->home_whatson as $item) { if($modules->FieldtypePage->isValidPage($item, $field, $page)) { // output $item } }
    1 point
  14. Thanks for the updates! Seeing as the profile editor is getting some improvements, could you look at adding FieldsetTab support? Related topics: https://processwire.com/talk/topic/16125-tabs-on-profile-edit-page/ https://processwire.com/talk/topic/16253-user-profile-tabs-markup-regions-the-lack-of-tuts/
    1 point
  15. This takes me back to my newbie days PS - hope that didn't come across as though I was suggesting that is a newbie question @jploch - I would probably have referred to that old thread if I had the need once again.
    1 point
  16. If you can control the naming of the images then that is an easy solution. Otherwise you need to do natural sorting of the files array. Something like: $files_array = $item->sequenz_files->getArray(); natsort($files_array); // Now foreach $files_array // And if you need the files as a Pagefiles object for some reason $pagefiles = new Pagefiles($item); $pagefiles->import($files_array); // Now foreach $pagefiles
    1 point
  17. You need to install the PDO driver: https://stackoverflow.com/a/6735730/1524576
    1 point
  18. Updates have been made to this module that hopefully help usage: better CSS styling, improved styling of lists config options added for Help Tab Tab Title Tab Color Tab Icon, or no icon Modal width in px, or if not set, full width Better overall Admin Theme support, incl. AdminThemeUiKit Instructions added to main module screen to prevent confusion Retain ability to run setup again if FieldtypeTemplates is installed after first run
    1 point
  19. The 'page content for field description' option works along side the split content; so it is possible to use both as is show in the screen captures. When using the page content option, the content is from a page (e.g. under help pages). The aim is to make it configurable where you can specify which field to use for the content; the textformatters are applied, so you can use markdown if preferred; Right now it is hardcoded to use the body field. For determining which field to show a link to the page's content on in the description, currently in my usage i have a FieldtypeFields field where you select the field that the content should show up on. The other option would be to just use a text field and have users enter the name of the field, or if multiple then a space or comma separated list; Having the selectable fields using that inputfield is very convenient though and maybe less error prone. On UiKit theme it uses the uikit panel to show the help info; the actual content is already on the page, output in a hidden div next to the inputfield; so i don't think pw-panel will work since that is all about iframes. I had thought about the idea of creating a process module that would output the content from any page and then be able to use pw-panel, but i'm not sure if it needs to go there, as it would add another sub-module; On the other themes it shows that content in magnific popup. The main reason i like the panel better than using a popup overall is that i actually have clients who are not super computer savvy or experienced and they are confused by popups and overlays, i've had them close the window because they didn't realize that they were still on the page.
    1 point
  20. Do you intend to import this tabular data into PW as pages? If yes, have a look here:
    1 point
  21. @Macrura Muchas gracias for your additions! Could you open a pull request against the "dev" branch? I would like to integrate your features Cheers
    1 point
  22. I've been doing functions from the start, but more recently I've had a couple of instances where I go for a custom module. I can't really speak in terms of performance, haven't made any tests, but the module approach feels better when there's more than one or two functions, to organise everything more neatly. Example: I'm working on an online store built from scratch. In that project the server shoots emails all the time. On register, on purchase, on order status changes, etc. Each email has a template that can be edited in the CMS. It becomes complex having to handle multiple templates and usage scenarios, replacing variables, different results based on context, so turning it into a module made it much more organised. I guess for me it's about volume and reusability. If it's small stuff I don't bother.
    1 point
  23. Does anyone know if it's possible to do something to "tell" PhpStorm how PW uses a template file and what variables are in scope there? For the purposes of code completion and to avoid erroneous undeclared variable warnings. Currently I manually list all API variables and variables declared in the auto-prepended _init.php inside a DocBlock at the top of every template file. This works but gets pretty tiresome, especially when you need to make a change globally. What would be cool is if PhpStorm could "know" that all API variables are available in every template file and that _init.php is prepended and so all the variables declared there are in scope. Anyone know a way to achieve this? BTW, for API variables the Functions API is a no-go for me because I dislike all the string concatenation that goes with it.
    1 point
  24. The inputfield could be approached a similar way to Profields Table, which does support large amounts of data through limiting and pagination. It was the introduction of pagination within Table that prompted my GitHub request. But although an inputfield solution is important it is the API side that is of greater importance. Currently you cannot do anything with the value of a Page Reference field without loading all the pages into memory. So if you have a Page Reference field with 2000 items and you do... $item = $page->my_page_reference->first(); ...or... $item = $page->my_page_reference->findOne("name=foo"); ...then boom, you have 2000 pages loaded to memory. It's not like $pages->find() or $page->children() where you can be selective or limit what is loaded. Compare with $page->children(): parent-child is one kind of basic relationship between pages. Page Reference is the other kind of basic relationship between pages. Both of these relationships should be able to scale up, but currently only parent-child does. This discussion probably warrants it's own topic.
    1 point
  25. Well, it's pretty much just like this. If the createdUser property for the given page matches the current user, it will return true, otherwise false. If that doesn't make sense, maybe post some code so we can debug for you.
    1 point
  26. Perhaps no one has come up with a good way to monetising this. And with internet speeds getting faster and more people having bigger data allowances, the use case for offline viewing diminishes over time IMHO. Also I've never seen a mobile app that had a satisfying way of managing their user files, and I'm guessing it might be due to the restrictive nature of file access in mobiles. I can only speak about my IOS experience, so I don't know if Android handles it better.
    1 point
  27. 1 point
  28. i'm working on something in this direction i have to polish up a lot though. don't know when i find time...
    1 point
  29. On the other hand some languages seem to promote (or at least make it easy to author) fewer lines of code or fewer characters over readability. In my experience expressive syntax often results in code that is easier to read and grasp. Of course you can write unreadable or readable code either way, so again it's very much up to the developer
    1 point
  30. Wow, i am blown away by all the nice and helpful replies on this thread. I spent last night reading the tutorials and it all makes a lot of sense, in fact to be honest it sounds amazing. It already feels like i have been stumbling around in the dark with using other CMS'es. I have got a local version on my lamp stack which i am playing around with and the logic behind everything makes a lot of sense already. I haven't been this excited about using new software in a long time. Thanks for all your replies and i would like to say what a friendly and welcoming community this is!
    1 point
  31. That would work, but there is an aos tweak to move the save btn next to the title. But perhaps prevnextlinks could be placed to the far right then, will think of it.
    1 point
  32. Maybe the arrows could float right next to the Save button? Besides not moving so much between pages, on the default theme it would also have the benefit of less confusion with the breadcrumb separators (which look quite similar).
    1 point
  33. I needed a way for the files to not force download, so that admin users can quickly view a document in their browser; i added this to the hookDownloadFile() method: $options = []; if($this->wire('input')->get('view')) { $options['forceDownload'] = false; } and then added options to the download: $file->download($options); // Access check performed by this method up in the hookRenderItem i added this: $segments['view'] = 1; $link = $this->wire('page')->url . '?' . http_build_query($segments); $markup .= " | <a href='{$link}' target='_blank'><i class='fa fa-eye'></i> " . $this->_('View File') . "</a>"; $markup .= "</div>"; so now the file looks like this: It would be cool to consider adding this functionality, since it can't always be assumed that the files should force download; maybe it needs to be a config option where you choose the behavior or opt in for download and/or view links...
    1 point
  34. @Xonox have you used template caching at all? I really don't use template caching on any of my sites except one, which is the only one i have seen the same problem. May be unrelated, it happens even after I turned all the template caching off. Adding the namespace didn't seem to help for me. I also have a bunch of files in the templates folder that don't render as visible templates (basically reusable chunks) so I think that makes them less likely to get checked/recompiled (they just get included in actual rendered templates). Haven't gotten to the bottom of it and it's a site that rarely gets dev changes so I just delete the compiled versions whenever anything is changed in those template files and it's fine. Haven't tried re-installing and frankly for my affected site it's not worth the effort, but would be interested if anyone finds a solution or explanation.
    1 point
  35. Hi adrianmak, here's a good read: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupAdminDataTable/MarkupAdminDataTable.module It's not that don't want to fish and cook for you, but fishing your self will give you more experience.
    1 point
×
×
  • Create New...