Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JEM in Joomla 3 with joomla's custom fields #86

Open
jojo12 opened this issue Feb 13, 2020 · 2 comments
Open

JEM in Joomla 3 with joomla's custom fields #86

jojo12 opened this issue Feb 13, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@jojo12
Copy link
Collaborator

jojo12 commented Feb 13, 2020

Hi, I tried to implement joomla's custom fields into JEM. And I succeeded in some (first) way. :-)

  1. For the backend I inserted in /helpers/helper.php in addSubmenu:
    ` if (JComponentHelper::isEnabled('com_fields') && JComponentHelper::getParams('com_jem')->get('custom_fields_enable', '1'))
    {
    JHtmlSidebar::addEntry(
    JText::_('JGLOBAL_FIELDS'),
    'index.php?option=com_fields&context=com_jem.event',
    $vName == 'fields.fields'
    );

    	JHtmlSidebar::addEntry(
    		JText::_('JGLOBAL_FIELD_GROUPS'),
    		'index.php?option=com_fields&view=groups&context=com_jem.event',
    		$vName == 'fields.groups'
    	);
    }`
    
  2. Then I added in access.xml the code you find here
    and in the
    <section name="component"> <action name="core.edit.value" title="JACTION_EDITVALUE" description="JACTION_EDITVALUE_COMPONENT_DESC" />

  3. in the config.xml I added:
    ` <fieldset
    name="integration"
    label="JGLOBAL_INTEGRATION_LABEL"
    description="COM_JEM_CONFIG_INTEGRATION_SETTINGS_DESC"

     <field
     	name="custom_fields_enable"
     	type="radio"
     	label="JGLOBAL_CUSTOM_FIELDS_ENABLE_LABEL"
     	description="JGLOBAL_CUSTOM_FIELDS_ENABLE_DESC"
     	default="0"
     	class="btn-group btn-group-yesno"
     >
     	<option value="1">JYES</option>
     	<option value="0">JNO</option>
     </field>
    
    `

With that I can enable/disable integration of joomla custom fields in JEM (in Options)
In backend I see now in the submenu "Fields" and "Fieldgroups".

I created a new field and saved. Then I created a new event. Under the Description field there's a button "Fields". Clicking on it I can choose a (this) custom field in a modal window.
When I look in Frontend, I see in the description content the content of my created custom field.

I tried with text, calendar. Will try with more.

@jojo12
Copy link
Collaborator Author

jojo12 commented Feb 13, 2020

It only works in event. I see the view.html.php of event has onContentPrepare.
When I look into view.html.php of venue there's no onContentPrepare.

@jojo12 jojo12 added the enhancement New feature or request label Feb 13, 2020
@jojo12
Copy link
Collaborator Author

jojo12 commented Feb 14, 2020

My question:
If I proceed like described, I get a field-button to insert a field in the description,
But "how to do" for the field tab above the description in the editevent-view?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant