Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. Sorry, I should have guessed that this was the output I expected... ---- The code is perfectly correct. I created a my_images field with the cropImage type, and pasted your code on my template. Here is the result: In your case the problem must be on the field itself. Can you post here a screenshot of how the field looks like on the fields setup and on the page edit? Or just recreate the field, and redo all the steps, if you prefer.
  2. You could use page segments to do this. You will have to activate them for the gallery-page template, on the URLS tab of the template setup. Well use the number of the position of the image in the field. It seems to me that it's the best way to ensure it's uniqueness. On the template file do something like this: if ($input->urlSegment1) { $index = (int) $input->urlSegment1; // use (int) to sanitize, since we want a number $image = $page->imagesField->index($index); // get the image in the correspondent position echo "<img src='{$image->url}'/>; }else{ ...rest of the code... } on the normal code of the template you can put on the thumbs: $i = 0; foreach($page->imagesField as $image){ <a href="{$page->url}{$i}"><img src='$image->width(100)->url'/></a>; $i++; } This will give us, for each thumbnail, a link like "photos/holiday-2012/n" PS: Gazley, just read your answer before posting mine. I don't think it's that simple as you say, so, here it goes But I might be wrong...
  3. The links break when you move a page, so, I guess it's not dynamic at all. Have a look at the readme.txt of PageLinkAbstractor, it might give you some clues https://github.com/ryancramerdesign/PW2-PageLinkAbstractor
  4. I did a test with chrome tools, and it tells me that you have scripts and css inside the <body> I'm sure that this isn't the main problem, but it might influence the rendering speed. I would move them to the <head>
  5. You're welcome! By the way, the PageLinkAbstractor module prevents the links to be broken when you move your pages around.
  6. You can do it in tinyMCE. Just add a link normally, and choose the option "link to page" on the dialog
  7. Thanks for clarifying Ryan, I will edit my post to point to these corrections.
  8. $area_alias = $sanitizer->text($input->get->area); $area_page = $pages->get("alias=$area_alias"); $matches = $pages->find("title|body|sidebar*=$q, parent=/catalogo/produtos/, arealimit=50, id!=1, area=$area_page"); I think this is what you want, but I'm not sure. Tell me if I misunderstood everything. EDIT: See Ryan's corrections to my code some posts below
  9. It isn't outputting anything... can you try what I said on the post above? echo "<br>{$page->title}<br>{$page->template}<br>"; I also noticed that on your code, there is a problem with the tags sequence: You have <div><a><img/></div></a>, and should be <div><a><img/></a></div>
  10. This was just for testing if you can reach the field at all. Apparently not. Can you replace it for this, and see if there is any output? echo "<br>{$page->title}<br>{$page->template}<br>"; This should output the title and the name of the template of the page. ---- To post the html output, go to "view source" on your browser, and look for the piece of code from the gallery. Maybe you should even deactivate the javascript plugin before, so we are sure that the html is correct (just unlink it on the head of the html).
  11. Can you post here the html output? Edit: I had a small typo on my code, but I don't think that was the problem. I copied your code on my testing PW install, and I get the images on the page. Tell me if you get any output if you put this right after <?php echo $page->my_images;
  12. Not sure if I get it. Can you put here an example of how you want the table to look like?
  13. what if you use repeaters for the links, instead of a text field? Then you can do this: $pages->find("articleImageFiles.count|articleImageLinks.count>0);
  14. Well... you can also keep the nav always visible with some js.
  15. I tend to design with code, and in PW, is actually very easy to organize the content because of the tree approach. I usually do a rough draft with Inkscape as a starting point. When I work with another designer, I usually get just a PDF from her. I actually prefer it like this, because there isn't much point on designing everything by the pixel these days
  16. If your concern is mainly the prices, you could put something like "Have a look at our prices" linking to that part. Would be even more effective.
  17. see my edit to the other response
  18. About the website: I like it, but I wonder if the navigation is really necessary... The site works very well only by scrolling, and the navigation can give people the feeling that there is something more than this page, and make them scroll up to press the links only to find out that they have already seen everything. edit: I noticed that you removed the navigation on smaller screens. Works great Maybe you could replace it on bigger screens by a sentence... like a slogan, or so... or by something immediately useful, like the written address.
  19. oh, that "r" makes all the difference, also in how you pronounce both words. I don't think a German speaking person would make that connection.
  20. Ok, so now, Go to setup>fields, and create a new field with type "images", give whatever name you want, let's say "my_images". Go to setup>templates, choose your index template, and add this new field to it. Open your index page on the pages tree, and populate the images field with some images. On the index.php, go to the code of the galery, you must have something like this (I'm assuming that you have prettyPhoto already working): <!-- taken from the prettyPhoto site --> <a href="images/fullscreen/1.jpg" rel="prettyPhoto[pp_gal]" title="You can add caption to pictures."><img src="images/thumbnails/t_1.jpg" width="60" height="60" alt="Red round shape" /></a> <a href="images/fullscreen/2.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" /></a> <a href="images/fullscreen/3.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_3.jpg" width="60" height="60" alt="Fire!" /></a> <a href="images/fullscreen/4.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_4.jpg" width="60" height="60" alt="Rock climbing" /></a> <a href="images/fullscreen/5.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_5.jpg" width="60" height="60" alt="Fly kite, fly!" /></a> replace all those images by this: <?php foreach($page->my_images as $image){ echo "<a href='{$image->url}' rel='prettyPhoto[pp_gal]'><img src='{$image->width(60)->url}' width='60' alt='{$image->description}' /></a>"; } ?> In the previous example, the thumbnails will be miniatures of the pictures with 60px width and variable height. If this is not what you want, follow along: Install Apeisa's Thumbnails module http://modules.proce...ype-crop-image/ (or even better! install Soma's amazing "Modules Manager" http://modules.proce...odules-manager/ and from there install the Thumbnails module). Go to setup>fields, choose the newly created my_images field and change its Type to "Cropimage". Go to the "INPUT" tab on the same page, and on "Thumbnail Settings" (bottom), change from "thumbnail,100,100" to "thumbnail,60,60" (or whatever you want). Open your index page on the pages tree, and now you will have a thumbnail option for each of the images you uploaded before. Crop your images as you wish. On the index.php file change the previous code to this: <?php foreach($page->my_images as $image){ echo "<a href='{$image->url}' rel='prettyPhoto[pp_gal]'><img src='{$image->getThumb('thumbnail')}' width='60' height='60' alt='{$image->description}' /></a>"; } ?> Et voilà, that should work edit: changes from this "60" to this '60' on the last snippet
  21. You have this index template working on the homepage already? When you open your website, you see the content of your html?
  22. Have a look at this thread http://processwire.com/talk/topic/490-how-to-reset-your-password-how-to-enable-the-forgot-password-function/page__hl__%2Bforgot+%2Bpassword
  23. On the selector the category must be a page. So be sure that you get the page of the chosen category like this $cat = $pages->get("parent=/category/, title=chosen"); Then you can do your search like this: $result = $pages->find("parent=/articles/, body*=$query, categories=$cat");
×
×
  • Create New...