Jump to content

Wanze

PW-Moderators
  • Posts

    1,116
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Wanze

  1. Here you go: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Functions.php#L855
  2. I used neo4j for two projects in my studies. One of them was to visualize the GitHub network with User/Repository nodes and their connections over edges like "follows", "stars", "contributes", "owns" etc. I do like neo4j and the cypher query syntax and it was the right choice for this project. However, for ProcessWire I don't see any advantage in using this database, simply because 99% of the apps written in Pw are fine with the tree. With page references you have endless power in modeling other relations than parent-child. For me, a graph database makes sense if you need queries like this: Shortest path between two nodes Get me all common nodes over at most 4 hubs Fire a query from a known start node and return an (unknown) amount of target nodes of type X over edges Y ... If the underlying data structure is a graph and I must answer those type of questions, I would not choose ProcessWire to handle the job. Another problem of neo4j is that it's not that fast, at least in my experience. And they recommend 16-32 GB RAM, this is simply too much for a "normal" web app Cheers
  3. @murat@pw I'm not sure if I fully understand your question. Languages are ProcessWire pages with a language template. This means, the "name" field identifies the language, it's a unique identifier. For example, you can't change the name of the default language (which is "default") because ProcessWire identifies the correct default language over this attribute. However, you can change the title of those languages: name | title ----------|--------- default | Türkçe ----------|--------- en | İngilizce If your title field is a multilanguage field, you can set the titles for both languages. For your flag images, you'd use the "name" property as image file name, e.g. default.png for turkish and en.png for english. Because the name is independent of the title and most likely won't change in the future. Does it make sense?
  4. <img width='32px' src='site/assets/images/".$language->title.".png' />"; The problem is that this path is relative. Use an absolute path (starting with a slash). ProcessWire provides the correct paths and urls for you over the config API variable: https://processwire.com/api/variables/config/ This should work: echo "<img width='32px' src='{$config->urls->assets}images/{$language->title}.png' />";
  5. You're welcome! Could you post your code how you output the images when the problem happens? Thanks.
  6. Hi Murat, You can change the markup where the language navigation is defined, it's here: https://github.com/ryancramerdesign/ProcessWire/blob/master/site-languages/templates/_main.php#L45 Your flag images should have the same filename as the language name in ProcessWire (e.g. default.gif, en.gif). Then output an image instead of the language title. Cheers
  7. Maybe you have mod_pagespeed installed on your webserver? I'm not familiar with it though, it's a guess because of the "pagespeed" string in your css filename.
  8. @chrizz You can set the permissions for files/folder required by your webserver in the config.php file. Most of the time, this is 644 for files and 755 for folders. Example: Some folders must be writeable for ProcessWire, therefore the system tries to change the permissions of those folders. In this case, the problem is (most likely) that your user executing the script on the webserver does not have write permission on a file/folder where ProcessWire tries to change the permissions. How did you upload the files to your staging environment? Maybe you need to set the correct permissions before uploading or correct the permissions on the server. Cheers
  9. I can also suggest you to use "regular" ProcessWire users. The advantages are that you have a fully role based access control system built in, login/logout functionality and all the security stuff you'd have to implement on your own. As Nico said, you can create custom roles and permissions. The only required permission is "page-view". To keep your users away from the admin area, you can write a hook that redirects them (e.g. based on a role/permission) to your frontend when they are trying to enter the backend.
  10. Does it make any difference in your frontend if you try this: $menu_pages = $settings->main_menu_pages->sort("sort");
  11. Hi lindquist, How is your selector to get the pages for the frontend? Do you order the pages by sort, e.g. add "sort=sort" in your selector.
  12. Hi pwFoo, Check the section "Do I want my hook to apply to all instances of a class, or just one?" here https://processwire.com/api/hooks/ It's possible to attach hooks to "single" objects.
  13. @tpr Maybe you want to check out my module: https://github.com/wanze/TemplateEngineFactory It works similair to your workflow, e.g. using the ProcessWire templates as controller. Advantages: It does all the setup for you and provides you an API variable to interact with the template engine. Latte is not supported at the moment, but it would be pretty easy to implement. Drop me a line if you'd need help with the implementation. *Advertisment mode off* Cheers
  14. Why not? WireArray offers way more possibilities for manipulating/filtering data, which is always nice to have.
  15. The bug is fixed with the latest commits, please upgrade the module. Thanks again for finding and posting this here
  16. Yep, the values of the array are still wire derived objects, so it should work.
  17. Yep. WireArray::import() des check if the value is already in the array, if so, it does not import it again. In your case, I guess the PageImage::toString() method returns the same filename, so ProcessWire assumes that it's the same image, although it's from a different page. What you could do is to add them to a normal PHP array and then use WireArray::setArray() to pass them (not tested): $productImages = new WireArray(); $temp = array(); foreach ($page->childern as $p) { $temp = array_merge($temp, $p->product_images->getArray()); } $productImages->setArray($temp); Cheers
  18. Hi guys, Thanks for reporting the problems. You're right, the problem is that if language support is not enabled, the langauges API variable is not available. I wasn't aware of that and of course only tested when language support was enabled. I'll push a fix this afternoon! Cheers
  19. Hi, Can you also check the error log in /site/assets/ and report any errors here? Also check if you get any javascript errors in the backend Cheers
  20. The ModuleJS::init() takes care of loading those scripts if they have the same name as your module, so you don't need to overwrite this method. Edit: If you need to append additional JS/CSS, call parent::init() first
  21. If you're not afraid of pirates, there's also the Table ProField: https://processwire.com/api/modules/profields/table/
  22. Thanks Martijn, I've updated this in the modules directory.
  23. Hi johannes and welcome! If you only need to store key-value pairs, ProcessWire often uses a simple textarea where each line corresponds to a key/value pair. In your code, you can get the keys/values by using PHP's explode function (newline as a delimiter). Another possibility would be to dynamically create a new input field when clicking a button, but this requires some javascript to work. I don't think that you can use an existing inputfield, but I might be wrong
  24. Did you check also other log files than ProcessWire? I think the log file of the webserver, most likely apache, would be interesting.
  25. Hi mr-fan You need to add enctype="multipart/form-data" to your form tag Is "user_img" the name of your file input? If so, then I guess $input->post->user_img would return null, since this key is inside PHP's global $_FILES variable (not in $_POST) Edit: LostKobrakai wins Do you ever sleep? Cheers
×
×
  • Create New...