-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
What Ryan means is that it has to be in the code before anything is echoed, you can always store things in variables and echo them later in the code
-
You can do it on the template with $array->shift() echo $array->shift()->title; foreach($array->find("sort=date") as $item) echo $item->title; edit: Or, if you want the complete array: $first = $array->shift(); $final = $array->find("sort=date")->prepend($first);
-
Just in case, I also already reserved my name
-
Or, iterate over all images: foreach($page->my_repeater-area as $building) { echo "<p>{$building->building_description}</p>"; echo "<p>{$building->building_text}</p>"; foreach($building->building_image as $img) { echo "<img src='{$img->url}' alt='{$img->description}' />"; } }
-
Great! I will test this as soon as I can. This would have been so useful to me some months ago...
-
Page hierarchy / template strategy for genealogical info?
diogo replied to MarcC's topic in General Support
Today I stumbled on this (css3 only) family tree http://thecodeplayer.com/walkthrough/css3-family-tree. It still doesn't support marriages, but the creator says he is working on it. I don't know if this can be useful to you, but it's a nice curiosity -
Thanks Soma! Edited the post so it doesn't contain wrong information. I'm glad you are sure I know it, but actually, as I'm really new to PHP (or any programming language, by the way), those things are not that present in my mind...
-
Welcome to the forum Ben! You have to iterate over the repeater, and output each field: foreach($page->my_repeater-area as $building) { echo "<p>{$building->building_description}</p>"; echo "<img src='{$building->building_image->url}' alt='{$building->building_image->description}' />"; echo "<p>{$building->building_text}</p>"; }
-
I'm having the same problem with a new website. I moved PW from my testing server to a subdirectory of the new server because i don't want to replace the old site for now. It shows the homepage, but when I press the links, I get a 404 from the server. I asked the server if mod-rewrite is on, and they told me to add "RewriteEngine On" to my htaccess file... not helpful at all... I added some random characters inside "<IfModule mod_rewrite.c>" on PWs htaccess, and it does throw a 500 error. Another thing I just did: I moved PW files to the root and put the old site files on a folder (thre wasn't any htaccess file on the root). PW shows me the homepage, but when I go to subpages, instead of a 404 I get a 500 (??)... back to the subfolder, I get the 404 again. EDIT: I solved this issue by uncommenting this line on the .htaccess: # RewriteBase / (on the subfolder I added RewriteBase /subfoldername/)
-
TinyMCE: Color picker suggesting colors from other pages/fields?
diogo replied to Lars282's topic in General Support
-
solved next/prev links based on field value
diogo replied to Marty Walker's topic in General Support
this happens because 0 is less than today. You have to test also for it's existence. "less than today AND more than 0" for example. -
Module Profile Export module (also upgrade PW 2.0 to 2.1)
diogo replied to ryan's topic in Modules/Plugins
The Exporter doesn't seem to work when using Multi-site setup. The module keeps asking me to create the /site/install/ directory, but I can't do that because I'm using a /site-domain/ directory instead of the regular /site/. -
That's what I thought... already commented on this, in English of course
-
I stumbled upon this article and read it with google translation. The article is very nice at PW, but it appear to have some imprecisions. http://web-developer...source-cms.html
-
Soma, it's completely different... if you have 2 pages, one with 100 images and the other with only one, with that method we would get the sole image of the second page 50% of the times... I think what onjegolders wants, it's to have all pictures to be in equal circumstances.
-
Have a look here http://processwire.com/talk/topic/868-array-merge-leaves-empty-array-whats-wrong/page__hl__%2Bmerge+%2Barrays I think you will find your answer there (sorry for the short answer, I'm in a hurry)
-
This looks interesting for a FieldType http://filepicker.io/
-
Javascript shouldn't work differently in Processwire. Check if you are including jQuery or if you have the #slider element on your template.
-
Investor area, best way to layout permission-only pages
diogo replied to onjegolders's topic in General Support
You can output a completely different page only by checking the url segment edit: if it confuses you to have all the code on one file you can do it with includes: if($input->urlSegment1 == 'photos') { include 'photos.inc'; } else if($input->urlSegment1 == 'rates') { include 'rates.inc'; } else if($input->urlSegment1) { // unknown URL segment, send a 404 throw new Wire404Exception(); } else { // output default } -
You can do what you want like this: echo '<title>' . ($input->urlSegment2 ? $input->urlSegment2 : $page->title) . '</title>';
-
Investor area, best way to layout permission-only pages
diogo replied to onjegolders's topic in General Support
You can use a URL segments. I don't have much time now, but maybe you can understand what I mean from this small code: $detail = $input->urlSegment1; echo "The content of {$detail} is: {$page->$detail}."; -
Investor area, best way to layout permission-only pages
diogo replied to onjegolders's topic in General Support
You can put a page field in the properties template and select the page "users" as the parent of selectable pages. Then, you call the user for each property, from the property page, like this: foreach($page->pagefield as $myuser){ echo $myuser->name; } and to all properties from a user: $theuser = $pages->get("user selector"); $properties = $pages->find("template=property, pagefield=$theuser"); (both not tested) edit: I didn't take this in consideration in my answer, but there must be a way of constraining the selectable pages to this. edit2: Ok, besides limiting the field by parent, you can place on the field's "Custom PHP code to find selectable pages", this snippet of code: $investor = $pages->get("name=investor"); return $pages->find("roles=$investor"); This will limit the selection to users with the role "investor" edit: I changed the variable $user to $myuser where I was using it, so it won't override the existing $user from the API -
Investor area, best way to layout permission-only pages
diogo replied to onjegolders's topic in General Support
Have you seen the Page FieldType already? This is what Ryan is talking about http://processwire.com/videos/page-fieldtype/ -
I like it very much! There are some images with low definition being presented in big (ex: "Bitter Herb", "Tea Bag") I think you can solve it like this: if($image->width > 500) $image = $image->width(500); echo "<img src='{$image->url}' alt='{$image->description}'>";