Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/20/2019 in all areas

  1. Quietly and without interruption this week, our whole website (and all subdomains) moved from a single static server to a load-balanced multi-server environment, giving us even more horsepower and redundancy than before— https://processwire.com/blog/posts/processwire-hosting-upgrades/
    8 points
  2. Super cool, congratulations on the upgraded infrastructure. I definitely would like to read more details about how you two setup ProcessWire in that environment. That would make for a good, enterprise-y tutorial here on the page too.
    6 points
  3. Thanks. I updated my post just before I saw this. Never realised that!
    1 point
  4. @Peter Knight That's because the opposite (index,follow) is assumed by default and you do not need the meta tags at all in this case. The module does only render them if you have checked at least one (noindex or nofollow).
    1 point
  5. You can also change settings via API: $tpl = $templates->get("location"); $tpl->noAppendTemplateFile = 1; $tpl->appendFile = ""; $tpl->save();
    1 point
  6. Either add $useMain = false; to your templates, and / or alter your site/config.php file: $config->appendTemplateFile = '';
    1 point
  7. $res = pages(1067)->files->sort("filename"); // or page()->files->sort("filename") btw: this syntax assumes you have enabled functions API in site/config.php: $config->useFunctionsAPI = true; otherwise you'd just use $page->files->sort("filename");
    1 point
  8. For some bizarre reason, one of the links was broken. Fixed.
    1 point
  9. Oh, yep. It is a left over from debugging. ? many thanks for testing and reporting back.
    1 point
  10. @Juergen I think that a hacker will easily find other ways to determine the underlying CMS by inspecting the markup or headers (or https://builtwith.com/). But I see your point ? For now, you can use a hook to disable the generator tag: $wire->addHookAfter('SeoMaestro::renderMetatags', function (HookEvent $event) { $tags = $event->arguments(0); $group = $event->arguments(1); if ($group === null) { unset($tags['meta_generator']); $event->return = $tags; } }); Feel free to open a feature request on GitHub. Cheers
    1 point
  11. @Juergen @Peter Knight There is a render() method for any "group", but in case of the robots it will only return something if at least one option (noIndex, noFollow) is checked. Your example to access the individual data is correct, you can also use the following syntax, which looks slightly nicer: $page->seo->robots->noIndex Cheers
    1 point
  12. Hi @Peter Knight, $page->seo->robots->render() should work fine, but it only outputs the tags if you have checked any of the noIndex or noFollow options. Cheers
    1 point
  13. Some previous threads and a module that may help you: https://processwire.com/talk/topic/6158-photography-galleries-best-solution Also, a better way to search the forums: https://cse.google.com/cse/publicurl?cx=014789015761400632609:fxrf0rj4wr4
    1 point
  14. Hi @horst, thank you for your fast implementation! Looks good on my end. However, I had to remove the creation of "hn_basic" (I think it's not intended to be there, is it?). Thank you and have a nice weekend ?
    1 point
  15. Thanks @LostKobrakai I will try both suggestions and see which one would be easier for me, fit better and most important, would be good to read. It might be a bit harder to turn the entire code to pure PHP due to the fact that there will be lots of html code to assign to $out and to align it, however I might not worry about it as I am planning to minify pages anyway. The more I touch HC, the more ways I see to use it where some user intervention is required but no manual file editing is a good idea. P.S. I tested @LostKobrakai suggestion and can confirm that it works 100% with escaping the PHP tag at the beginning and then adding the HTML code. In my scenario there would be lots of interactions with the HC parameters which would be a part of a few selectors so it would make more sense to have them in PHP. At least if anyone is looking for HTML and PHP mix inside a Hanna Code tags, they could use either approach.
    1 point
  16. You could try using a PHP hannacode with: ?> <html>test</html> <?php
    1 point
  17. If you set the HC to PHP, you would have to echo your HTML of course, or concatenate and then echo it. <?php $out .= '<div class="seo-block seo-interviews">'; $out .= "<h2>{$heading}</h2>"; $out .= '<ul>'; foreach( $interviews as $one ){ $out .= "<li> // ... </li>"; } $out .= '</ul>'; $out .= '</div>'; echo $out;
    1 point
  18. A terminal for running server commands: http://modules.processwire.com/modules/process-terminal/ https://github.com/adrianbj/ProcessTerminal NOTE: It does not support interactive commands like vi, nano, apt, etc. DO NOT attempt to use these as they may result in you needing to restart apache. This is a bash terminal that lets you quickly execute commands on a server. In addition to normal commands like: ls, cd, cat, mkdir, rm, chmod, chown, etc, you can also do mysql command line calls which is very handy if you need to add a new user, create a mysqldump etc. Note that for mysql commands you need to issue them individually - you can't simply start "mysql" and issue commands from there - each call needs to include your username and password and the command to be run, eg: mysql -u root -p mypassword -e "CREATE DATABASE newtablename"; There is also an upload and download command, eg "upload test.txt" which will spawn a file selector dialog on your machine to upload that file to your server with the given name. It also has arrow up and down for command history as well as tab autocompletion of commands and file names. This module was separated from Tracy because some shared hosts were flagging it as spam. This is because it uses system_exec to run server commands. This can certainly be dangerous, but in my opinion it is no more dangerous than the HannaCode module or the Tracy Console panel which both allow you to run system_exec. The key thing is that ProcessWire's htaccess rules prevent the shell.php file from being run directly and because this is a process module it uses PW's permissions to restrict usage to superusers.
    1 point
  19. If each FAQ item belongs to one treatment only, I would use a Repeater instead of a page reference, so that the questions and answers can be edited in one place, on the same page where you edit the treatment itself. The repeater field is bundled in the core, but isn't active by default (go to Modules -> Core to install it). In this case, you would create a Repeater field faq containing two text fields question and answer (for example). Then you can loop over the repeater items in your frontend template and display them: foreach ($page->faq as $faq_item) { echo "<details><summary>{$faq_item->question}</summary>{$faq_item->answer}</details>"; }
    1 point
  20. I'm so lazy ? That's why I created RockModuleCreator some time ago... I didn't want to copy files, rename them, rename the class, lookup icon names etc... Not a lot to say... Simply upload your skeleton to github or similar, add placeholder tags like `#author#` or `#date#` and create modules quickly and easily. I'm happy to accept PRs if anyone wants to take this further... https://github.com/BernhardBaumrock/RockModuleCreator Available skeletons: https://github.com/BernhardBaumrock/RockMigrationsDemo https://github.com/BernhardBaumrock/RockProcessHello
    1 point
  21. One more small, but pretty important tweak - it now properly removes the tabs at the top in the UiKit theme. Important so that users aren't confused by the useless "Attributes" tab option. I think I am pretty happy with it now that it is storing page IDs for local links, but I am curious if anyone else is still using this module? Is there something else out there that I might have missed that provides a nice interface for choose links to local pages and also has the option to paste in an external link?
    1 point
  22. A few more enhancements: It now handles local links with query string parameters - the stored link is still converted to a page ID with the query string appended. You can now also paste full http(s) links and if these are local links, they will be converted to a page ID and a local link will be returned when the value is requested.
    1 point
  23. Well, I am using this field for the first time and really wanted this functionality, so decided to fork the module here: https://github.com/adrianbj/processwire-fieldtype-assisted-url It doesn't look any different from the users perspective, but on save/sleep it stores the page ID instead of the url and then on wakeup it converts to ID back to the URL. This means that you can now move a page to a different parent, rename it, etc and the link URL will be automatically updated. It doesn't look like @wumbo is still active around here, so not sure if this will make it into the main version of the module, but it's there if others want it.
    1 point
  24. For more advanced uses (api or even json-api by specification) I'd recommend something like fractal.
    1 point
  25. Thanks Adrian! (And thanks for the ProtectedMode module, too.) I just used the config settings referenced in a couple of those threads: $config->pagefileSecure = true; $config->pagefileSecurePathPrefix = '-'; And made sure the "guest" permission was disabled for the templates that have image attachments. For some reason, it seems to have taken about an hour to propagate (some links were still showing up unauthenticated), but everything appears to be locked down now.
    1 point
  26. Usually this is a good and simple method: In a autoload module you hook into the processInput of InputfieldTextarea. public function init(){ $this->addHookAfter("InputfieldTextarea::processInput", $this, "validateText"); } public function validateText($event){ $field = $event->object; if($field->name == "body"){ $page = $this->modules->ProcessPageEdit->getPage(); $oldValue = $page->get("$field->name"); $newValue = $field->value; echo "old value: " . $oldValue; echo "new value: " . $newValue; if($newValue !== $oldValue){ $field->value = $oldValue; $field->error("Go away!"); } } } For a error message you simply add error("text") to the field. It will get showed after saving. What this examples also shows nicely is how to get the old value and new value. The code may slightly varies for different type of fields but the principle is always the same. There's also a method to hook into Pages::saveReady() but I'm not sure what the advanced really are atm.
    1 point
×
×
  • Create New...