Jump to content

Hurme

Members
  • Posts

    89
  • Joined

  • Last visited

Everything posted by Hurme

  1. So I spend couple of hours trying to find a solution for a problem that must be pretty common, but didn't find any simple solution. I'm building a search for a website and I need to find pages from certain templates, and in one of these templates that selector must include hidden pages. Something like "template=x|y|z OR (template=a, include=hidden), (title|body~=$searchquery)". Is there any way to combine all this in one selector?
  2. Ryan, Instead of an image, have you considered using a short video clip / gif that shows the backend in action?
  3. Hi, I solved the issue by making using the tags option in the files field and by disabling the multi language description altogether. I had read about the language-alternate fields, but had forgotten about them by the time I was doing this site. So cheers for the reminder. ? I still think the file fields description is behaving in a not so logical way. Luckily it's a problem you can easily get around in multiple ways.
  4. Hi, I was making a multi language site with download section that would automatically list files based on language. I was going to check if $file->description had any content on current language, but this does not work as it always returns the default language even when different language is selected. Example: Site has three languages, english (default), french and german. document_en.pdf | en desc "lorem ipsum" | fr desc "" | de desc "" document_fr.pdf | en desc "" | fr desc "lorem ipsum" | de desc "" document_de.pdf | en desc "" | fr desc "" | de desc "lorem ipsum" It would iterate through all of these and only return the documents that had description in current language. Problem is it will always return document_en.pdf no matter which language is selected. For french and german it correctly only shows them according to the language. Currently using PW version 3.0.95.
  5. Hi, Thanks for the answer! I'll try this later this week, once I continue working on the site. I do have ProFields and I understand what you mean. It might very well be worth doing it like you suggested.
  6. I've added language support to a website. Language switching works and fields that have content in the second language show up correctly. But none of the translated strings work. As I've understood, the most simple way to add translated string is: <?php echo __('This will be translated'); ?> When I go to the second language in backend, it correctly finds this string in the file it was used, and I can write the translation below it. How ever in frontend nothing ever happens, and the website always shows "This will be translated" instead of the translation itself. Also a curious note, backend will find translated strings from template files, but if I add string to a file starting with underscore, _main.php for an example, it's unable to find those translations even when I write the file path manually. Am I missing something here? Where could I start looking for answers? I've read through the language docs and browsing old topics, but I haven't been able to solve this problem on my own.
  7. Eventually I'll look into it if no one gets to it first. I considered it at some point, but I've been too busy with more important things. I'm not really a programmer but I took a look at the interceptor earlier and it seems doable for me to modify the code enough to get it to work. ;-)
  8. Nothing fancy, just solid basic sites for two different companies. Both happen to work mainly in construction sector. Both sites are only in finnish, but feel free to browse around. After a decade of Joomla I'm quite taken with Processwire, although having no background in any sort of programming the dive into PHP felt akin to jumping from 10 and landing on your stomach. ;-) Site 1: http://www.lahdenrakennusurakointi.fi/ site 2: http://www.peltityo.com/ If the sites look somewhat similar, it's on purpose. Some structural pieces are being recycled to make work more efficient. Aside from Processwire we started using UIKIT and it's been a pleasant experience. Although I'd love to have automated way of using UIKIT lightbox for images added with CK editor.
  9. Well, in our case all the settings were all correct. We solved the problem by switching to an another web host, and it started working right away. Was the problem because of poor work on facebook's end or the host's is anybody's guess.
  10. Hi, I'm running into this error: AutoFbPost: post failed; click here to log in with Facebook. I'm already logged in with facebook, and if I click the provided link I get: Can't load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and sub-domains of your app to the App Domains field in your app settings. How ever we're using the login-facebook module with same settings, which is working just fine. Are we supposed to manually add the Open Graph meta information for this module to work? Anything else that could be wrong?
  11. I'm having hard time getting this to work. I've setup the module with App ID and App Secret. The needed script is added in the _main.php. The App itself is public and both the Site URL and App Domain match. Yet all I get upon entering the "mysite.com/login-facebook" is: I've setup multiple Facebook Apps before, but I've never run into this problem before. Does anyone have any experience with this?
  12. I would, but this is used mostly for news feed with text and other stuff too so I need to get more than the images.
  13. Everything is working again. Nothing to do with PW version. It was all down to the children with no images after all. After doing better job with checking if the images exist it started working. if (count($child->images)) { // Original code here } Interesting that the width() crashed PHP but without it everything worked fine. Anyway, I'm little bit wiser now. Thank you for your help everyone, and sorry if you had a spend a lot of time mulling over this.
  14. Thanks rafaoski, Maybe it's down to the PW version then. Mine is 3.0.88, I'll update it when I have a moment and report what happens.
  15. In the real deal it does get tested, in this stripped down version I'm just trying to find out how to get the width to work.
  16. Hi guys, I didn't try rafaoski's code yet, but I did try everything else you suggested. It all runs into the same error. Below is a stripped down version of the function I'm using for claritys sake. function test($selectTemplate) { $pages = wire('pages'); $children = $pages->find("parent.template={$selectTemplate}, include=all, limit=3"); $out = ''; foreach($children as $child) { $image = $child->images->first; $out .= '<img src="'.$image->width(50)->url.'">'; } return $out; } It works if I remove the "width(50)" part. I've also tried putting the width in different places, as suggested.
  17. Hi DaveP, I also tried this, but got the same result. Any time I used width php runs into a wall.
  18. Hi, I'm exploring exciting new things (for me) like functions and being the newbie that I am, I'm running into some problems with images. I've gotten far enough that I know I need to add: $pages = wire('pages'); To use $pages inside a function. Now I'm wondering if something similar needs to be done to make $image->width work as well. I have foreach that loops through some pages as $child. This works fine as does everything else except for the images. The important part is. $image = $child->images->first; $out .= '<img src="'.$image->url->width(500).'">'; What I get is: "Fatal error: Call to a member function width() on boolean" + the line number + file name and all the other usual jazz. If I remove the width(500) it works fine. It also works with the width(500) if I use it outside of the function. What to do 'o wise ones?
  19. Thanks guys. I'm abroad for one week so I can't test your suggestions until I get back, but I it looks like my problem is solved.
  20. Hi, Is it possible to force child pages (of a specific page) to use a specific template, or at least to set specific template as default? In this case it's a matter of news pages, probably the only kind of pages the client will have to create by themselves and I'd like to make sure the process is as easy as possible. I'm coming from Joomla, and although it has a lot going for it, I'm especially taken by how intuitive Processwire is to use from clients point of view. There are no ten hoops you have to jump through when you want to do something (assuming the developer did things right). It's like magic!
  21. This topic can be marked as solved. The problem was simply me having wrong idea about how Get works. Thanks Adrian and Zeka.
  22. Hi, Alas these pages need to be hidden from find, but if get can only retrieve one page at a time, then that would explain why this isn't going anywhere. I'm guessing that they need to be put under a hidden parent and made visible themselves then?
  23. Hi, I've been building my first Processwire page and everything has gone alright until I needed to call fields from some child-pages. <?php foreach($pages->get("template=files") as $stuff) : ?> <?php print_r($stuff); ?> <?php endforeach; ?> I'm using this just to test if things are working. I have 3 pages using "files" template, but this code only returns the first one I made. Changing the order of the pages does not affect this. I'd rather not delete the first page to test if it affects anything, as it has a lot of content already. I'm sure I'm overlooking something really elementary here. I'm fairly experienced at building websites, but unfortunately not that experienced with PHP.
×
×
  • Create New...