Jump to content

Kurbel

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by Kurbel

  1. Hey, I'm in the process of coding an event page, which will display reoccuring events (think: a monthly event with roughly the same itenerary every iteration, but potential for changes). When an editor creates a new event page, I'd like the values for certain fields prefilled with custom values defined elsewhere. I've toyed around a bit with both hooks and custom page classes, but did not get to a working solution. Hooking into "Pages::savePageOrFieldReady", I can set the values on first save, which is not too bad and somewhat close to the feature I had in mind. I would've thought that "ProcessPageEdit::buildForm" would work for prefilling the form, but the event object honestly left me a bit flabbergasted. How do I access the single fields, check for empty and fill the values if possible? With custom classes I'd have thought I could set the values in the constructor but this does not change anything in the form with a newly created page. Seems the constructor is not even called. So, what am I missing? ? P.S.: Why am I not setting the default values during render? Ideally I'd like the single events not to change anymore after being edited.
  2. Hey, this is a bit of a long winded and rather general question and I'm not sure if it fits into this category. I'm in the process of developing a little sideproject with NuxtJS and Tailwind, however I feel slightly (read: very much) frustrated because the entire ecosystem seems to explode constantly and everything is broken all the time. /rant over So I'm thinking about switching the entire thing over to Processwire and start from scratch. What I did like however is the approach of having reusable components (like a button, a hyperlink, ...) and using those to compose bigger elements (e.g. a teaser, a tile, ...). That's probably the one thing about Vue + Tailwind that I loved really. In principle this seems to be archivable with $files->include() , e.g. so I'd include a teaser, which would then include a button, a headline and a text... However how do you make the entire thing typesafe or at least have some kind of fail early and useful typehints? Define value objects for everthing? Am I overthinking this entire thing? How do you people manage more complex setups without losing your mind? ?
  3. Hi Guys, is the ColorPicker Fieldtype not working inside a repeater a known issue? I have pretty much this setup, apart from that everything is very vanilla. Field works fine embedded inside a template, however wrapped in a repeater it's not usable inside the backend. Didn't find this issue documented anywhere. In this case I'm switching to predefined color schemes (via select menues) so it's not a huge deal atm, so I'm just curious. Obviously haven't looked into the code at all, gut feeling is this is somehow a jquery selector issue... Cheers, Kurbel
  4. Hi Guys, something I'm wondering about: is there any easy solution to show the template (or template label) within the page tree in the backend. The reason I'm asking is because we have a page tree consisting of many different pages and templates on the same level. For editors it would be nice to be able to see what template each page has without having to navigate into the page... Cheers, Kurbel
  5. Hi Guys, i think I might have run into the same Issue. I've build an AJAX Uploader that returns a thumbnail for a larger Image by attaching the image to a post and giving back $page->image_field->height(200)->url. However with increasing file sizes at some point there's only invalid images getting generated on the live system (externally hosted, so no direct control over php settings). php ini_get('memory_limit')) shows me 64M on the live system. When doing this on my local DEV-System peak memory usage is around 11MB and it works. So in theory everything should be fine on LIVE as well. getimagesize() for the image in question returns: { "0":3543, "1":2365, "2":2, "3":"width=\"3543\" height=\"2365\"", "bits":8, "channels":3, "mime": "image\/jpeg" } When I just have checkMemoryForImage() always return true, no matter what the actual calculation, the images get resized without any problem. Obviously this is not a solution that I'm very happy with, since the client will probably just feed the uploader images until php crashes against some kind of other memory limit. However right now I need to makes this work at least for images around these specs. So I guess the question is how do I make this work without running the risk of a catastrophic failure. Cheers.
  6. Hi Guys, I think I might have circumvented the whole issue. However, in case somebody runs into something like this or somebody has a better idea how to go about it, here's what's the situation: - I have content pages, that have content, which should be searchable. - I also have widgets that get rendered in the context of content pages (basic echo $widget->render()) and should also be searchable. However in case a widget matches the query I need to return the page or pages that do reference this widget. Originally I thought I just loop through all the pages, one by one. If the original page matches it get's thrown into an array for further reference, if not the loop continues through all the referenced widgets. This has the drawback, that a) I never got it to run and b) it probably won't perform as well, since the widgets will get parsed more than once if they are referenced on more than one page. The new Idea is to first search through all pages that have a page template via $pages->find() and then do the same with all widgets. For every widget that is found find the pages where it's referenced and throw those into the $matches array. Last step: Remove the duplicates. Cheers, Kurbel
  7. Hi Guys, I'm building a custom search function, that needs to loop through certain pages (selected by template) and check fields for a string. I thought this would be easy with $p->get("title|headline|copy|sidebar~=$q"); (where $p is a page object and $q a query string). Somehow this always returns true. What am I missing here? Cheers, Kurbel
  8. Sounds cool, I'd love to have that fixed. I think it would be a killer feature from an editor's point of view.
  9. Hi Guys, I was just in the process of building a site where I was going to use field dependencies in a Repeater. Since then, I learned that it's not supported. The Idea was to have a Repeater with a list of radio buttons (page relation field) where editors could choose a content type for this specific element inside a repeater (e.g. Video, Text, Image Gallery, ...). The repeater would also contain all the fields necessary for the possible content but would just show the field for the specified content. A single page inside the whole side would then be made up from this repeater and could contain all the content in a flexible order. For example you could start with a text, add a gallery, more text, a video and in the end some teasers to additional content. From the point of user experience I thought it was really neat and easily comprehendible for editors. Unfortunately it shall not be - at least at the moment. Of course the principle mechanism (e.g. a Repeater with different kinds of content) still stands but right now it looks a bit messy in the backend. Any ideas on how I could implement something with the same level of neatness? Cheers, Kurbel
  10. Just chiming in to say I've run into the same problem. I'd love to see a fix for this, since I consider inputfield dependencies a killer feature from a usability standpoint! Since the Issue was closed I thought I'd ask here: Is support for dependencies inside a repeater actually planned for a future release?
  11. Kurbel

    Hanna Code

    Hi, first of all: I think the addition of this particular module is great! I can think of quite a few itches I could scratch with that. Something I've been wondering about: How would I go about accessing specific repeater fields with the Hanna Code. Say for example I have a repeater including a Text field, a Date and a Price. I'd fill the text Field with Come on the [[date]], bring [[price]]$ in small used bills. Thank you for your cooperation. The frontend should obviously render this as If Text, Date and Price where just page fields, this would be pretty obvious. However for them being fields inside a repeater I think there's something like the jQuery siblings selector needed, but I don't see anything like that in the api documentation. Any input on this would be very much appreciated
  12. Hello, I'm trying to get a custom style to show up in my TinyMCE. In the settings for the field I've defined a custom editor.css, that includes a new class, like so: .test { display: inline-block; width: auto; background-color: blue; } and the "Additional TinyMCE settings" for the field have a theme_advanced_styles: theme_advanced_styles:test=test However the style doesn't show up in the dropdown for the available styles. Is there any additional steps required? Never had to change the TinyMCE configs so far, so I'm a bit at a loss what's missing. Cheers!
  13. Hello, no idea how that happend, but for some reason it seems to work all of a sudden. Problems magically disappearing into thin air. Nice way to start the year!
  14. Hi Guys, I'm new to ProcessWire and really like it. I developed a few Wordpress Templates for Customers and Friends, finally got feed up with it for sites that are not blogs and decided I need something more flexible but not more complicated. So far PW does seem to fit the bill quite nicely However I've run into a problem that I can't get my head around and by now I'm not sure if it's am Issue with my jQuery or my PW or something in between. Consider this Code: jQuery: $(document).ready(function() { $("#button").click(function(){ $.ajax({ type: "POST", url: "news-fetcher/", data: { start: 1, end: 5 }, success: function(data,status){ alert(data); } }); }); }); news-fetcher, this template: <?php $start = $input->post->start; $end = $input->post->end; echo "Start: $start End: $end"; ?> For some reason - that I can't figure out for the live of me - both input variables end up empty. Things I checked so far: - URL returns a 200 OK status code - news-fetcher.php is a template - jQuery is loaded and working - response get's returned, alert is triggered - custom post request (Postman Chrome extension) returns the same result I'm sure it's something blatantly obvious that's awry here, but for whatever reason I'm entirely unable to find it. After staring at this problem for quite a few hours, every input would be very much appreciated! Cheers, Kurbel
×
×
  • Create New...