Jump to content

Gazley

Members
  • Posts

    529
  • Joined

  • Last visited

Everything posted by Gazley

  1. Hi there, I'm starting to see groups of fields that might be optional in a template but may well make sense being included in other templates. So, re-usable field groups, if you like. After having made great use of repeaters so far, I know that as a concept, I could achieve this reusability with a repeater. However, semantically, this is wrong because the data doesn't repeat in a single template. Is there a recommended way to achieve this? Many thanks!
  2. @teppo - thanks for your comments and the link. I agree with you about having some guidelines; you can't beat experiencing things first hand, but a set of rules and handy information on a topic always sets you out along the right path from the get go. @apeisa - thanks for the list of tips. These are the precisely the kind of gems that probably need to be collated in a single document or article. Much appreciated!
  3. Thanks guys! I think I have my answer(s). Seems I need to throw a bit of time studying what's already there. At least now I know I'm not missing something
  4. Hi Pete, Thanks for the link. Just so you know, I have read that quite a few times but it doesn't mention things like the underscores "rule" that you just referenced. It sort of says how you physically put the Module class together but I couldn't see anything about how you actually extend and take advantage of the PW core. Maybe, it's simpler than I think. Right now, I'm trying to get so many things done, I haven't really had the chance to sit down and just follow other Modules to see what/how they do things. Are there any other things like the triple underscore? Which are the main classes that you would usually target or extend in a Module? Cheers!
  5. Hi there, Whilst creating a very simple Module, I found myself looking at other Modules and wondering why certain things were done in certain ways. I also, saw comments about methods with triple underlines and being to hook and pre-hook Page methods and after my head stopped spinning, I wondered whether there is a tutorial anywhere about this whole thing If its just a case of doing and asking, that's fair enough. However, there are a fair few tutorials on most areas of the system but I couldn't find anything around Modules. Please let me know if there's something I'm missing. Many thanks!
  6. Soma, it was a PHP error with my code. Nothing to do with the Module system. Just me being stupid
  7. No worries on my last point. There was a problem in my function that PHP was choking on - nothing to do with the module.
  8. Thanks Pete. Are there any rules around changing the module that you're aware of? It just error when I changed the contents of the module and the errors only cleared up when I put the module back to its original form.
  9. HI there, I added my first module (thanks to Soma) but have noticed something. I made a change (added a new method and deleted a method) to the module and PW just threw an error in both the browser and Admin panel. There is obviously something you have to do around changes but I can't seem to find anything about this. I also had to uninstall and reinstall my module and the ID assigned by PW now seems to have skipped a few values. Is this a problem? Do I need to clean this up in someway? Thanks!
  10. @ryan - added .module to my PHP pattern and all is well, IDE and more importantly me ... happy again
  11. Hah, what a Muppet - you have to install it through the Module's panel! Woot! I'm having (many) Senior Moment(s)
  12. I've created the module (based on Soma's example) and placed it in site/modules (with a .module extension only). However, it doesn't seem to get loaded. Is there something you have to do to tell PW to load site based modules? Thanks.
  13. The file extension is .module - will PW get upset if it has a PHP extension too? My IDE doesn't give me the usual "help" if the file hasn't a PHP extension!
  14. Hey Soma, Thanks for pointing me towards a module for this requirement. I can see me creating lots of modules once I get the hang of it! BTW, the tips you gave me for filtering my image categories have worked really well! PW is so powerful Best, --Gary
  15. Hi there, I created a static helper class for some utility functions (gwutils.php). When I try and access it: $summaryImg = gwUtils::GetImageByCategory('summary', $summary); PW is picking this up through spl_autoload_register and obviously throwing an error because it isn't registered. What is best practice around creating/registering/loading site based custom classes? Thanks!
  16. Thanks Ryan.
  17. Soma "Then you create custom page fieldtype "categories_selected" that has set /Categories as the parent and allow multiple pages" This was when the "penny dropped"! It appears exactly how I want it to in my "image_meta" repeater field! Now just some playing around with the querying and I'm done. Thank you so much! You too Martijn! --Gary
  18. Hi Soma I want to provide a set of categories for images. An image may have one or more categories. So, an image may be categorized "carousel". This means that in a collection of a pages images, I can filter out images that can be displayed in the page's carousel. Another example is where a single image in collection of a pages images can be categorized as "summary". This means if the page containing the images is summarized on, say, the home page, I can identify which image should be used as the summary image. My main page template contains a repeater called "image_meta" that contains an image and additional fields for image based meta data. I want to add my multi-select drop-down list to this repeater so that consistent categorization can be applied to the images. Does this make sense?
  19. >Make a template without file called: "checkboxes" and put children in it with a template "checkbox" I've made the template using the "basics" section of the template editor. How do I put "children" in it?
  20. Thanks Martijn. I can't see how I could do this and get the Dropdown list into a repeater. Is this possible?
  21. Hi there, I want to create a drop down list so that I can filter queries by common values. I was surprised to not be able to find a combo or drop down list and after reading some threads in here, I came across this Page concept. At the risk of sounding really thick, I don't really understand it. I want to have some cross template common categories in a list. Is there a tutorial or anything that shows how to do this? Thanks.
  22. Thanks Soma. What about caching objects though? Any best practice around that requirement?
  23. Hi Pete, Many thanks for responding! I don't think I made myself clear. What I was referring to was caching the runtime results of queries, not their definitions, and possibly HTML fragments (generated on the fly) that might be used more than once in the same server-side hit. Know what I mean? Cheers --Gary
  24. Hi there, As I'm starting to work across pages, I'm seeing some cases where I might like to re-use queries or HTML fragments that in my original framework, I may have cached in properties of more globally accessible object references. In templates, you're in a page-centric scenario and I wondered whether there is anything in the framework for stashing values for use across template processing? Thanks!
  25. Ryan, That interesting to know (about Apache) Thanks.
×
×
  • Create New...