Jump to content

kathep

Members
  • Posts

    133
  • Joined

  • Last visited

Everything posted by kathep

  1. @renobird I'll keep the forum posted on progress with my front end experiment.
  2. Ah @pwired I understand. Yes, time is a priority, but so is elegance. I prefer an elegant (code) solution that will be manageable and pleasant to work with in the long run, instead of a clunky one. For example, I have no motivation to become expert at wordpress, even if devoting myself to it and getting good would ultimately save me time.
  3. @renobird Thanks for the link. Pinegrow looks interesting. @pwired Trying new things lead me to PW. I will not apologize! @soma YES.
  4. Hey all I'm on the search for a front end dev workflow that is as dreamy to use as PW is for backend stuff. Call me picky, but I am not into the div-bloat of Bootstrap and Foundation, especially for simple sites that don't use much of their functionality. I've been playing around with a new front end dev software called Blocs. So far, I like it. It is based on Bootstrap, but simplifies the code, and adds a drag-and-drop UX that is very nice. Also, it seems to be hard to make ugly things in this dev model. Always a good thing I tried Macaw, and really wanted to love it, but just couldn't get into it. I'm curious... has anyone else tried Blocs in combination with PW? And if not, what is your preferred front end dev of choice for PW installs? In a perfect world we would all hand code our sites, but there are so many great lazy front end tools (I'm looking at you @Joss ) that I do this less and less.
  5. Hi @palacios000! What @kongondo said. I use the 'context' dropdown for two things: 1. to make my backend template forms look nice and compact, and 2. to reduce the amount of fields I need to use and create. I will explain this one because it is probably the most useful. So instead of having these fields and titles in these templates: Template: Houses with fields: house_address (label: House address) house_available (label: House available?) housing_development (label: Housing development) Template: Flats with fields: flat_address (label: Flat address) flat_available (label: Flat available?) building_name (label: Building name) Template: Mansion with fields: mansion_address (label: Mansion address) mansion_available (label: Mansion available?) mansion_name (label: Mansion name) I can do this: Template: Houses with fields: address (label: House address) available (label: House available?) name (label: Housing development) Template: Flats with fields: address (label: Flat address) available (label: Flat available?) name (label: Building name) Template: Mansion with fields: address (label: Mansion address) available (label: Mansion available?) name (label: Mansion name) I use the same three fields for slightly different things on different templates. This is helpful because when I'm writing code where, say, I want a list of all properties, I only have to call three fields. Does this make sense?
  6. @adrian Thanks for the update, and the explanation of custom templates for parents. I suppose it has not seemed necessary to me as I've only been working on my own site so far. But definitely something to keep in mind once others are using my PW site.
  7. Ah, I see. Unfortunately I have no idea how to accomplish this.
  8. You could use the wonderful Page Select Field Creator. In that module there is a textarea that takes CSV text.
  9. Hi @Cerulean, and welcome! I had the same trouble recently. The number string is good, it means you're nearly successful! I don't know very much (especially compared to others on this forum) but I will answer you best i know how... Start here on another thread to follow how I converted the number string to the correct display. The solution that worked for me was to call the pages before trying to output them. Here is some untested code for you to try: $bib = $pages->find("parent=/enter/path/to/your/bibliography/type/pages/here"); // calling the bibliography type pages // the path will be short, something like /tools/bibliography_type <- find it in your page tree echo "<p>{$bib->title}</p>"; More experienced users, please correct my suggestion if it is bad!
  10. Behold the mystery... As you can see, I specified basic-page as the parent template, and a new template was created with a name of basic-page and a file name of basic_page. Weird. I had hoped it would recognize my order of 'basic-page' and assign that template to the parent. Now I know for next time. Why is it 'safer' to assign a custom parent template? If you know of any references about this, please let me know. I'm keen to learn!
  11. RESOLVED @Adrian, your reply prompted me to check the parent template. When I originally created the page tree in Page Field Select Creator, I typed 'basic-page' into the template field. What I did not expect is that instead of using the existing basic-page template, Page Field Select Creator created a duplicate basic-page template. I didn't eve know it was possible to have two, identically named templates. Anyway, it is. And the parent basic-page template Page Field Select Creator made had the wrong child template assigned to it (which occurred when I created another page tree using Page Field Select Creator, and selected basic-page as parent, and another template as child). Have you ever had this issue of Page Field Select Creator duplicating existing templates? Perhaps it should be noted in the instructions.
  12. Hi @adrian, and thank you for developing such a great tool. I understand this. My problem is that I have created a template called online_tools for all child pages (using Page Field Select Creator), but cannot access it when creating a new page in the tree. I want to add new pages in order to add them to the associated pageselect field. When adding a new child page below Online Tools, new pages are added by default with the wrong template - the template 'online_tools' is not shown, despite how Page Field Select Creator is supposed to work. Existing children have the correct template. The option "Can this template be used for new pages?" for 'online_tools' is set to 'yes'. This is not related to my problem. Hopefully this post helps you understand what I am asking. Yes, I understand. Don't worry, I am using it for the intended purpose.
  13. Hey all I have come across a glitch when trying to add a new page to a tree created with the Page Field Select Creator. Steps taken The tree looks like this: The page called Online Tools has 'basic-page' template, and all existing child pages have 'online_tools' template. I click on the 'new' button to the right of Online Tools, then type in the new page name, like so: After I click 'save', I see that my new template has been assigned the template 'lesson_plan_section_type' (this is the only other template I have created with Page Field Select Creator). 'No problem,' I think 'I'll just head on over to the settings tab and change that sucker' But then... Sad result *cue panic* Where is my online_tools template?! It is assigned to all existing pages, but currently cannot be assigned to my new page. I hoped I might be able to trick PW by creating a blank template called 'online_tools' and uploading it, but that didn't work Is this a problem with Page Field Select Creator, or perhaps it is not designed to create new pages? Does anyone know how to fix this? *crossing my fingers it's an easy one*
  14. Genius. That is all. I will use it 4eva. @diogo I am also a designer-who-gets-things-working type. You never know, maybe php includes will work better than delayed output for me, too. We will see!
  15. kathep

    learning php

    @Kongondo I added your links to my post
  16. @diogo Yes, my php includes are definitely crappy No offense intended. I'm glad to discover I had an incorrect impression of them. @Kongondo thanks for the list. If you are able to delete the new thread I created looking for tutorials (before I read your thread), please do so. This was a classic case of 'searching from within PW instead of google returned no results'. Reminds me to search the forums from google ALWAYS.
  17. kathep

    learning php

    With a little help from @Kongondo, I have finally committed to taking some lessons PHP beyond what I can learn messing around with my PW install. Here are the best-looking tutorials I have found so far... PHP on Codeacademy PHP Basics on Treehouse I also found Rocky's Boots helpful for learning logic - not sure if anyone else will like it. Please let me know if you have a favorite resource for learning PHP. Also, if anyone can vouch for the usefulness of either of the above tutorials, please let me know! It would be great if this thread could become a resource for all others new to PW and PHP - I hope there are many! EDIT: I have just been directed to the other forums on this topic: learning php Learning PHP: where to learn (just enough to make living w/ PW easier) Post your suggestions there, I guess!
  18. RESOLVED @Kongondo your code worked perfectly. Thank you! It was a relatively simple fix, but I had no idea how to do it myself. This makes me more resolved than ever to do some basic php tutorials. I'm going to start a new thread to ask for tutorial recommendations, as I'm sure a lot of people could benefit from it.
  19. Thanks @LostKobrakai and @Kongondo. I have indeed read the documentation of template files, but they don't really help me. The docs are useful in the sense that they show the easiest ways to get a processwire site working, but what they show goes against commonly agreed best practise. For example, 'direct output with includes' is written up in the docs as perfectly valid markup. But in the forums, I see people refer to this as completely evil and never to be done (just tried to find an example to link to and couldn't remember where I'd seen it - please correct me if this understanding of mine is wrong!). So I ask myself, as a beginner, why would I learn crappy ways to start with? For me, it is better to be awful at a best practise way of coding and struggle along, than to learn to depend on crappy php includes that I will eventually have to change if I want to respect myself as a php coder Delayed output seems to make the most sense for my build, for a variety of reasons. The default templates use delayed output, and I'm happy to stick to that. I see no need to change my template files away from this system. I do see a need for me to improve my skills to use delayed output well! Even if there are myriad ways to output php and it would be impossible to cover them all, I still think it would be valuable to show at least one example of output in a format that worked with the intermediate template files. And I'm still volunteering to write the examples I have enough skill for! And yes, I need some basic php tutorials to help learn PW better. Thanks again for encouragement and helpfulness.
  20. @Macura and @Kongondo thank you for feedback! I am very happy to have an untested code suggestion to play around with Now I see your code, it makes a lot of sense. I never would have thought of closing the table row in separate concat on my own, but now I see it, it seem so obvious! This php/pw journey feels like traveling in another country and only knowing half the words. But I am learning fast. I have seen the repeaters documentation, but one thing that is a stumbling block for me is that a lot of the output examples given in the docs use echo. But the templates use a better code system where echo doesn't really fit (all echos appear above the main page nav on output). I like the more efficient coding system of the templates, and want to stick to it, but there are few examples documented. If I wrote them, do you think Ryan would be willing to add some more output examples to the docs?
  21. @kongondo Yes, you're right, lesson_plan_section_type doesn't need to be a pagearray - it would be better as a page. So that simplifies one part of the problem! I agree, my experience so far has been that nested foreachs get confusing! But your answer has helped me the next step of the way. I will try changing the lesson_plan_section_type to a page instead of a pagearray, adding an if statement to my dodgy code, and see what happens. Stay tuned... UPDATE So now I have two, related problems... 1. How to output lesson_plan_section_type as a page for each repeater, and 2. How to output online_tools as a pagearray for each repeater. I have been trying to figure this out for ages, testing using $fields, adding nested foreach statements (though I have little idea what is correct for these). The closest I came to success was using a $page->get() function to call the lesson_plan_section_type page. This at least showed an output, but all it did was take the first lesson_plan_section_type page from the list and add it every repeater instance. Not what I was trying to do! Please let me know a clue if you have some more knowledge than me on this.
  22. I am having trouble working out the syntax for outputting relational data that is nested inside a repeater field. I only started using repeater fields a couple of days ago, and pagearray fields three weeks ago. The problem involves the following templates and fields: classlesson_plan_section (repeater field, containing the following)lesson_plan_time lesson_plan_subject lesson_plan_section_type (pagearray field) online_tools (pagearray field) lesson_plan_section_typetitle lesson_plan_section_description online_toolstitle url I have outputted the regular text areas of the repeater field fine, like this: *table beginning code snipped off* foreach($section as $item) { $lesson_list .= "<tr><td>" . $item->lesson_plan_time . "</td><td><p><strong>" . $item->lesson_plan_subject . "</strong><br> </td><td> </td></tr>"; } *table end code snipped off* I can get the repeater fields to output, and usually I can get pagearray fields to output, but I am having trouble now that the pagearray is inside a repeater field. Do I need to add the repeater field to my syntax? I mean like this: online_tools=$page->lesson_plan_section->online_tools I have been doing various, ridiculous things with my code to try to replace the '$nbsp;'s with the lesson_plan_section_description and online_tools pages selected in the repeater field, but without luck. I know I that before output, I have to find the pages like so: $section_type = $page->lesson_plan_section_type; $tools = $page->online_tools; $section_find = $pages->find("template=lesson_plan_section_type, lesson_plan_section_type=$page->lesson_plan_section_type"); $ot_find = $pages->find("template=online_tools, online_tools=$page->online_tools"); But this is as far as I got. Can someone provide me with a hint to get me a little further?
  23. @cstevensjr Thanks for the confirmation! I try to be clear and thorough, but I always like to know if i can improve my contributions. These comments about 'starters' had me wondering if I could do better.
×
×
  • Create New...