-
Posts
4,314 -
Joined
-
Last visited
-
Days Won
80
Everything posted by diogo
-
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}'>";
-
makes sense, although in a purely semantic logic i would say a page can't be sibling of itself, and for me it would make more sense to write $page->parent->children for that... even if longer.
-
I think that's the right way indeed. But I'm surprised that siblings return also the page itself...
-
Need Community: new Field Tags Module
diogo replied to Adam Kiss's topic in Module/Plugin Development
Adam, I'll be away from the computer for two days, starting in 2 minutes. Feel free to copy what you want from my code, use it on your module, and make the result the official one. When you finish it, feel also free (as administrator) to edit my thread and remove the file -
How to find all normal public pages — only those we'd want in sitemap.xml
diogo replied to alan's topic in General Support
There is a sitemap module http://processwire.com/talk/topic/799-module-xml-sitemap/ Doesn't solve the short-links part, but maybe you can figure also this from there. -
That's ok for me, the developer doesn't need pretty URLs
-
I need to make a change on a template while the pages are still being viewed by people. i created a new test page and a new test template and copied the template file and called it "test.php". on this file i added on top $page = $pages->get("name=original") and on header and footer, where i had things like if($page->template == "original") i had to change them to if($page->template == "original" || $page->template == "test") All works fine, of course, but i was thinking that maybe all this could be made easier with a module. Would be nice if, for instance, the system would recognize a specific URL parameter (site/page/super-secret-test-parameter), and look for the file "test_template.php" instead of "template.php". I don't have any idea of how to make a module like this that's why I'm posting it here.