• Content count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About Inxentas

  • Rank
    Jr. Member

Recent Profile Visitors

737 profile views
  1. I found this while looking around: Seems what I'm after is how to properly use the setImportData() method.
  2. When you edit your field, below Input you can find the Date Input Format. Normally you'd set that to Y-m-d or d-m-Y if you use it at all. However, when you set it to m-Y or Y-m then the day will not be saved in the field. Unfortunately, the picker itself won't change to reflect this behaviour. You also still have to click on the day to update the field itself. I'm not aware of methods to change the picker itself without changing it's code.
  3. I love the option to export fields via the CMS, and wondered about using that export data in a module. Basicly, I'd want to configure a field using the CMS and then paste it's export data in the module code as a string, or save it in a seperate file I can read from the module code. Once I have that string as a variable or file, I'd want to run the same code the import option does... but then from my module code's install method! Is that possible? It would save a lot of time configuring fields through the API.
  4. Thanks guys, but it turned out to be some configuration error on the hosting side (Allow/Override). All is well now!
  5. It's enabled, as far as I can see. I've asked my host to take a look at the issue as well. Since others report that with certain modifications they are able to see ProcessWires' default 404 page, I've asked them to check if .htaccess is ignored for some serverside reason.
  6. I've got several Processwire websites running on a local server and an external server. With one of them I have the migration issue where anything but the homepage serves a 404 error. I've read pretty much all topics about the problem but can't seem to find a solution that works. Now in my situation, I request a new virtual domain ( for each website, and set an A record on our own domain ( The end result: So far so good, but only the homepage works. Subpages and the admin URL generate a 404. Most of the topics I read revolved around changing .htaccess but I've got similar websites running on the same testing server without any modifications. Example: I've checked the .htaccess file line by line and even copied the one from working website into the non-working one, but to no avail. I tried upgrading PW but that didn't help either. Uploading and accessing a php file works, and mod_rewrite is on. Link to phpinfo() result. The document root in my FTP client is as follows: /data/www/ I've tried uncommenting and changing the RewriteBase lines, tried both the full path as just '/public_html/', but unlike others there doesn't seem to change anything for me. I get the same plain 404 every time. Any ideas on what else I can try? Apart from a fresh installation? EDIT: I've just did a fresh install of PW 3.0.72 on the virtual domain, and it seems to have the same problem, I can't load the admin url.
  7. As usual, it was a very simple method I didn't think of myself. Thanks a lot! I modified my selector like this: $selector = ''; if ($input->template) { $selector .= 'template=' . $input->template; } else { $selector .= 'template='.$templates->find("contentType=json"); $selector .= ",template!=data-json"; $selector .= ",children.count=0"; } if ($input->start) { $selector .= ',start=' . $input->start; } if ($input->limit) { $selector .= ',limit=' . $input->limit; } if ($input->sort) { $selector .= ',sort=' . $input->sort; } $foundPages = $pages->find($selector); First line does what I just asked: it filters the pages by their template's Content Type. Second line makes sure I exclude the current page's template itself. Third line ensures I grab only the "leaves" of the page tree, and none of the "branches".
  8. Hi there! I've got a question about selectors. I'd like to know if it's possible to use a selector to find pages based on the Content-Type of their specific template. I'd like to use a selector to find all pages that have a template with an "application/json" Content-Type, if such is possible. Here's the PHP code I'm using for the template that should output my data. The idea is that you can filter, sort and limit stuff using URL variables. Right now, "template" must be specified in the $input variable, or else the json output gets corrupted by the HTML (returned by the render() call on pages with a "text/html" Content Typed template). I only wish to grab the pages that have a "json/application" Content Type if the "template" input value is empty. <?php header('Content-Type: application/json'); $selector = ''; // TODO: start with Content Type filter if ($input->template) $selector .= ',template=' . $input->template; if ($input->start) $selector .= ',start=' . $input->start; if ($input->limit) $selector .= ',limit=' . $input->limit; if ($input->sort) $selector .= ',sort=' . $input->sort; $pages = $pages->find($selector); $n = count($pages); $output = '['; ?> <?php for ($i=0; $i<$n; $i++) : ?> <?php $output .= $pages[$i]->render(); ?> <?php if ($i < $n-1) { $output .= ','; } ?> <?php endfor; ?> <?php $output .= ']'; echo $output;
  9. Ah, thank you! That seems to be the last piece of the puzzle. The solution works for me as well.
  10. This is my template file bku-news-page.php: <?php namespace ProcessWire; ?> <!DOCTYPE html> <html> <?php include("inc/head.php"); ?> <body> <?php include("inc/bku-block-topbar.php"); ?> <?php include("inc/bku-block-menu.php"); ?> <?php include("inc/bku-block-newsitems.php"); ?> <?php include("inc/bku-block-footer.php"); ?> </body> </html> This is the relevant snippet of code from the include: <?php echo $this->_("Voor vragen of advies kunt u altijd contact met ons opnemen"); ?> Off course that sentence has been translated by selecting the specific include under Languages. It does not work, but when I do exactly the same using the template file itself, it works smoothly.
  11. I do not seem to be able to properly display translated text when the call to translate, using either __() or $this->_(), is put into an include. In my template file I have this statement: <?php include("inc/bku-block-footer.php"); ?> No matter what I do, the untranslated text is displayed in the frontend. I have tried several things already: Fiddled with $config->templateCompile = false in config.php as described here. Gave me additional options in the backend. None of these options seems to have any effect on the frontend. Fiddled with textdomains like described here. To no avail. Fiddled with template compilation in general, tried all options. No effects. Tried adding the ProcessWire namespace to my template file. Again, no effect on translations. It doesn't seem to matter, any call to the translation functions returns the untranslated, original value unless I place the call inside the template file. I must be missing something very obvious, anyone got an idea?
  12. Ok, so I have been reading up on how to "change the default language" in Processwire and most tips mentioned to change the Guest user's language to the one you'd want. Unfortunately, this does not work well for me. In fact, when I var_dump the contents of $user->name,$user->language->name I get different results depending on where I am in the site. I have set the language of user Guest to the new manually created language Dutch (nl). Not being logged in and visiting the root, results in the language name being default. Not being logged in and visiting another page, the results in the language name being nl. I am at a loss of why this happens but it's preventing me from setting the Guest users language to determine which language should be shown when not logged in, because the homepage ALWAYS reverts to the deault language which is NOT the one set for the Guest user. This is processwire 2.5.3. So... when my client asks me to change the default language of an already existing website, how do I do this without having to re-organise the whole language stuff? Imagine that this client can't make up his mind and wants to be able to change the language in which the site opens about every three months. Is this possible or am I doomed to go through the whole "upload Dutch language files into the Default language"-thing?