Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. Not a nice answer... I also don't like that some CMS's have an over complicated landing page, but I don't think that this will turn PW in one of those.
  2. Welcome to forum Jeff! You certainly could do this, and I don't see any inconvenient besides loosing the possibility of using the language feature itself. I think I would prefer to create special mobile fields for each field that needs a different content instead, but I understand that your plan can be more practical. Maybe it would make sense to create a new module, based on the language module, to create this functionality without interfering with languages.
  3. Ok, i did it I put a repeater inside itself just to see what would happen, and the result is not pretty. As soon as you create a page with it, it creates a big number of repeater pages and breaks the system. It would be better if PW would just disallow this.
  4. Ok, so lets wait for Ryan to see this edit: I only saw this answer now. Ya, must be a bug.
  5. can you create a new template with this repeater field to see it it works there?
  6. Definitely not what I thought. You are outputting them correctly, but I can't reproduce your error with the same code in my testing environment. Are you using last version of PW?
  7. can you paste the code your using to call the fields? sounds like you are calling the hidden repeater field pages directly instead of the fields themtself.
  8. Hm, it's true... it doesn't. There is a browser extension that does. I use it on gmail also and it's good: http://www.afterthedeadline.com/ it disables formatting while checking, but it's recovered when the spellchecking is finished edit: apparently there's even a version for tinymce! http://www.afterthed...latform=TinyMCE
  9. don't all the browsers have spellchecking now?
  10. The toSlug function that I used in the other thread came from a google search... I don't remember from where exactly. It's still that one that is being used, right? It would definitely be better to use the same method that is used by PW. edit: Have to go to bed, this dawn I will fly to the land of the Umlauts and Eszetts
  11. Not yet, but I suggest that you start a new thread specifically for this module in the Modules section of the forum. Since Ryan liked your post we can be confident that it will get listed once it's finished edit: on the modules section, maybe you could attach the module file to the post to make it easier to install
  12. Good work! Again, I like the site and the artist's work two things I would change: I would definitely remove the links from the separator thumbnails "other styles"/"visuals&storyboards"/etc... I would, somehow, give a clue that the SHOP link goes away from the site.
  13. Ah that's how! I updated my code with this.
  14. you mean an array with all the quotes? Not with a PW method, i think... you would have to loop through all the pages and through the repeater in each page, and then join the arrays. $allQuotes = array(); foreach($pages->find("employee_quotes.employee_quote!=") as $p){ $theseQuotes = $p->employee_quotes; $allQuotes = array_merge($allQuotes, $theseQuotes); } This should work. (it doesn't) edit: to echo all the quotes: foreach($allQuotes as $q) { echo "<blockquote>{$q->employee_quote}</blockquote>"; } edit2: wait, this doesn't work edit3: This does work: $allQuotes = new PageArray() // thanks to soma for this foreach($pages->find("employee_quotes.employee_quote!=") as $p){ $theseQuotes = $p->employee_quotes; $allQuotes = $allQuotes->import($theseQuotes); } foreach($allQuotes as $q) { echo "<blockquote>{$q->employee_quote}</blockquote>"; }
  15. Ah, sorry! it stays for reference It grabs the pages. pages->find() always returns an array of pages.
  16. // this returns the first page with Johnson included in the title (I'm not sure why you do it like this, why don't you just $pages->get("name = johnson") it? $johnsonPage = $pages->find("template=employee, title~=Johnson")->first(); // this returns an array with all the elements (the quotes) of the repeater field "employee_quotes" inside the page and shuffles it's order $quoteList = $johnsonPage->employee_quotes->shuffle(); // this removes the first element from the array, and returns it $quoteList = $quoteList->shift(); // this returns the content of the field "employee_quote" that is inside of that element $employeeQuote = $quoteList->employee_quote; in resume, the code grabs a random quote from the employee named Johnson.
  17. can you put this on your template to make sure it doesn't? echo $pages->find("employee_quotes.employee_quote!="); it should echo a list of page IDs this works for me echo $pages->find("repeat.email!=");
  18. No, they are inside the field table, and associated to a page.
  19. Or that
  20. The problem is in the conversion. the date you are getting is the beginning of the unix timestamp... can't be equivalent to that number.How did you do the conversion?
  21. Nice work Alan! Press releases page is a bit empty. Maybe you can add a conditional to check if there is a press release, and write something like "there isn't any press release to show yet" in case there's not.
  22. Wow, what a first post! I can't test it now, but it looks great! Although I don't understand a big part of it... i will get there I just don't like the hard coded language if ($lang == 'en') $lang='default'; Would be more elegant to have a setting on the module for this static public function getModuleConfigInputfields(array $data) { $data = array_merge(self::$defaults, $data); $fields = new InputfieldWrapper(); $modules = Wire::getFuel("modules"); $field = $modules->get("InputfieldText"); $field->attr('name', 'defaultLang'); $field->attr('size', 10); $field->attr('value', $data['en']); $field->label = "Default language"; $field->description = "What is the url code you want to use for your defaul language?"; $field->notes = "Example: en, pt, gr or it"; $fields->append($field); return $fields; } protected static $defaults = array( 'defaultLang' => 'en' ); $options = self::$defaults; if ($lang == $options['defaultLang']) $lang='default';
  23. Sorry, it wasn't clear that i was joking. Next time i will put more smileys
  24. calendar, weather, sudoku, stock market... i will tell more if i remember
  25. So, all your quotes are in one page, inside a repeatable field? sorry, because I still didn't get this. edit: in your code you never call the field "employee_quotes", to have access to "employee_quote", you should call it like this on the selector ("employee_quotes.employee_quote != ''") edit2: I know what is happening. because you are calling the fields inside of the repeater directly, and because these fields are inside the special repeater hidden pages, those are the ones that PW is finding on your first line. That's why you have results only when you are logged in as superuser. Give us some more details about what exactly you want to do. You have more than one page with the repeater "employee_quotes"? Anyway, in general this should work for what you want: $quoteList = $pages->find("employee_quotes.employee_quote!=")->shuffle(); $quoteList = $quoteList->shift(); $employeeQuote = $quoteList->employee_quotes->shuffle(); $employeeQuote = $employeeQuote->shift(); if ($employeeQuote) { echo "<blockquote>{$employeeQuote->employee_quote}</blockquote>"; } But would be less complex if all repeaters are in one page only
×
×
  • Create New...