Jump to content


JReviews is the best selling Joomla Reviews Component and WordPress Reviews Plugin. It's also in a class of its own as a Business Directory.
Photo
- - - - -

Passed listing id and owner id to ajax function


  • Please log in to reply
4 replies to this topic

#1 Roland

Roland

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 14 April 2017 - 01:17 PM

Hi,

Just a quick question with regards to formbuilder schema.

Is there a way  to retrieve current listing Id  and owner Id in ajax function.

Im looking for a way to passed listing_id and owner_id to ajax_function.php

My schema is
...
"$ref": "DEFINITIONS_PATH\/ajax_function.php"
...

Best Regards,

Roland



#2 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 15 April 2017 - 09:49 AM

It's not possible. Also, the listing id is not available when submitting a new listing because it hasn't been set yet. What exactly are you trying to do? Maybe it would be possible to allow using some tags in the definition that get automatically replaced when the schema is loaded, but I need to have more information first before we add this as a potential task to our to-dos.



#3 Roland

Roland

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 15 April 2017 - 01:11 PM

Hi Alejandro, Thanks for the prompt reply.
I only need the listing id and owner id when updating a listing
This is what i'm trying to do :

The idea is that we can call a jreview controller function in ajax_function.php to select related informations (related to listing_id or owner_id)  and display them in formbuilder fields.  use owner_id to select related informations in others components.

Let say listings are Events, we can use use formbuilder schema to create Artists and use this technique to select Artist image (in current listing).



#4 Alejandro

Alejandro

    Advanced Member

  • Administrators
  • 31940 posts

Posted 15 April 2017 - 06:30 PM

Is there a reason you can't use the related listing custom field and detail page widgets for this purpose? Do you already have the code in ajax_function.php to simulate what you want to do assuming that you do have the values you need? That file is outside of Joomla so you wouldn't be able to do it so easily, I don't think. 

 

After looking at the code adding the automatic tag replacement is not so obvious so it's important that you try to use existing functionality so we avoid spending development time working on something just for one very specific need. If you want to try it the file you need to change is /components/com_jreviews/jreviews/views/helpers/custom_fields.php



#5 Roland

Roland

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 27 May 2017 - 08:39 AM

Related listing is the best solution but you can not create listing and related listing in on step. Let say you have one events with 5 artists : you have to create 6 listings.
I will try tag remplacement in  custom_fields.php/custom_fields.php
Thanks for your help






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users