Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
improved formatting, removed appreciation
Source Link
mickmackusa
  • 4.8k
  • 4
  • 18
  • 48
   <fieldset name="basic" addfieldpath="/modules/mod_expandajaxreq/models/fields">
        <field name="request_url" 
            type="edrop" 
            label="MOD_EXPANDAJAXREQ_URL" 
            description="MOD_EXPANDAJAXREQ_URL" 
 
        />

When I click on the ear-btn-article-modal button a modal window opens. I need: 1.load a list of articles with a filter field and pagination into the modal window -<div id="ear-modal-body" class="modal-body"></div>. 2. when selecting an article, insert a link to the article in the custom field - <input type="url" id="ear_request_url" value="" autocomplete="off" size="30" >.
Please

  1. to load a list of articles with a filter field and pagination into the modal window:

    <div id="ear-modal-body" class="modal-body"></div>
    
  2. when selecting an article, insert a link to the article in the custom field

    <input type="url" id="ear_request_url" value="" autocomplete="off" size="30" >
    

Please tell me how to implement it?
Thanks in advance.

   <fieldset name="basic" addfieldpath="/modules/mod_expandajaxreq/models/fields">
        <field name="request_url" 
            type="edrop" 
            label="MOD_EXPANDAJAXREQ_URL" 
            description="MOD_EXPANDAJAXREQ_URL" 
 
        />

When I click on the ear-btn-article-modal button a modal window opens. I need: 1.load a list of articles with a filter field and pagination into the modal window -<div id="ear-modal-body" class="modal-body"></div>. 2. when selecting an article, insert a link to the article in the custom field - <input type="url" id="ear_request_url" value="" autocomplete="off" size="30" >.
Please tell me how to implement it?
Thanks in advance.

<fieldset name="basic" addfieldpath="/modules/mod_expandajaxreq/models/fields">
    <field name="request_url" 
           type="edrop" 
           label="MOD_EXPANDAJAXREQ_URL" 
           description="MOD_EXPANDAJAXREQ_URL" 
    />

When I click on the ear-btn-article-modal button a modal window opens. I need:

  1. to load a list of articles with a filter field and pagination into the modal window:

    <div id="ear-modal-body" class="modal-body"></div>
    
  2. when selecting an article, insert a link to the article in the custom field

    <input type="url" id="ear_request_url" value="" autocomplete="off" size="30" >
    

Please tell me how to implement it?

Source Link

Link to article in module

Good day. There is a custom field in my module mod_expandAjaxReq.xml

   <fieldset name="basic" addfieldpath="/modules/mod_expandajaxreq/models/fields">
        <field name="request_url" 
            type="edrop" 
            label="MOD_EXPANDAJAXREQ_URL" 
            description="MOD_EXPANDAJAXREQ_URL" 

        />

edrop.php

<?php
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;

class JFormFieldEdrop extends FormField
{
    protected $type = 'edrop';

    protected function getInput()
    {
        $document = JFactory::getDocument();
        $app = JFactory::getApplication();
        if ($app->isAdmin()) {
            $document->addScript(JURI::root()."modules/mod_expandajaxreq/assets/js/expandAjaxReq.js");
            $document->addStyleSheet(JURI::root()."modules/mod_expandAjaxReq/assets/css/expandAjaxReq.css");
        }
    
        $html = array();

        $html[] = '         <span class="input-append">';
        $html[] = '             <input type="url" id="ear_request_url" value="" autocomplete="off" size="30" >';                                                         
        $html[] = '             <button id="ear-btn-article-modal" class="btn btn-primary" type="button" title="Insert link to article" data-toggle="modal" data-target="#earModal"><span class="icon-file-add"></span></button>';
        $html[] = '         </span>';
        /*- Modal-*/ 
        $html[] = '<div  id="earModal" class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">';
        $html[] = ' <div class="modal-dialog modal-lg">';
        $html[] = '     <div class="modal-content">';
        $html[] = '         <div class="modal-header">';
        $html[] = '             <h4 class="modal-title" id="exampleModalLongTitle">Modal title</h4>';
        $html[] = '             <button type="button" class="close" data-dismiss="modal" aria-label="Close">';
        $html[] = '                 <span aria-hidden="true">&times;</span>';
        $html[] = '             </button>';
        $html[] = '         </div>';
        $html[] = '         <div id="ear-modal-body" class="modal-body">';
        $html[] = '         </div>';
        $html[] = '     </div>';
        $html[] = ' </div>';
        $html[] = '</div>';
        return implode( "\n", $html );
    }
}

When I click on the ear-btn-article-modal button a modal window opens. I need: 1.load a list of articles with a filter field and pagination into the modal window -<div id="ear-modal-body" class="modal-body"></div>. 2. when selecting an article, insert a link to the article in the custom field - <input type="url" id="ear_request_url" value="" autocomplete="off" size="30" >.
Please tell me how to implement it?
Thanks in advance.