Jump to content

kongondo

PW-Moderators
  • Posts

    7,379
  • Joined

  • Last visited

  • Days Won

    139

Everything posted by kongondo

  1. The idea here is get the basics right; not try and get to know everything, especially the deeper stuff in one swoop! Rome wasn't built in a day; but it was built "correctly" from the start; The builders got the basics right Yes, but play "in your league" (no offence meant here). You are trying to play in the big league but you are still a rookie; going by your questions, we can tell you are not ready yet. Rookies need time to learn. So, play in the minor leagues first, then advance upward....I promise you, it will be more enjoyable for you this way... In essence, yes build, but build slowly, build the right way with simple tools first (forget PHP functions and the rest, for instance) - concentrate on the PW API but not the whole cheatsheet! - just $page, $pages and selectors for starters. As you build this way, also play but play according to your current knowledge (level)... I think I have said enough....based on my own experience. Final decision is up to you, of course. I am out....
  2. Uh, this is already available when debug=true ...though a bit wonky in a few use cases...You need to hover on the arrow on the right of the field when editing a page. Otherwise, some of your suggestions are neat
  3. @Ralf. The main thing here is first to deal with the parentage issue. The rest - description, owner, price, birthday, etc. are simpler. They are just fields that you can have in the horses template. The pedigree can either be single page fields, or you can create your Page's Tree to reflect pedigree as you've shown in your first post. Just to repeat, about clickable, like Martijn said, you can enable and disable that. So, in a nutshell - ALL horses must have a page in the backend (in your admin...i.e. as children of the page "horses" who is a child of "home") BUT not all of these horses pages' will be viewable in the frontend. For such, you will not output their links to the pages and if your web visitors try to enter the address to that non-clickable horse manually (phew! - that was long!) - they get a nice 404 page not found . if you don't know a horses parents, there's the Null Martijn suggested...
  4. By the way, if you have too many horses to choose from in the page fields (and also to minimize mistakes), you can instead have two templates for the horses: "male-horses" and "female-horses". Then force the page fields "father" and "mother" "Template of selectable pages" to use these templates respectively.. This also helps if you want to output say, only the male horses, etc...You get the idea
  5. Building up on above....even more verbosity...!!! (last one, I promise!! - I got carried away ) We have single page select fields for each horse, i.e. "mother" and "father". And here we go...We let PW do all the donkey work (excuse the pun!)....PW will find the titles of this page's page fields and the titles of the page fields of those other page fields, etc, etc... echo '<h5>First Generation</h5>'; echo 'My name is: <strong>' . $page->title . '</strong><br>'; echo '<hr>'; echo '<h5>Second Generation</h5>'; echo 'My Mother is: <strong>' . $page->mother->title . '</strong><br>'; echo 'My Father is: <strong>' . $page->father->title . '</strong><br>'; echo '<hr>'; echo '<h5>Third Generation</h5>'; echo '<h6>Maternal</h6>'; echo 'My Maternal Grandmother (mother-mother) is: <strong>' . $page->mother->mother->title . '</strong><br>'; echo 'My Maternal Grandfather (mother-father) is: <strong>' . $page->mother->father->title . '</strong><br>'; echo '<h6>Paternal</h6>'; echo 'My Paternal Grandmother (father-mother) is: <strong>' . $page->father->mother->title . '</strong><br>'; echo 'My Paternal Grandfather (father-father) is: <strong>' . $page->father->father->title . '</strong><br>'; echo '<hr>'; echo '<h5>Fourth Generation</h5>'; echo '<h6>Maternal</h6>'; echo 'My Maternal Great Grandmother (mother-father-father) is: <strong>' . $page->mother->father->father->title . '</strong><br>'; echo 'My Maternal Great Grandfather (mother-father-mother) is: <strong>' . $page->mother->father->mother->title . '</strong><br>'; echo 'My Maternal Great Grandmother (mother-mother-father) is: <strong>' . $page->mother->mother->father->title . '</strong><br>'; echo 'My Maternal Great Grandfather (mother-mother-mother) is: <strong>' . $page->mother->mother->mother->title . '</strong><br>'; echo '<h6>Paternal</h6>'; echo 'My Paternal Great Grandmother (father-mother-father) is: <strong>' . $page->father->mother->father->title . '</strong><br>'; echo 'My Paternal Great Grandmother (father-mother-mother) is: <strong>' . $page->father->mother->mother->title . '</strong><br>'; echo 'My Paternal Great Grandfather (father-father-father) is: <strong>' . $page->father->father->father->title . '</strong><br>'; echo 'My Paternal Great Grandfather (father-father-mother) is: <strong>' . $page->father->father->mother->title . '</strong><br>'; The above will give you something like this... Midnight Run 1. First Generation My name is: Midnight Run 2. Second Generation My Mother is: Fairy Tale My Father is: Nostalgia 3. Third Generation Maternal My Maternal Grandmother (mother-mother) is: Angel My Maternal Grandfather (mother-father) is: Lucky Luke Paternal My Paternal Grandmother (father-mother) is: Seasons My Paternal Grandfather (father-father) is: Big Grey 4. Fourth Generation Maternal My Maternal Great Grandfather (mother-father-father) is: Bonnie My Maternal Great Grandmother (mother-father-mother) is: Blue My Maternal Great Grandfather (mother-mother-father) is: Breeze My Maternal Great Grandmother (mother-mother-mother) is: Dancer Paternal My Paternal Great Grandfather (father-mother-father) is: Stop That Train My Paternal Great Grandmother (father-mother-mother) is: Puzzle My Paternal Great Grandfather (father-father-father) is: Xmen My Paternal Great Grandmother (father-father-mother) is: Rosie
  6. This man Martijn is a clever man.....Let me attempt to expound on what he has said......Warning verbosity!! You do not need those 14 fields (to cover both maternal and paternal roots - 7 each). Consider this as an family tree. If you follow a branch, it will lead you to other branches, etc. In ProcessWire, there is something called chaining....Let's say you have a horse called "Midnight Run". You only need to know the parents to make a complete tree. Why? Because, in the parents pages, they will also have Page Fields which will contain their parents. So, "Midnight Run" has a mother called "Fairy Tale" and a father called "Nostalgia". Both "Fairy Tale"and "Nostalgia" have their own pages. In their respective pages, their parents are selected (via page fields). For "Fairy Tale" let's call them (her parents) "Lucky Luke" (father) and "Angel" (mother). For "Nostalgia", the father is "Big Grey" and the mother is "Seasons"....and so on it goes...."Big Grey", "Seasons", "Lucky Luke" and "Angel" also have page fields with parents selected, etc. Up to the 4th generation. So....
  7. It's all here, nice and clear as daylight: http://processwire.com/api/variables/input/ But I'll post it here anyway...(emphasis added)
  8. This looks like a nice riddle to solve ....maybe have a read here first to find out in which category your question belongs: https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/ Btw, how deep will the ancestry go? i.e. is it up to the 3rd, 4th, 5th or unknown generations?
  9. Cool site Ole! Thanks for showcasing...really inspirational
  10. Thanks for the attempt sshaw...Most important thing missing is you are saving user input without first sanitizing it....Never trust user input so we must sanitize it before saving it More here to help you choose an appropriate sanitizer: http://processwire.com/api/variables/sanitizer/
  11. Quick one as I gotta run...$page? collision? That is a known property in PW....Just guessing .....
  12. HI jiloml, Welcome to PW and the forums.. Regarding your "learning PHP" question: https://processwire.com/talk/topic/2994-learning-php/ https://processwire.com/talk/topic/6030-learning-php-where-to-learn-just-enough-to-make-living-w-pw-easier/
  13. Jeff, Thanks for testing and reporting back. I'll file a bug report at Github later...thanks.
  14. Did you read my post just above yours? I don't understand what you are really trying to do with your function but there's is a world of difference between the fields 'summary' and 'myselect'. The former contains text = a string. 'myselect' is a page field, so returns a page object (like I stated above). If you just echo it out, it will just show the id of the selected page. The question is, what do you want from 'myselect', i.e. which of its fields are you after. In my hint above, I gave you examples of how you can get any property or custom field of your 'myselect'. That is what you need to give your array... array('$page->myselect->title');//this is outside a function. Inside a function, that is the homework I suggested you read about
  15. You better re-read this answer to your previous question: https://processwire.com/talk/topic/6013-difference-select-aka-dropdown-vs-page-field-type/?p=58768 Hint.... $page->myselect->title; $page->myselect->template; $page->myselect->id; $page->myselect->child->name; $page->myselect->headline;//custom field $page->myselect->othercustomfield;//custom field $page->myselect->this; $page->myselect->that; $page->myselect->that->and->and->and;//you get the picture... Here's your other homework...will the above work in a function?
  16. As long as it's not an infinite loop.....
  17. Actually, it seems Joe was the last poster (13 November 2013) in that thread Wanze points to
  18. In their blog profile install, using PW2.4, could someone please confirm that they can view the option "PageAutocomplete" as one of the Inputfield field type selections in the drop down in /setup/fields/input (admin)? Although the page field called "tags" works fine when editing a "post", PageAutocomplete does not appear in the field edit screen. It also means I cannot add a field of that type. Currently, the "tags" field "appears" as a "Select". If I save the field settings, it now also disappears in the edit a "post" page. And yes, automplete is listed as installed. Thanks! Does the above even make sense? I'm having one of those days!!!
  19. I meant the forum search facility. Like Adrian said, it's not the best....so, we normally do something like this in Google.... 3 letter word site:processwire.com or if you want just the forums 3 letter word site:processwire.com/talk And you can use all sorts of Google search methods (wild cards, "", etc..) and tools as well....
  20. @Martijn...your holiday to the UK is long overdue then!!!
  21. Sort of.....http://mods.pw/5n
  22. ...You are not able to change it....only moderators can....
×
×
  • Create New...