0

I'm looking to add a Component field which will display a list of Joomla users who have a relationship with current the Component item.

Below is some sample XML where by I would like [current component id] to be populated dynamically by the current component ID.

<field name="type" type="sql" query="SELECT id, name FROM #__users u JOIN #__customtable c ON u.id = c.user_id WHERE c.component_id = [current component id]" key_field="id" value_field="name" required="false" label="..." description="..." hint="..." />

Is this possible?

1

Not in the XML file as you have it - you'll need a custom field for this. You can then easily get your component item's id from the jinput and built your sql with that.

Doc on making a custom field

  • @Sean is this an "acceptable answer" or do you need something more? Please always endeavor to progress your questions toward a clear resolution. – mickmackusa May 27 '18 at 5:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.