preselect with variable $this->lists['main_category_id']

  • Starker
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #140949 by Starker
Hello everyone, in the file "simple.php" there is the entry "echo $ this-> lists ;". How can I use a variable (e.g. $ area or category ID) to pre-select existing elements? I can't find a solution. Can you help me? Karsten

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #140956 by Tuan Pham Ngoc
Hello

I guess you create a menu item to link to Submit Event - Simple Layout menu option? In that menu item, there is a parameter called Default Category. Select the category you want there and it should work as expected

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Starker
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #140965 by Starker
Good morning Thuan, thank you very much for your quick reply. It's a little different. I work with OS Service Booking and Event Booking. We link both with one another. For our project, that makes more sense than just a solution. In this way, data is transferred directly to simple.php (create a new appointment) to pre-fill the form. That works great, only with one point I don't get any further.  The category that was transferred with the category ID or name should be preselected. I can't find a solution. Best regards, Karsten

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #140975 by Tuan Pham Ngoc
Hello

Could you please explain more details about the issue you are having?

Maybe give me URL of the page which you want the category to be pre-selected so that I can understand your actual request and guide you with a solution?

Tuan

Please Log in or Create an account to join the conversation.

  • Starker
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #140977 by Starker
You can find our website at jamidoo.com . When a passenger makes an appointment request, the pilot can see it in an overview. The passenger requests a specific flight region and time. From the overview, the pilot can go directly to "Event Booking" and create a new appointment. This means that other passengers can also book directly for the appointment. In the form "simple.php" (... templates / worldbiz / html / com_eventbooking / event / ..) there is the entry "echo $ this-> lists ;" This shows the categories, in our case the flight areas. If the data is transferred to the simple.php, the correct selection should also be made here. That's my problem. I hope I could explain it clearly.

Karsten

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #140981 by Tuan Pham Ngoc
Hello

Maybe you can get this file, unzip it, upload the received file to components/com_eventbooking/view/event folder on your site

Then you can pass ID of the category you want via main_category_id variable URL. For exampel domain.com/submit-event-url?main_category_id=10 will make category with ID = 10 selected on that page

Tuan
Attachments:

Please Log in or Create an account to join the conversation.

  • Starker
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #140991 by Starker
Thanks for your answer Tuan. Unfortunately it wasn't working. I tested again. The data is transferred to the simple.php and inserted into the fields. This is not a problem. Only the pre-selection of the category (dropdown: echo $ this-> lists ) does not take place. But when I edit an existing event, the preselection takes place. It's complicated, but the solution is probably very simple. I just can't find it. ;)

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #140998 by Tuan Pham Ngoc
What's the URL of the page which you tried?

Tuan

Please Log in or Create an account to join the conversation.

  • Starker
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #141004 by Starker

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #141007 by Tuan Pham Ngoc
No, I need the link which you redirect users to submit event form. I want to check that link and make sure you pass the main_category_id properly in the URL

Tuan

Please Log in or Create an account to join the conversation.