Jump to content

Gazley

Members
  • Posts

    526
  • Joined

  • Last visited

Everything posted by Gazley

  1. Thanks Robin for some great tips and pointers. They have helped immensely!
  2. Hi there, After using a number of image services that have very nicely taken care of responsive image handling for me, I have now put together code that will output image elements in a variety of ways dependent on their definition in the back-end of the PW system. So, things like Viewport width, DPR and Art Direction (Picture) based representations. In the past, I just loaded the largest, highest quality image to the image service provider and the client-side JS decided, based on runtime condition, what size and pixel density image version were required. I haven't used ProcessWire's image handling capabilities, other than just loading images into the "images" field which has provided the original path used by the responsive image services. Here is the nub of the gist. If I start with the same source image provided by the photographer, as referred to earlier, is there anything in ProcessWire that will either automatically or manually, help me to create the various versions of the images that I want to include in my image element's srcset attribute? Or, does this have to be done outside of ProcessWire, say, in Photoshop or Lightroom? I really appreciate your thoughts, ideas and comments around best practice in this regard, within the context of ProcessWire. Cheers!
  3. @berhard - In the module when a RuntimeMarkupField runs inside a repeater, $page references the page that the repeater is on, not the repeater iteration instance.
  4. So, I tried to use RuntimeMarkup in my RepeaterMatrix and $page refers to the page that the repeater is on. I have placed the RuntimeMarkup field inside repeater entries and therefore, I can't see a way to get a reference to the Page field in the "current" repeater entry. Basically, if I can get a reference to the Page field each time it appears in the repeater, I can simply reference the field value is want from (Template2/Page2) straight from the Page field. Thanks.
  5. Thanks @kongondo! Glad to know that others have this requirement to the extent that you built a module for it
  6. @LostKobrakai, ah OK, so @kongondo bundled the solution in his module - cool! Thanks for the help
  7. @LostKobrakai - that sounds about right. I've used hooks in the past (infrequently) but I've no clue how to create a custom field. Do you have any suggestions as to where I can acquire this knowledge? Any tutorials or sample code that you're aware of? Many thanks! @kongondo - thanks for the pointers. The ProcessPageEdit::buildForm suggested by @LostKobrakai sounds like it will work but I'll definitely look at your suggestions too.
  8. Hi there, This question has possibly been asked and answered but I couldn't seem to find a related topic. I have a Template (Template1) that contains a number of fields, one of which is a Page field. I have an Admin Access page based on this template and data is entered into the page based on Template1. When the Page field is set on this page, it obviously relates to a different page/template (Template2) that likewise contains its own data. This is the real gist of the question: After I select a page in the Page field on Template1, how can I have displayed, a piece of "Read Only" data from Template2, adjacent to the Page field in Template1. It's really like I want to create a "custom" read-only field in the template that responds to the settings of the other fields in the template, in this case, a Page field. Obviously, this would be trivial if I was generating output markup based on Template1. However, Template1 is behind an Admin page that is used for data-entry and I want to show data from the page referenced by the Page field for "information" purposes, solely to help the person who is inputting data. The second part of this question is that the Page field in Template1 is actually in a Repeater Matrix that is a specified field in Template1. I'm sure that the technique would be similar irrespective of whether the Page field is directly in a Template or inside a repeater in a Template. Hope this makes sense! I look forward to any suggestions you may have
  9. Thanks @BitPoet for the reference to the thread. It looks like anyone who was using the Spex module was tripped up by this one. I stopped using Spex a while back and ported most of the ideas to my own module so I had a bit more control over it. I've got to say, I never really did get the whole "fuel" concept in ProcessWire so if it's now being deprecated, it's one less thing to understand. Cheers.
  10. Hi there, I have the following code: return array_merge( $include_fuel ? fuel()->getArray() : array(), [ 'utils' => $this ], $this->templateVars ); This worked fine in PW 2.x When namespaced to ProcessWire using PW3 either from the original file or, a compiled version, I get the following error: Error: Exception: Method ProcessWire::getArray does not exist or is not callable in this context (in /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php line 346) #0 [internal function]: ProcessWire\Wire->___callUnknown('getArray', Array) #1 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php(303): call_user_func_array(Array, Array) #2 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/WireHooks.php(555): ProcessWire\Wire->_callMethod('___callUnknown', Array) #3 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php(326): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessWire), 'callUnknown', Array) #4 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/ProcessWire.php(471): ProcessWire\Wire->__call('callUnknown', Array) #5 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php(327): ProcessWire\ProcessWire->__call('callUnknown', Array) #6 /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php(327): ProcessWire\ProcessWire->callUnknown('getArray', Array) #7 /Applications I get the same error if I simply call: fuel()->getArray(); FYI, this is inside a module (called Utils.module). Can anyone confirm if they see this? Many thanks.
  11. Hi there, Just started with PW3 and building out my site. I used PHPStorm & XDebug just fine with PW2.7. If I run my PW3 site without any debugging turned on, the (very) basic homepage renders fine. If I turn on Xdebug and set a breakpoint or two, all is fine until I get into PriocessWire::buildConfig() at the line that news up a Config() instance ) line #604. $config = new Config(); When I step through that line or execute it in the console, the system acts as though it can't find the Config class. In my php error log file, I get entries like: [13-Mar-2016 21:34:54 Europe/Berlin] PHP Fatal error: Class 'ProcessWire\WireDebugInfo' not found in /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/Wire.php on line 1174 [13-Mar-2016 21:34:54 Europe/Berlin] PHP Stack trace: [13-Mar-2016 21:34:54 Europe/Berlin] PHP 1. {main}() /Applications/MAMP/htdocs/hsa/ProcessWire/index.php:0 [13-Mar-2016 21:34:54 Europe/Berlin] PHP 2. ProcessWire\ProcessWire::buildConfig($rootPath = *uninitialized*, $rootURL = *uninitialized*) /Applications/MAMP/htdocs/hsa/ProcessWire/index.php:33 [13-Mar-2016 21:34:54 Europe/Berlin] PHP 3. ProcessWire\WireData->__debugInfo() /Applications/MAMP/htdocs/hsa/ProcessWire/index.php:605[13-Mar-2016 21:34:54 Europe/Berlin] PHP 4. ProcessWire\Wire->__debugInfo() /Applications/MAMP/htdocs/hsa/ProcessWire/wire/core/WireData.php:415 It's all a bit weird. It runs without the Xdebug listening for breakpoints but turn Xdebug on and it all goes pearshaped! Any ideas/thoughts/suggestions very welcome. Cheers!
  12. Thanks @horst - some great things for me to try there. I can see the sense of just having index.php in the physical document root! Cheers
  13. Hi there, I have my development files in: /Users/gazley/hsa/ProcessWire I have a symlink in my document root folder like so: /Applications/MAMP/htdocs ᐅ ls -l hsa lrwxr-xr-x 1 gazley admin 33 10 Mar 16:19 hsa -> /Users/gazley/hsa/ProcessWire In latest PW3 index.php, line 28, it says: $rootPath = __DIR__; which returns: /Users/gazley/hsa/ProcessWire It actually needs to return the path based on the document root and not the path the symlink is actually pointing to. Obviously, this breaks everything thereafter! I normally develop PW under the MAMP document root but on this occasion, I built from an HTML mockup in my home directory subsequently pointing to it from the document root (as per the symlink specified above). If anyone has an idea whether it is possible to do what I want to do without upsetting PW, I'd appreciate it! Many thanks.
  14. Hello there, Does anyone know whether this module can be safely loaded with the latest PW V3? Ta!
  15. Hi @adrian - awesome! Thanks for keeping me in the loop. If Ryan has deemed it "beta", it's safe to say that it will me eminently useable Time to dive in!
  16. Hi there! Does anyone know the state of play with regard to ProFields and the Matrix Repeater field that was (I think) in Alpha? Cheers
  17. Hi @tpr, Thanks for the heads-up. The way you do it (jQuery/scroll) is the way I've done it in the past. I just didn't want to miss out on something that UIKit may have offered "out of the box". I checked the docs but saw nothing and, now I know why! Cheers!
  18. Hi there, You've probably seen the effect when a page loads with a header/navbar at a certain height, say 88px, and when the user scrolls down the page a little, the header/navbar animates a reduction in height to say 44px, often with a change of content or logo size. Do any UIKit users know how to achieve this in UIKit? I'm just playing around with UIKit for the first time. Any help/advice, very much appreciated! Thanks!
  19. Field templates are like natural, built-in "partials". I'm super-excited about the repeater matrix but the field templates are a superb, micro-optimization that will bind very specific output with a field type. I think this will make for a much more efficient way of building pages and especially so when those pages include repeater matrix fields. Very awesome and genuinely exciting.
  20. Hi @ukyo, I wondered whether you had an example of some the options that you pass to the image function. Also, could you comment on the lightbox parameter too? Many thanks!
  21. Hey @ukyo, Thanks for you great reply! Just out of interest, where are the functions buildSrcAndSrcset and buildAttrs found? Cheers!
  22. Hi there, Is there a standard approach in PW to building image markup with (at least) srcset and sizes? I saw the module by conclurer: Srcset Image Textformatter However, there are some use-cases that this doesn't cover and I'm not sure whether this module has "ran out of steam" (not much activity on the support thread or Github repo) ? Maybe PW 3 will provide this support in core? Any ideas or thoughts would be appreciated. Many thanks!
  23. Hi @rick You make some really good points, particularly regarding fine-grained associations and their impact on SEO. I really appreciate your thoughts on this!
×
×
  • Create New...