Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. An ajax request needs an URL by nature, so for doing this you will have to have them available via URL. You can however throw a 404 if they are not requested via a post. if(!$input->post->secret) throw new Wire404Exception(); for this, you would have to use a method that sends some post info to the server via JS.
  2. Sorry pwired, I didn't get it that you wanted to replicate the demo website. As fmgujju said, but put the content of the css folder inside the /templates/styles/ and the content of the images folder inside /templates/styles/, then make the links to them dynamic, just like in the default home.php
  3. That index.html file is just for reference, not to use in your website. Build your PW site as you would normally and use these examples when you need them. The css and images folders, you can either have them in the templates folder, or put their contents in the /styles/ and /styles/images/ (although you won't need those images for sure), or whatever you do usually.
  4. There you have it, geeber and titanium just answered to the missing points. Building on top of that, your homepage code wouldn't be too different from this: <?php // header code foreach ($page->children() as $child) $child->render(); // footer code Couldn't get much simpler than this, could it? edit: titanium's method is perfectly fine, but if you're using the dev version you can use the method that Ryan describes here http://processwire.com/talk/topic/3551-small-tip-for-pages-that-will-be-used-with-render/
  5. And you have to change $page to the page you want. The example that I gave above would get the page by name, buy you can get it by ID also $pages->get(1654) besides other ways using the different selectors. The only info that I have from you about that page is the template. Assuming that that's the only page using that template, this should work for you: <?php foreach($pages->get("template=bands")->band_performance->find("limit=5") as $band_performances) { edit: get() returns the first page found that matches the selectors, while find() returns an array (pageArray) with all matches for the selectors.
  6. I don't want to alarm you, but suddenly you turned into Mr. Bean! Have a look in the mirror.
  7. You convinced me. I will buy lots of those edit: you also convinced me with Massive Attack. Listening to Heligoland right now!
  8. Hi Jeff, welcome to PW! No need for ajax, you can do it like this on your home template: $featured = $pages->get("/repeaters/page/")->repeater->find("limit=5");
  9. Good one! I hope I will be using this website soon I found a small mistake on the content, maybe you can tell them to correct. On the upcoming festivals in Portugal, on the 8th of June, it's written "Serralvas em Festa" where it should be "Serralves em Festa". It's a great arts festival by the way, in case someone is planning to choose a destination for around that time
  10. Willy, that still limits the field options, no?
  11. An important aspect that wasn't mentioned yet is security. PW handles a lot of it by default, and gives you tools like sanitation to make it easy for you to handle it also.
  12. I seem to recall that someone mentioned a plugin for that lets you prepare a set of classes in a select that people can assign to parts of text, but I'm on mobile and can't look for it I seem to recall that someone mentioned a plugin that lets you prepare a set of classes in a select that people can assign to parts of text, but I'm on mobile and can't look for it
  13. 320 x 480, but I'm looking at it in a big screen now and i still feel that the header needs some breathing space in general. Some padding should solve I guess.
  14. Works well on mobile, I only had a little trouble with the clicking area on the navigation links. on small screens they are a bit to close from each other and from the title and the search. Please excuse Dr Spock, sometimes he is not very clear here in the forum
  15. In this case you can write simply echo $callout->title. Just for reference, it would also work if you would change the ' by " because ' ignores variables and " doesn't. But as I said, here you can just drop the ' and {}
  16. diogo

    Website localization

    Maybe this is good for translating the PW admin.
  17. You could also create a multiple page field and choose callouts page as parent. users can select them and drag them around to position.
  18. diogo

    I'm so stuck :(

    Pete, now that I was getting used to the thing on your neck...
  19. The dot concatenates the strings from left and right of the operator: $string = "Team"; // "Team" $string .= " Building"; // "Team Building" $string .= " Exercise"; // "Team Building Exercise" $string .= " '99"; // "Team Building Exercise '99" So, in your code you have to use the dot, except on the first $out assuming that the variable is empty. If the $out comes from previous code and is already populated, then you should keep also that dot.
  20. Yes, you can exclude templates by filtering them on the find method $results = $pages->find("title/body*=$query, template!=unwanted|rejected|nothingtosee"); or by limiting to a few templates $results = $pages->find("title/body*=$query, template=goodone|interesting|lookhere"); edit: Oh, sorry, you mean in the admin. The search can be easily filtered by the search tools that appear on the side. If tht's not enough, maybe you can limit the access to some roles on the template's "access" tab, or build a custom search process.
  21. The problem I see is that repeaters don't seem to support field dependencies yet, but the search part doesn't seem difficult to me: $pages->find('repeater.radio.name=text, repeater.text*=$query') I think you don't even need the first part, but I put it there just for reference
  22. Thinking of it now, it doesn't seem that difficult to do this with PW. Instead of thinking of different templates on each repeater we can just have a repeater with a field or more for each kind of content. If those fields are filed the code knows what to do with them: foreach($page->repeater as $r) { if($r->image->url) { // image block; } elseif ($r->text) { // text block; } } May sound confusing to have many fields on a repeater block and tell the client to fill only one or two, but now we have http://processwire.com/talk/topic/4323-field-dependencies/, so we just have to put a radio button with all our "templates" at the beggining and show the related field groups accordingly. This will make our guessing work even easier: foreach($page->repeater as $r) { switch ($r->radio->name) { case "image": // image block case "text": // text block case "quote": // quote block } }
×
×
  • Create New...