Jump to content

Gazley

Members
  • Posts

    526
  • Joined

  • Last visited

Everything posted by Gazley

  1. 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!
  2. 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!
  3. Soma, it was a PHP error with my code. Nothing to do with the Module system. Just me being stupid
  4. No worries on my last point. There was a problem in my function that PHP was choking on - nothing to do with the module.
  5. 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.
  6. 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!
  7. @ryan - added .module to my PHP pattern and all is well, IDE and more importantly me ... happy again
  8. Hah, what a Muppet - you have to install it through the Module's panel! Woot! I'm having (many) Senior Moment(s)
  9. 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.
  10. 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!
  11. 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
  12. 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!
  13. 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
  14. 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?
  15. >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?
  16. Thanks Martijn. I can't see how I could do this and get the Dropdown list into a repeater. Is this possible?
  17. 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.
  18. Thanks Soma. What about caching objects though? Any best practice around that requirement?
  19. 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
  20. 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!
  21. Ryan, That interesting to know (about Apache) Thanks.
  22. Thanks Guys, @WillyC - that thought entered my head but I'm running on a Mac where the underlying OS is case-sensitive. I'll try your suggestions and thanks again
  23. Nope, there is no directory called "processwire" - only "site" and "wire". If I enter localhost:8888 - the site loads as expected. I typed in localhost:8888/processwire to simply administer the site - somehow, it appears to be being interpreted as a directory?
  24. Hi there, I have just moved my site on localhost from docroot/ProcessWire up one level to docroot. If I try and access the admin module: localhost:8888/processwire - I just see: Index of /processwire Parent Directory .idea/ Is what I have done a No-No on localhost? I was really trying to really simulate how the site would be installed on the live server but now, I cannot get the the admin setup. Any suggestions? Thanks!
×
×
  • Create New...