Jump to content

elabx

Members
  • Posts

    1,246
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by elabx

  1. Could you show us a little bit more of code? I'm having a hard time understanding how the site is rendering.
  2. If you have the required language modules installed, you just change the field type of the seo fields, look for field seo_title, and see that you can change it to other types of fields, in this case, you want Text multilanguage for seo_title, it should show up after the multilanguage modules are setup.
  3. Watch out if maybe ProCache was expected to be working, because it compiles Less to CSS. Happy ProcessWiring!
  4. Routing on the server like you would normally do with files/folders, is not how processwire works. ProcessWire hijacks the routing as soon as any requests hits the server and the path where PW is installed, so those wire/site folders are not publicly accessible. You need to access the admin, and figure out which pages are setup in the page tree, which mainly handles the routing of the site. I insist on reading the docs above so you get a good idea on how PW works, its very simple once you dive in a little bit.
  5. Ok, so you need to start from there ? Those files are used to handle the rendering of the website but they can be used in multiple ways. You would need to figure out the output strategy of the site. Do you have access to the admin? site.com/processwire? Take a look at these: https://processwire.com/docs/tutorials/ https://processwire.com/docs/tutorials/how-to-structure-your-template-files/ https://www.smashingmagazine.com/2016/07/the-aesthetic-of-non-opinionated-content-management-a-beginners-guide-to-processwire/
  6. Is there any file in the followint path: /site/templates ? (path starting from root of web server). That's where the template files exist.
  7. Both are possible: https://processwire.com/blog/posts/field-permissions-overrides-and-more-2.6.2/ Sorry to not bring more info right now, don't really know how to set it through the API, but surely there is a way.
  8. Can confirm Migrations works wonderful and the CLI too, I commonly migrate changes to 30+ sites that share the same functionality, using git + migrations CLI.
  9. I think that button is added through javascript so you might as well just add it in a script that runs in the admin, like this: http://soma.urlich.ch/posts/custom-js-in-processwire-admin/
  10. Apparently from what I find in the searches, it's just not going to work with text fields:
  11. I did fix the issue but I did needed to modify apache configurations, but it is hard to tell if this is the case in your scenario and I'm guessing not being able to use ini_set() is not making things easier. I could only think of testing in another environment to see if you can reproduce and log.
  12. Ohh! And just read it's a custom field! I was assuming a date field and I do wonder, why not use the default date field for this? I think the selector might not be working because it's not getting saved as a timestamp.
  13. Doesn't using the "=" operator work? Why use "~="? Maybe I'm not catching something.
  14. You are getting into a looping issue because you are hooking into every page saved. I also think you have to hook into Pages which then has the need info in its arguments. wire()->addHookAfter('Pages::saved', function($event) { $page = $event->arguments(0); if($page->template == "user"){ $savedUser = $page; $userpage = wire('pages')->find("parent=Abos, name=".$savedUser->name); if ( count($userpage) == 0 ) { $page = new Page(); $page->template = 'Abos'; $page->parent = wire('pages')->get('/Abos'); $page->title = $savedUser->name; $page->save(); } } });
  15. The times this has happened to me and no errors were obvious, it was mod_security from Apache messing up with the POSTs from edit page.
  16. For example, I have a Galleries repeater field (or repeater matrix), named galleries and I want to render galleries within a text field. Each repeater has an images and title field. Let's say you fill one repeater item's title field with "Party gallery". Then, I have a hannah code that has a title attribute available and is used in the text fields like the following: [[gallery title="Party gallery"]] Then, in the hannah code's code (?), I do a selection like this one: $gallery = $pages->get("galleries.title=$title"); That way the $gallery variable will hold the gallery referenced by the title, which can be picked from setting the hannah code attribute making it very flexible cause then you can have all sort of settings and just pick whatever gallery you want. The pain point for the users is usually going to find out galleries titles, but most users have found it to be quite flexible. Maybe a custom CKEditor toolbar dropdown would complement this approach even better, filling it with gallery names available. Check this awesome module from @Robin S .
  17. I have sometimes used a combination of repeater matrix with a "identifier field" that is later used as an attribute in a hannah code.
  18. Something I've done that is quite useful is setup a Less parsing library like this one that accepts variables and then I pass the variables on to the rendering pipeline, this keeps my styles files clean from php code: Pardon the dirty code: <?php $variables = array( 'main-color' => $home->main_color , 'body-background' => $home->color_main_background, 'icon-colors' => $home->color_icons, 'menu-icon-color' => $home->color_menu, 'footer-gradient' => $home->color_footer_gradient, 'go-top-gradient' => $home->color_got_top_gradient, 'slide-background-color'=> $home->color_slides_background, 'slide-hover-background-color'=> $home->color_slides_hover_background, 'h2-titles-color'=> $home->color_h2, 'headings-font'=> $home->headings_font, 'footer-background' => $home->color_footer_background ); //Set up main file path and directory of imports. $less_files = array( $mainCssFile => $config->paths->templates . 'css/' ); $options = array( 'cache_dir' => $config->paths->assets . 'cache/less/', 'output' => $config->paths->templates. 'css/build.css', 'relativeUrls' => false, "strictMath" => "on"); try{ $css_file_name = Less_Cache::Get( $less_files, $options, $variables); }catch(Exception $e){ $log->save("less", $e); } ?>
  19. As for making the field required, from what I can tell from the source code you need to set the field in the user template as required so it is also required in the registration form. (but I also see that it checks if the field is InputfieldText) I guess you could also make an after hook in the buildForm method, and traverse the form to set the field you want as required, try placing this in site/ready.php and let me know if it worked: $this->addHookAfter('LoginRegister::buildRegisterForm', function($event) { $form = $event->return; $field = $form->get('the_unique_text_field_name'); $field->attr('required','required'); $event->return = $form; });
  20. Maybe using the Fieldtype selector in the module autoload setting?? Though I guess that limits the compatibility minimum version. type=FieldtypeInteger|FiledtypeDecimal
  21. Thanks for the heads up!I haven't tried locally but will soon.
  22. No issues for the moment, except can't get autocompletion to work :D. And yes @bernhard, it is a ProcessWire website with the wire folder and all but I'm guessing it might be the context in which i'm editing (SSH FS) and I'm actually loading as root a public_html with a lot of websites underneath it.
  23. Hi! Is there any configuration to get Intelephense autocompletion to work?? Or does it just need to bee installed and that's it?? Sorry, tried to figure out from the thread but just couldn't ?
×
×
  • Create New...