-
Posts
127 -
Joined
-
Last visited
Everything posted by Harmen
-
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>"; }
-
Add an if statement for the field where the value of the field is blank.
-
I think you can do it this way: $pages = wire("pages"); $i=0; foreach ($pages as $page){ if $page->hasField("title"){ $i++; } } return $i;
-
Completely true. When I wrote that snippet I tried to continue on the code @OpenBayou provided in his post. Normally I use 'get'
-
Can't you find anything in the logs?
- 17 replies
-
- 1
-
- modules not showing
- pages not showing
-
(and 3 more)
Tagged with:
-
Maybe the troubleshoot helps... Special for upgrading from 2.x to 3.x
- 17 replies
-
- modules not showing
- pages not showing
-
(and 3 more)
Tagged with:
-
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"; }
-
Image field: check if first image is under a certain width
Harmen replied to OpenBayou's topic in API & Templates
Copy the code of @kixe in your template file with the correct fieldname and add your action to it. -
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
-
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
-
The 'Add new' button is for bookmarks, which you can see if you hover over the button.
-
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
-
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
-
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...
-
@eelkenet Thanks for the tip! And what do your recommend, hire a VPS of just personal/professional hosting?
- 15 replies
-
- webserver
- processwire
-
(and 1 more)
Tagged with:
-
Looks great!
- 1 reply
-
- 1
-
- website
- processwire
-
(and 1 more)
Tagged with:
-
@OllieMackJames Allright, I will rethink about this, maybe the price outweighs the trouble.
- 15 replies
-
- webserver
- processwire
-
(and 1 more)
Tagged with:
-
@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....
- 15 replies
-
- webserver
- processwire
-
(and 1 more)
Tagged with:
-
.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...
- 15 replies
-
- webserver
- processwire
-
(and 1 more)
Tagged with:
-
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
- 15 replies
-
- webserver
- processwire
-
(and 1 more)
Tagged with:
-
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
-
Great you found the error. Good luck with further preperations!
-
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?