Jump to content

Leaderboard

Popular Content

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

  1. Hi @rick - maybe take a look at ProcessAdminActions which uses tabs. See how I add the wireTabs class to an InputfieldWrapper https://github.com/adrianbj/ProcessAdminActions/blob/f85e537f72fdfce299cf0c2c22366a290049f664/ProcessAdminActions.module#L337-L340
    4 points
  2. The UIkit theme is looking lovely, but does anyone else think it goes a little too far in terms of padding? On my 27" monitor this interface looks quite large. On something like a 13" laptop you would not get much interface on the screen it would require a lot of scrolling. I love clean whitespace as much as the next person, but there is more than just aesthetics to consider. The admin interface is something that as developers we are going to spend a significant amount of time using. The extra scrolling and mouse movement that a widely-spaced interface requires is something to consider. Definitely not wanting a cramped, crowded interface but I think there is scope to be more efficient here, particularly in the vertical padding. In designing a utilitarian interface like this I would be inclined to follow a process of starting with no padding and then adding padding to elements by eye until it feels right.
    4 points
  3. Version 0.7.6 is now available with the first round of reported problems fixed. Please note, the changelog for the version of the module includes the term "Breaking Changes" so if you go through the module upgrade path for this module, you'll see breaking change highlighting in action. In this case, it's OK to proceed. Update: version 0.8.0 is available. Adds support for code highlighting in support files thanks to Abdus' TextformatterPrism module (if it happens to be installed.)
    4 points
  4. Maybe superfluous, but I've banged my head around this on several occasions. Don't forget to add the WireTabs in your JavaScript.
    3 points
  5. Hi Webhoes, Hope you are doing good Please find the below corrected piece of code. <?php namespace ProcessWire; /** * @global Sanitizer $sanitizer * @global Inputfield $input * @global Page $page * @global Page $pages */ //if user has send a form you can use $input rather that $_POST if ($input->post->aFormFieldName) { //create page if form submitted $p = new Page(); $p->setOutputFormatting(false); $p->parent = $sanitizer->selectorField($_POST['country']);//Country should exists in the page tree $p->template = 'population'; // example template $p->title = $sanitizer->pageName($input->post->name); $p->name = $sanitizer->pageName($input->post->name); $p->email = $sanitizer->pageName($input->post->email); $p->body = $sanitizer->text($input->post->body); $p->save(); echo "page ID {$p->id} created!<br>"; return; // stop with template code here } ?> <h4>Add a sighting</h4> <form method="post" action='<?php echo $page->url; ?>'> Location <input type="text" name="name"><br> Country <select name="country"> <?php foreach ($pages->get(1022)->children as $country) { echo '<option value="' . $country->id . '>' . $country->title . '</option>'; } ?> </select> Subspecie <select name="subspecie"> <?php foreach ($pages->get(1027)->children as $subspecie) { echo '<option value="' . $subspecie->id . '>' . $subspecie->title . '</option>'; } ?> </select> Remark <input type="text" name="body"> E-mail: <input type="text" name="email"><br> <input type="submit" name="aFormFieldName" /> </form> Please check if it helps.
    2 points
  6. Hi, It look like its a MySQL server configuration issue. You should check the value of MAX_USER_CONNECTIONS in your MySQL server config file. Do you have access to the server config file or are you on a shared hosting ? You can check the value from PHPMyAdmin :
    2 points
  7. 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.
    1 point
  8. http://www.karenthomasphotography.com/ modules: AIOM+, ProcessPageDelete, TextformatterVideoEmbed. js: isotope, imagesloaded, fitvids, scrollTo, and Jquery with custom AJAX magic.
    1 point
  9. Yeah, @arjen, I've been bangin' my head against the keyboard all weekend that I've got QWERTY imprinted on my forehead. @adrian, This worked. Thank you. I had looked at your admin actions reference from another thread, but didn't want to use a form, so I passed on it because there was one other thread where ryan had replied with using form or wrapper or whatever else... I assumed a form was not required. So basically all those other threads have incorrect information in them, or that information only works with very old versions ProcessWire.
    1 point
  10. Thanks for help, Dave. I originally had this but for some reason the date set in the CMS (to today's date) has passed when using strtotime("now") my guess is that the date today starts at midnight whereas now is... well, now so in a sense it has passed (in UNIX time).
    1 point
  11. Here's the code block: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/modules/Process/ProcessModule/ProcessModule.module#L309-L327 In case you don't know, it is called when you do a Modules > Refresh
    1 point
  12. Just kinda thinking out loud, but I'm not sure $today = strtotime("now"); is going to work as expected. See http://php.net/manual/en/datetime.formats.php
    1 point
  13. Not sure if this is due to any changes in this specific version, but I’m not able to upload images (tested in a user profile). It returns with Invalid POST Data. Upon further investigation, it seems to come from this: /wire/modules/Process/ProcessProfile/ProcessProfile.module (line 213) When uploading the image, it sends a post request to /admin/profile/?InputfieldFileAjax=1, with the following headers: X-FIELDNAME:image X-FILENAME:6.png X-REQUESTED-WITH:XMLHttpRequest The user ID doesn’t appear to be set in the request, which is why the error is thrown. Interestingly, the HTTP code returned is 200… After that request, another is made to blob:http://domain.lserv/aa5ddd22-6dbf-42e0-9d12-1cee83b8fb39, which returns the image I uploaded, yet it does not exist in the files directory. (Honestly, I don’t know how AJAX uploads work behind the scenes, so this part of it could well be by design…) Is there something further I need to do, or is this a geniune bug that needs reporting?
    1 point
  14. Hm, I don't consider this as an issue, rather personal preference or maybe annoyance, that can be dealt with a few css tweaks, although I didn't attempt to do it (yet), waiting for more experienced CSS developers
    1 point
  15. I just noticed that it’s not possible to turn off email notifications for private messages. The tooltip for the relevant toggle-switch says that an administrator has disabled it. @Pete, would you mind re-enabling it? I sign into the forums every day, and so an email notification of a private message is practically redundant.
    1 point
  16. Agree. We all love space to breath, but in this case this is just too much. Especially those notices are annoying with their height. On the other hand, this is just default theme, waiting to be "pimped" ...
    1 point
  17. +1 when it works. Sometimes it doesn't. Other times I have to wait for seconds for the scroll to top to begin. Sometimes I also get in the console:
    1 point
  18. I made a quick (shabby non-centred) demo of something I've been working on, worked out OBS studio just enough to record this. There's no sound but you get the idea. There's also no sidebar, I thought I'd get the theming sorted first then work out how to incorporate that, I was actually thinking a sidebar with 'favourite' links would be pretty cool, which I guess could be a (process?) module. I'll add that to the bucket list. There was a lot of tracing variables about but I'm pretty happy with the outcome. The different colours are controlled with a single line in my custom theme less file and you see the mouse professionally disappear of screen whilst I recompile. Give us a shout if you want to try it, learning how to use github properly is also on the bucket list
    1 point
  19. one thing that i would find difficult from the perspective of UI, is that if you click on an image, you lose all context of where you are at, scrolled down – the page scrolls to the top, and even if you close the larger image at the top, it doesn't put you back where you were – this results in an insane amount of vertical scrolling if you wanted to peruse the portfolio items. You may need to either add prev/next navigation to the opened image, or find some other way of presenting the detail of the images when clicked.
    1 point
  20. The module is now up on Github in case anyone wants to test it or give it a try. Some additional features were added, like the ability to use SimpleMDE for field descriptions (on the field edit screen). There are probably still some things in this module that could be improved overall, but fundamentally it works well and is in heavy use on one site. This module is being used instead of the Admin Help module now in most cases, because typically the info that editors need to access is always about a specific field, so general instructions on the page editor (like in the help tab or lightbox) do not help as much as here, where targeted/contextual info about how to interact with a specific field is a click away.
    1 point
  21. @adrian with your help its working perfectly, i tested it. thanks
    1 point
  22. Another approach is to not allow users to create pages at all, but rather automatically create a single unpublished page for each user in a hook at the time the user is created. Then each user can populate and publish their page if they wish.
    1 point
  23. i encourage you to take this challenge as soon as possible. it's really not hard and it will make your head think differently in some situations and make your code cleaner and easier to maintain. and in the end that will save you time have fun
    1 point
  24. 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
  25. 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
  26. I'd try to keep things decoupled. So if your php functionality does not depend on anything processwire I'd keep in in a separate class/file even if it's going to be used in a module, which does bind/hook the functionality into processwire.
    1 point
  27. i don't think there is any noticable performance difference (just guessing). the main difference imho is reusability. for small things functions are totally fine. there is a reason why the _func.php file exists in the profile but if you use your function across several pw installations it's for sure better to pack them in a module, host them on some version control system and push updates to all of your sites easily whenever you want. that could get tedious when you have your code spread all over your sites and _func files...
    1 point
  28. @rafaoski, do you know about the Site Profile Exporter module? You can make your own profile (or edit an existing one) and add in whatever technologies you want, then export it and use it for new PW installs. I'm not sure why any of the things you are requesting need to be connected with the PW core as everyone's preferences are different. When it comes to profiles that are bundled with the core I'd like the number to reduce (to, like, 1 maximum) because for me I never use them and it's just unnecessary megabytes that have to be downloaded and unpacked with every new core release. Currently nearly half the size of the PW downloadable core is made up of site profiles that for some users (most?) will just be immediately deleted. I'd rather see each "official" profile in it's own GitHub repo where they can be downloaded only if needed.
    1 point
  29. There was a recent post somewhere in the forum of a video of Rasmus briefly explaining (sort-of) why PHP was "bad" at the beginning, and how far PHP has come in 2017 with PHP 7+. I personally love PHP despite its reputation because it's almost as old as the internet itself, and has endured with it. While that's not directly a measure of being a good programming language, it's a measure of stability that means anything I learn doing in PHP will be useful for years to come, unlike how some modern frameworks/language/libraries come and go. And like horst said, there are always good and bad coders regardless of the language. Just like how they hail Python as a good programming language, but I've seen some people write some horrible stuff in it, ProcessWire is probably one of the best things I've come across that's written in a "bad" programming language.
    1 point
  30. Sorry about that - I wasn't seeing that because I had an older, updated install that already had those options stored in the settings database. New version just committed fixes it. Thanks again!
    1 point
  31. I have turned it into a Page method: /* Returns the complete URL of a Page. * * @param int arguments[0] Pass false to exclude the pageNum of the Paginator * @return string */ $wire->addHookMethod('Page::siteCompleteUrl', function($event) { $withPageNum = isset($event->arguments[0]) ? $event->arguments[0] : true; $full_url = page()->url; if (input()->urlSegmentsStr) { $full_url .= input()->urlSegmentsStr; } if ($withPageNum && input()->pageNum > 1) { $full_url .= "/" . config()->pageNumUrlPrefix . input()->pageNum; } $event->return = $full_url; }); Small changes were applied to it: "/" is added in the second "if" to avoid double slashes on the pages of the paginator first argument can be used to exclude the page number of the paginator, defaults to true
    1 point
  32. Hi @Roman Schmitz - sorry about that! I will commit a fix a little later (I want to clean up some other stuff while I am at it), but for now please change: https://github.com/adrianbj/FieldtypePhone/blob/56ec89e7fc81cdc693ce72f9f9030edf3f49bd63/FieldtypePhone.module#L159 to: if($value['data_extension'] != '') $pn->extension = wire('sanitizer')->text($value['data_extension']);
    1 point
  33. Since PW 3.0.21 (2.8.21) you can use: echo count($page->getLanguages()); in your case: if (count($page->getLanguages()) > 1) { $markup = ''; foreach($page->getLanguages() as $language) { if ($language->isCurrent()) continue; $markup .= "<li><a href='".$page->localUrl($language)."'>".$language->getLanguageValue($language, 'title')."</a></li>"; } echo "<ul>$markup</ul>"; }
    1 point
  34. I found the solution: you have to include $user->userimage->removeAll(); // wirearray before this line of code $user->userimage = $upload_path . $files[0]; This removes the image array in a first step and then loads the new image in the database.
    1 point
  35. As noted above by Pete (2nd post), what you are actually looking for now is: throw new Wire404Exception(); Does that work for you, or is there something else going on still?
    1 point
  36. Andi, nico has build an SEO tool not an encyclopedia.
    1 point
×
×
  • Create New...