Jonathan Lahijani

Members
  • Content count

    186
  • Joined

  • Last visited

  • Days Won

    4

Jonathan Lahijani last won the day on April 23 2015

Jonathan Lahijani had the most liked content!

Community Reputation

520 Excellent

About Jonathan Lahijani

  • Rank
    Distinguished Member
  • Birthday 04/24/1983

Profile Information

  • Gender
    Male
  • Location
    Los Angeles, CA
  • Interests
    Web Development, Snowboarding, Hiking

Contact Methods

  • Skype
    jonathanlahijani

Recent Profile Visitors

7,036 profile views
  1. I have a Page Reference field (ASM Select) and I am utilizing the "Custom Format" for the "Label field". However even the custom format itself is a bit limiting for a particular use case I have. Is it possible to hook into it and modify the output cleanly with PHP? I can't seem to find a proper hook. Somewhat related... it's possible to do this for the Tree page labels via ProcessPageListRender::getPageLabel.
  2. I just hit this same issue as well. My resolution was to break up my script into two separate files (first one deletes a bunch of pages, second one adds a bunch).
  3. https://deliciousbrains.com/craft-cms-self-hosted-wordpress-alternatives/ This article came out today. Delicious Brains is known for some popular plugins. I dropped a reference to PW in the comments. Perhaps others here can add to the discussion.
  4. Ryan has a habit of developing features we didn't even know we needed!
  5. +1 for WSL. It works wonderfully and has a lot of resources behind it. Getting better all the time.
  6. Atomic Design: http://bradfrost.com/blog/post/atomic-web-design/
  7. I tested out the new version and it works really well. Thanks @Robin S.
  8. Shouldn't it actually be this? $form->insertAfter($field, $form->getChildByName('tags'));
  9. Yea there's a trade-off here. Personally, I think inserting the IDs is the best route since IDs do not change (while text does). Unless there's a really fancy way to satisfy both needs through some sort of richer CKEditor widget?
  10. When making a new booking, you have the 'room' dropdown (well perhaps it should be "Rooms" since one customer may be able to book more than one room) as I described, however you obviously don't want to a room to be double-booked, meaning that dopdown should only show available/unbooked rooms. You can determine that by writing a custom query for that ASM-select field (using PW's Custom PHP Code feature). I think the selector would be something like (well you'd need to finish it off and also make it handle whether the current booking has a room selected): // this will find all the unbooked rooms of the selected boat $wire->addHookAfter('InputfieldPage::getSelectablePages', function($event) { if($event->object->name == 'rooms') { $booking = $this->pages->get($this->input->id); $cruise = $booking->cruise; $boat = $cruise->boat; $allRooms = $boat->children; $availableRooms = new PageArray(); foreach($allRooms as $room) { if( ! $this->pages->count("write query here to determine if the room has been booked") ) { $availableRooms->add($room); } } $event->return = $availableRooms; } }); Hope this helps.
  11. Sounds like you would want to handle 5 data types: boats rooms cruises customers bookings A boat I'm assuming has a fixed number of rooms. Perhaps start with a data model like this which takes everything into consideration: Boats (boats.php) Boat A (boat.php) Room 1 (room.php) Room 2 Room 3 ... Boat B Room 1 Room 2 ... Customers (customers.php) Customer 1 (customer.php) Customer 2 ... Bookings (bookings.php) Booking 1 (booking.php) Booking 2 ... Cruises (cruises.php) Cruise 1 (cruise.php) Cruise 2 ... Cruise template fields: title date boat (page-select to /boats/, boat.php) Customer template fields: first name last name (other typical fields) Cruise template fields: title boat (page-select to /boats/, boat.php) date Booking template fields: customer (page-select to /customers/, customer.php) cruise (page-select to /cruise/, cruise.php) rooms (based on cruise->boat, select for the rooms that the boat has) I'm assuming the interface would be PW's admin. Perhaps use some hooks and ListerPro to tie it all together. Make it as user-friendly as possible. Maybe have a page within the admin outputs each cruise with which rooms have been booked vs. unbooked which would be friendly to the site admins.
  12. To what extent are you storing a customer's information as part of booking a room? Or do you simply just need to indicate whether a room is taken?
  13. The page exporter/importer sounds very exciting. I think it would be pretty slick if you can choose access the export/import action from within the page tree itself (next to the new, edit, view etc. page action buttons). I'm also curious to know how merging would occur and the options around it. Can't wait!
  14. Let's say you're doing a redirect like this in your template: $session->redirect( $pages->get("/some-page/")->url ); Would halting be good practice after redirecting or does it not make a difference? return $this->halt(); It wasn't clear in the blog post that introduced halting: https://processwire.com/blog/posts/processwire-2.6.8-brings-new-version-of-reno-admin-theme-and-more/#new-this-gt-halt-method-for-use-in-template-files
  15. @adrianmak I would strongly consider you don't put divs in CKeditor fields as this is a very fragile and error-prone approach. My solution to this is either (a) use HannaCodes to represent opening and closing of divs or (b) use RepeaterMatrix.