darrenc

Members
  • Content Count

    45
  • Joined

  • Last visited

Community Reputation

20 Excellent

About darrenc

  • Rank
    Jr. Member
  1. darrenc

    To echo what @cstevensjr @dragan are experiencing, I get the same issue when trying to install the module via classname. I opened a github issue about it. However, I was able to install successfully by using the zip file link and providing the github repo master.zip url https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip Hope this works for you guys too. Thanks @blynx!
  2. ahhhhhhhhhhhhhhhhhhhhh great! thank you kindly @adrian
  3. lets say, in _main.php I have some placeholder regions for content/sidebar <div id="content">foo</div> <div id="sidebar">bar</div> in my home.php template, maybe i don't want the sidebar div at all. But when I put in the intentionally blank code <region id="sidebar"></region> I simply make my sidebar div blank, it doesn't remove it. Q: Is there a slick way to simply nuke that div#sidebar entirely from markup?
  4. darrenc

    In my map I want to turn the clustering off. What's the simplest way?
  5. I'm trying to understand how I could have users log in as "members", provide them with a customized experience, but still serve them cached pages? For example let's say I have 3 roles Guest Member SuperUser And let's say I have a NavBar type component that has a menu. Plus it has "log in!" if guest, or "logged in as Mike Smith" I would want guests to see a cached site with guest-only page access. Members should also see cached pages, but their menu may have access to members-only pages or fields or information. Furthermore they might have a "logged in as Mike Smith" element. SuperUsers can stay uncached. How does one go about creating that cache so that visitors aren't constantly re-creating the menu? Or that when "Sally Baker" logs in, she doesn't see a homepage that is cached for "Mike Smith" with all his elements? Thank you in advance for any replies.
  6. frequently i do something like the following expanded simple version.... foreach ($foos as $foo) { // always a title & link $title = " <h1 class='foo__title'> <a href='{$foo->url}'> {$foo->title} </a> </h1> "; // sometimes a headline $headline = NULL; if ($page->headline){ $headline = " <h2 class='page__headline'> {$page->headline} </h2> "; } echo " <div class='foo'> $title $headline </div> "; } the short take away is that i... know certain fields will exist, and i want to wrap them in specific tags/classes have fields that might exist, and i want to wrap them in specific tags/classes or output nothing silently want to wrap all of the output Probably due to inexperience, I haven't found a slick way to simplify this pattern for myself. Using a function and arguments seems very messy to me because it can get complicated to maintain as pieces need to change. maybe I just write crappy functions. Do you guys have a very maintainable way to output a fields value, always wrapped in specific tag/class, but only if it exists?
  7. @abdus that's an approach i'm not at all familiar with, thanks very much i'll experiment with it. @fbg13 interesting, I wonder why that is done.
  8. <?php namespace ProcessWire; class Foo {}; $foo = new Foo; $foo->message = "hello world"; function print_foo() { global $foo; print_r($foo); } print_r($foo); // success print_foo(); // nothing ?> In any template file, or init, the above code doesn't pull $foo into the function's local scope. It seems to not exist even though I'd fully expect it to be there. Does anyone have insight into why this happens or how I should be approaching it?
  9. darrenc

    OHHHHHHHHHHHhhhhhhhhhhhhhhhhhh. God, I feel dumb but honestly I was totally perplexed by that. Thank you so much LMD. I will try it out and see.
  10. What I did edit the default 'body' field (textarea, ckeditor) field > body > input: "enable ACF" checked "yes" by default field > body > input: "extra allowed content" ... The instructions indicate "Example: img[alt,!src,width,height]" in order to enable a tag with attributes you want to allow through the filtering. a[class] I wrote the above expecting that now i would be able to class my a tags in the editor, maybe make one a "button" style or whatever. However, this doesn't actually work as it seems Extra Allowed Content doesn't actually do what it indicates. I've tried a dozen different variations and after googling here and seeing some responses in other threads, I think this should be addressed. The box is a nice way to enable a few attributes the user might want to allow for clients or themselves, I don't see why one would require making a module or going above and beyond the tools and text areas already provided in order to simply allow a few attributes. I could turn ACF Off entirely, but that doesn't really address the problem: I want to filter the input for clients but still configure some tweaks that I deem would enhance and not break the site. Simply: it's there, it's nice to have, should work right, but it doesn't seem to. Help?
  11. Is it possible to make a page field, that outputs options based on what a user has selected in a previous page field? Template data setup house (template) title (text) body (textarea) neighborhood (page field) neighborhood (template) title (text) Obviously it's set up with lots of neighborhood pages, and if you create a house you get a dropdown of those neighborhoods which you can select. What I want to do featured_neighborhood (template) title (text) body (textarea) neighborhood (page field) homes_in_neighborhood (page field) The goal would be for the user to create a new featured neighborhood, choose the neighborhood reference, and then homes_in_neighborhood would be a selection dynamically created from whatever neighborhood that is. Is this possible in PW? Thanks in advance!
  12. Thanks so much Robin, that definitely does work for me as well. I wish I understood the "why" of this a bit better (the array weirdness, and why ready.php worked differently from the module when not hard-coded), but I guess I'll plow ahead and return to this later. Thanks again for your help.
  13. Thanks Robin, I'm sort of confused why that mattered but you're right that I now have a proper multidimensional array... However now, upon upload, the image sizes get created but the upload thumbnail continues to hang in the "working" state http://imgur.com/a/ZkWco I can't save the page and obviously a reload dumps the images. Any thoughts? My code: // return empty array if not set $sizes = isset($this->config->imageSizes) ? $this->config->imageSizes : []; // loop through the sizes and create the images if (count($sizes)) { foreach ($sizes as $size) { $image->size($size["width"], $size["height"]); } }
  14. Somatonic made a module to make image variations, of a custom size, upon uploading them. https://gist.github.com/somatonic/5685631 It works great but it has values hardcoded into the code. $image->size(120,120); $image->size(1000,0); I thought that it might make sense to use the config.php to create a multidimensional array for my thumbnail sizes, that way I could reference them from the module as well as my template. // in config.php $config->imageSizes["foo"] = ["width" => 12, "height" => 34]; $config->imageSizes["bar"] = ["width" => 56, "height" => 78]; But back in my module, when I try to loop through $config->imageSizes or $this->config->imageSizes I seem to get absolutely nothing. I'm also not the best programmer so I'm having a hard time figuring out how I can debug something like this that only fires when an image gets uploaded - I tried wire("log")->save("debug", $myOutput) which could be not the best move. Any help appreciated - the goal is to have one reference set of sizes and then be able to refer to it in the module as well as my templates. Thanks!
  15. Ohhhh very interesting. Thank you very much Martijn. Great answer.