Jump to content


  • Posts

  • Joined

  • Last visited

Lumi's Achievements


Newbie (2/6)



  1. Thanks. Wondering, though, whether it would be sufficient to just write it in one line as $event->return->sort("sorting_field"). Reassignment in the third line looks redundant to me unless the $event->return does a deep copy. Cannot test this now, will have to make a PW installation I can play with. HookEvent class - ProcessWire API - This looks like the place it would be documented, but the $event>return method doesn't have a doc page of its own yet.
  2. Thank you all for your help. It has solved the problem. The CSS trick works and so does the $repeater->sort('-created') method. I misread 'ctime' for 'created' which is why it didn't take effect at first.
  3. Thank you, @Gideon So. This does not produce the desired result, neither with "-ctime" nor with "ctime". The whole point of the Repeater seems to be to arrange the fields via the editor in an arbitrary fashion. Sorting would obviously run counter to that. Maybe that's why it does not take effect in this case.
  4. My post was incomplete. There are two sides to the problem. The customer adds the video in the back office page. The button and the new video appear at the bottom. I don't think this is annoying them. What they disapprove of is the result: The new video is hidden at the bottom of the page where no one ever scrolls to. So each time they add a video they drag it to the top. About two dozen times so far. I found out (via FTP access) that there is a template file that is responsible for the resulting page as it is displayed to the site's user. I added the CSS and it works fine. So this problem is solved. I only have to flip the order of the two dozen items, reverting the customer's painstaking dragging, because otherwise the oldest video would be at the top. Still, there might be comments, for example, what element would have been better suited than the repeater to meet the customer's not so unusual need to have the newest item appear at the top …
  5. I'm new to PW and have just been asked to solve a UX problem on an existing customer installation. There is a Repeater (Version 1.0.6) element (of Youtube videos), and you can arrange them as you see fit, and there is a button at the bottom to add a new video, which happens once a month. The customer is annoyed that the new item is added at the bottom and not at the top. They don't want to have to drag it to the top when the monthly update is due. UX wise, they have a point. Now, I did find a solution in this forum, which involves CSS to be added to the parent element of all the videos: element.style { display: flex; flex-direction: column-reverse; } This will put the button at the top and also display the new video at the top as required. The problem is that there is a <div> element missing as a parent for just the videos. Now my problem must be one of the most basic problems that there can possibly be in PW: What are some ways (clean preferred, but will do dirty if necessary) to add this missing wrapper element that will allow me to include the CSS that will solve the problem?
  • Create New...