Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/05/2016 in all areas

  1. I have been using this module for a long time and it's been incredibly useful so I thought it was time to share. It's great for fields where you want to instruct content creators to reference something about a the page, its template, or its parent, or grand parent, etc Specify fields/properties of the page in your field's Description or Notes content, eg: [page.parent.url] [page.title] [page.template.label] You can also define a str_replace to be performed on the returned value, eg: [page.name.(-|_)] which will return the page name with the dashes replaced with underscores. An option to allow raw HTML is available. You can also use hanna codes within your description and notes fields - big thanks to @Robin S for this idea. http://modules.processwire.com/modules/dynamic-description-notes/ https://github.com/adrianbj/DynamicDescriptionNotes/ Hope you find it useful.
    8 points
  2. Another possible use of this is pointing the user to edit another related page by making use of the ID of the related page, eg: Test link to [Edit Parent](./?id=[page.parent.id]) which looks something like this: Anyway, there are lots of possibilities for enhancing the content of your Description and Notes text.
    5 points
  3. I thought about this feature as well from time to time . There is a new version 1.0.1 which fixes some PHP7 issues and adds the possibility to set custom labels for each extra field. It also supports multi-language usage. Furthermore I changed the way the extra fields (form) are rendered. Now you can click a tab and briefly hold (aka long-click) it and all extra fields will switch to that language. And I removed the checkbox for the caption field. If it was set, it will be added as first item in the `other fields` input field.
    4 points
  4. Hej, you will get the current hostname via $config->httpHost if($config->httpHost === "dev.malabu.de") { echo "<link rel='stylesheet' href='dev.css'>"; } else { echo "<link rel='stylesheet' href='style.css'>"; } another approach could be to check if the visitor is superuser or has a dev role (add a "dev" role before) and assign it to your dev account – and then, similar to above: (you don't have to setup subdomains then ...) <?php if($user->hasRole("superuser")) { ... } else { ... } ?> <link rel='stylesheet' href='url/to/css/<?= ($user->hasRole("superuser")) ? "dev.css" : "normal.css" ) ?>'> or like in the last line with the shorthand if/else syntax
    3 points
  5. Same place you would any other website, in the <head> part of your website. You will likely find this in /site/templates/ Thanks, Tom
    3 points
  6. I knew I shouldn't have shared this module Let me have a think about these and see what the best options might be.
    3 points
  7. Yeah the initial superusers id is hardcoded in the config, so you can't accidentally remove your own access rights.
    3 points
  8. You're right. The check whether to show the description label or not missed a condition. Since adding the opportunity to add textformatters I changed InputfieldText to InputfieldTextarea. Textformatters like Newlines to Unordered List doesn't make that much sense if you aren't able to add line breaks. I added a condition: all fields default to InputfieldText except the fields which got a textformatter assigned. I'm not that happy with the layout/styles right now. I need to invest some more time optimizing the layout. You're right, too. I missed the following scenario: checked captionField but added no otherField. The fixes are merged into the master branch
    2 points
  9. Hi John and welcome to PW! To expand on what Tom said, you might be looking for a head.php template file, or perhaps it will be in main.php or something along those lines. PW doesn't control your frontend markup at all, so there is no way to know for certain how the previous developer set things up, but what you are looking for a a template file that is included in all the page specific template files, or one that itself includes the other ones.
    2 points
  10. Thanks for sharing Adrian! Is it possible to display values from an other language than the default? I would like to inject [page.url] and its counterparts from the other languages into the Title description of a blog page (just what we see in red on the Settings tab, but) it could be a good overview to see something like: /blog/my-nice-article/ /es/blog/mi-buen-articulo/ I'm willing to hardcode the language IDs into it... Another question: what about "custom" php? Or is it out of the scope of the module, because if it is "custom", why not implement it from scratch in the first place?
    2 points
  11. Hi @adrian, I have had a look at this and I think the problem is due to the direction of file path slashes on Windows versus Unix. You can see mixed forward and backslashes in this screenshot of the Template Resources panel. It looks wrong but the links to the editor still work okay. Edit: apparently it's no big deal to mix forward and backslashes within a path for Windows. In terms of the error notice links containing paths to the file compiler cache, this is because having the slashes around the wrong way prevents the str_replace in Helpers::editorMapping from replacing the necessary section of the path. I got the links to work by adding the following after line 303 in TracyDebugger.module $compilerCachePath = str_replace('/', '\\', $compilerCachePath); Of course this is not a real solution. But maybe there is some cross-platform way to deal with file paths?
    2 points
  12. That looks a bit strange to me. You are saying data is an array where the first value is the string 'notices' and the second value is the WireArray $notices - is that intentional? Or do you maybe mean: $data = array('notices' => $notices);
    2 points
  13. I actually have something set up for a user who can only add/edit pages. The Setup, modules, and access aren't visible at all to the user. I simply created a new role with with certain actions (page-edit/page-clone/page-edit recent/page-template/page-view/page-lister) and assigned that role to a new user I created. This should "hide" the setup/modules/permission.. Of course @LostKobrakai posted right when I hit submit..
    2 points
  14. @bernhard I've used various versions of the firewall over the years (it's usually updated once a year), and while I ran into the occasional conflict a few years back, it's been solid ever since. I'm currently using it on a couple of Apache servers (Ubuntu 14.04 with the most recent version of Apache) on about 6 different PW-powered sites (both http:// and https://), and so far so good. I haven't run any specific test to measure its efficiency, but I see fewer traffic peaks from questionable sources and fewer errors in my logs. And it gives me an additional peace of mind to have this added layer of protection against bad actors. I've added this additional block as my logs showed persistent automated (and dumb) attempts to access Wordpress login or directories. # 6G:[REQUEST STRINGS] <IfModule mod_alias.c> RedirectMatch 403 (?i)(wp-admin|wp-content|wp-login) I don't think this really needs a module as it's a quick copy and paste operation, although it's true that releasing a module would raise awareness and more people would discover it. @Mike Rockett I'm certainly not a Regex expert, but if you look at the "Learn more" section, there are various articles over the years that show how some highly optimized regex rules can go a long way.
    2 points
  15. FrontendUser The FrontendUser module provides a frontend login, logout and user registration functionality. Features See module documentation for details. login with error handling and value sanitizing Plugin: ProcessForgotPassword core module integration Plugin: LoginPersist module integration user registration with username and email address already in use check email adress pre-register validation (email verification) Extendable with additional fields and by PW hooks forms generated by PW form api Custom style / script Requirements FormHelper (0.7.1+) Usage Documentation / examples Repository PW module repo GIT repo ToDo / Issues Issues I hope it will be helpful to the community and I would be glad to get feedback or suggestions for improvement!
    1 point
  16. Admin Page Tree Multiple Sorting ClassName: ProcessPageListMultipleSorting Extend the ordinary sort of children of a template in the admin page tree with multiple properties. For each template, you can define your own rule. Write each template (template-name) in a row, followed by a colon and then the additional field names for sorting. Example: All children of the template "blog" to be sorted in descending order according to the date of creation, then descending by modification date, and then by title. Type: blog: -created, -modified, title Installation Copy the files for this module to /site/modules/ProcessPageListMultipleSorting/ In admin: Modules > Check for new modules. Install Module "Admin Page Tree Multible Sorting". Alternative in ProcessWire 2.4+ Login to ProcessWire backend and go to Modules Click tab "New" and enter Module Class Name: "ProcessPageListMultipleSorting" Click "Download and Install" Compatibility I have currently tested the module only under PW 2.6+, but think that it works on older versions too. Maybe someone can give a feedback. Download PW-Repo: http://modules.processwire.com/modules/process-page-list-multiple-sorting/ GitHub: https://github.com/FlipZoomMedia/Processwire-ProcessPageListMultipleSorting I hope someone can use the module. Have fun and best regards, David
    1 point
  17. I am pretty happy with this solution - works for me anyways! Myself, I add SmartyPants and HTML Entity Encoder textformatters to all text fields.
    1 point
  18. @blynx: thanks a lot, I've used your second version and it works like a charm.
    1 point
  19. haha, I tried this today but $field->columnWidth = 50; has been ignored. So I guess I need to change the whole markup, wrap the fields inside a list or something like that. Today I just wanted to finish the other feature and didn't investigate further. But I keep it in mind. Furthermore I won't add another column for the widths of a field, I would prefer to set it to 50. Otherwise I've to add one more column to define the number of rows the textarea should be – for each field. I know... There is a github issue for this as well. For now I got no good idea how the interface / structure could look like – it has to be as easy as possible for the user to add / remove / manipulate the fields. Maybe a simple input field where the user is able to add all option fields (comma-separated). Once the module settings has been saved one more table could appear. In this table the user could be able to set a type (select, radio, checkbox) and the options (comma-separated input). But what about multi-language labels and options? This would blow up the whole settings a lot... If you have a good idea, just let me know!
    1 point
  20. I'm sorry Anyway, do not spend too much time on it...
    1 point
  21. This looks awesome @justb3a - thank you! While you're on a roll, I don't suppose you'd like to add the ability to define the width of custom fields so we can float them on one line? The other thing that would really help would be an options type field with select/radios/checkbox options. Sorry, I know that's a lot - just a wishlist
    1 point
  22. Thanks @Robin S for looking into this. I am bad about not remembering Windows path issues. For the most part they seem to be handled quite well by PHP and don't actually need "DIRECTORY_SEPARATOR", but I think the issue is when you're doing replacements. Could you please test removing your str_replace line and modifying 303 to the following which uses DIRECTORY_SEPARATOR on the end instead of the forward slash: $compilerCachePath = isset($this->config->fileCompilerOptions['cachePath']) ? $this->config->fileCompilerOptions['cachePath'] : $this->config->paths->cache . 'FileCompiler' . DIRECTORY_SEPARATOR; If that works as expected, I'll try to make similar changes throughout Tracy to deal with the mixed forward/back slash links like in the Template Resources panel.
    1 point
  23. I think that embedded goggle map object will auto scale to its container and will fit much better, than static image. I would do that if there were no restrictions on using it.
    1 point
  24. if you have a backup you can get the error file from this folder /site/assets/logs/errors.txt
    1 point
  25. The field needs to be of type File (or Image if the added files are images to be used as such e.g. in CKEditor).
    1 point
  26. Just guesses here... Perhaps you should empty all caches before making your profile backup. ClearCacheAdmin would be useful for that. If you FTP to the problem directory, do you see anything there that might be preventing the creation of the temp directory? For example, an existing directory of the same name. You could also try a more traditional migration (i.e. zip/ftp/extract files, export/import db via phpMyAdmin).
    1 point
  27. Works for me. I put x-ray into the body field on page 'Three' and got this result in Selector Test: Edit: just realised you're asking about selector values that are going through a sanitizer. Not sure which sanitizer you are using, but $sanitizer->text() keeps dashes intact.
    1 point
  28. I solved this with a hook to Fieldtype::markupValue... $this->addHookBefore('Fieldtype::markupValue', function($event) { $f = $event->arguments('field'); $p = $event->arguments('page'); $v = $event->arguments('value'); if($f->name == 'my_field' && $p->template->name == 'my_pt_template') { $event->arguments('value', $this->sanitizer->text($v)); } })
    1 point
  29. @Mike Rockett Nooo.. I'm sorry for suggestion of not working code. I have just tried to and it did not work as I expected. So it is definitely more complicated task than I thought.
    1 point
  30. Such a pity to see that a developer chose to procrastinate for eight months developing something with PW. I mean, really? If you're building anything that's even half-interesting, you're bound to have some fun doing it or, at the very least, look forward to building it, right?
    1 point
  31. https://www.reddit.com/r/Wordpress/comments/55pe4l/processwire_vs_wordpress/ These guys need some fight PS: I posted something already: https://www.reddit.com/r/Wordpress/comments/55pe4l/processwire_vs_wordpress/d8dsole
    1 point
  32. Last week we called it a soft launch, but this week we'll say ProcessWire 3 is now released and considered our new master, version 3.0.35. This post is a changelog of sorts, where we will cover all that's new in ProcessWire 3! https://processwire.com/blog/posts/pw3-changelog/
    1 point
  33. Welcome to the forums, @Praxea ! It seems a common .htaccess issue, please take a look on this post: https://processwire.com/docs/tutorials/troubleshooting-guide/page3
    1 point
  34. It should be mentioned that the getById() is used internal and not access or status aware. So it's like get(id) and will load the page(s) even if they're unpublished or the user has no view rights, all a $pages->find(...) does.
    1 point
  35. $wire->addHook('Page::getLanguageJson', function(HookEvent $event) { $field = $event->arguments(0); $json = []; foreach($page->getLanguages() as $lang){ $json["$lang->id"] = $page->getLanguageValue($lang, $field); } $event->return = json_encode($json); });
    1 point
  36. Hi, that's great! I think we'll manage until then, but that will definitely help us in the long term. Thanks again
    1 point
  37. @vanderbreye, Many thanks for using Media Manager. Apologies, documentation is seriously lagging behind. I am trying my best to complete it. To select a media for editing and preview, please click on its title. The module will remember the last clicked media and if it was being previewed or edited. The media currently on preview will be highlighted with a greenish/yellow box as seen in your image above and its title will be white text against a black background. For other manipulations such as inserting or applying bulk actions (e.g. publish, lock, etc), please click on the thumbnail itself. Hope this answers your question. Cheers.
    1 point
  38. yeoman generator for processwire env: https://www.npmjs.com/package/generator-processwire
    1 point
  39. Thanks, Arjen for your help! I found a solution in your post: I guess this is developer-basics. Now I learned this one too. Thank you! And yes, you are right. I've indeed searched, but not so thoroughly I probably should. I'm a little bit in a hurry right now. Sorry and Thanks again! @diogo: Thank you too Didn't saw your post. This was what I did.
    1 point
  40. This is exactly what I needed to get image uploads working on my vagrant box (scotch.box). Edit: Had this problem on another vagrant box today, searched for the solution, and found this post—but I forgot where to find the php.ini file on scotch.box. So here are the baby steps, future self: Connect to the box shell: vagrant ssh Open php.ini in vim: sudo vim /etc/php5/apache2/php.ini Find the right line: /always_populate_raw_post_data<CR> Uncomment the line: 0x Save and quit: ZZ Restart Apache: sudo service apache2 restart Exit the vagrant shell: <C-d>
    1 point
×
×
  • Create New...