Jump to content

Harmen

Members
  • Posts

    127
  • Joined

  • Last visited

Everything posted by Harmen

  1. This works for me: $languages = wire('languages'); foreach($languages as $language) { $selected = ''; // if this page isn't viewable (active) for the language, skip it if(!$page->viewable($language)) continue; // determine the "local" URL for this language $url = $page->localUrl($language); // if language is current user's language, make it selected if($user->language->id == $language->id) { $url = "#"; $selected = " class='current'"; } // output the option tag echo "<li$selected><a href='$url'><span>$language->title</span></a></li>"; }
  2. Add an if statement for the field where the value of the field is blank.
  3. I think you can do it this way: $pages = wire("pages"); $i=0; foreach ($pages as $page){ if $page->hasField("title"){ $i++; } } return $i;
  4. Completely true. When I wrote that snippet I tried to continue on the code @OpenBayou provided in his post. Normally I use 'get'
  5. If you have the 'Deals' page, you can with $page->children get the 'store' page. Then get the children of the store page and output the title: $store = $pages->find("parent=deals"); echo "$store->title"; $storechild = $store->children; foreach ($storechild as $child){ $content .= $child->title; // OR echo "$child->title"; }
  6. Copy the code of @kixe in your template file with the correct fieldname and add your action to it.
  7. As far as I know, the first two options are the most common. I'm not sure about the 3th option.
  8. Sure, read it too fast. I'm sorry. Make a field with an id on each page and assign each id to a user? and index that field. so 1-100 and user 1 has access to page with id1
  9. If that page has the same template for all 100 or more users, you can maybe give them access to pages with only that template. I guess that is the easiest way to go
  10. The 'Add new' button is for bookmarks, which you can see if you hover over the button.
  11. To create a page, click on your home page or another page in the tree and select 'New'. Then a new page will be added under the page you clicked. See my screenshot: https://gyazo.com/bb4676ebc6b6ae8ec1d47915808d77a0
  12. I think you need to do this with Javascript. You can get the date, and set it to a var orso and implement it in your code
  13. I think what @tpr says is right, I guess it could be super complex. I am also still a newbie in Processwire and don't know that much about programming as tpr, adrian etc etc I am always available if anyone needs some help. In a few weeks my internship is over and school starts again for me, hoping to have time left then for PW...
  14. @eelkenet Thanks for the tip! And what do your recommend, hire a VPS of just personal/professional hosting?
  15. @OllieMackJames Allright, I will rethink about this, maybe the price outweighs the trouble.
  16. @OllieMackJames, That is exactly what I don't want to do, hire a server. I rather build a dedicated server and install Processwire on that server. I wish I could connect my dedicated server to transip....
  17. .htaccess file changes with commenting a few things to commenting all things didn't help. I will contact transip, they support WP but not PW as far as I know. @owzim, will try that again...
  18. Hey Devs! Currently I am hosting my website at transip. But when I try to install Processwire I encounter a server error. I guess it has something to do with the .htaccess file. Does anyone know a decent webhosting company which doesn't cost that much and where I can install Processwire? Thanks in advance, Harmen
  19. Hi Adrian, No worries, it's ok. Good idea, functions are always good to use, less code easier to call. I understand not everyone wants the same. Maybe an inputfield with radio buttons at the module info to check if they want to export the grandchildren too can fix it. You're right. It would be a mess, even my grandchildren pages don't have the same name as the fields of the child pages while the fields have the same type. I will take a look at PHPExcel next week. If you need any help during the development of multiple languages - message me I will also search for a solution. Regards, Harmen
  20. Great you found the error. Good luck with further preperations!
  21. Well, it seems like you forgot to define that function or you made a syntax error or you called it wrong(_head file line 2). Maybe you can make a screenshot/gist/whatever of that function and where you want to use it and paste it here?
×
×
  • Create New...