Skip to main content
Added image to show frontend
Source Link
RustyJoomla
  • 2.1k
  • 4
  • 25
  • 33

I am trying to develop a custom module where I have options to select 4 different Joomla articles.

In my module XML file, I have the following:

<field name="articleOne"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/> 

<field name="articleTwo"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

<field name="articleThree"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

<field name="articleFour"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

I can get this to output the ID in the frontend, which is loading the ID. But how can I output the title, introtext and image?

I would like it to display in the frontend as follows:

enter image description here

I am trying to develop a custom module where I have options to select 4 different Joomla articles.

In my module XML file, I have the following:

<field name="articleOne"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

I can get this to output in the frontend, which is loading the ID. But how can I output the title, introtext and image?

I am trying to develop a custom module where I have options to select 4 different Joomla articles.

In my module XML file, I have the following:

<field name="articleOne"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/> 

<field name="articleTwo"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

<field name="articleThree"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

<field name="articleFour"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

I can get this to output the ID in the frontend. But how can I output the title, introtext and image?

I would like it to display in the frontend as follows:

enter image description here

Updated the text
Source Link
RustyJoomla
  • 2.1k
  • 4
  • 25
  • 33

I am trying to develop a custom module where I have 4 options to select a4 different Joomla articlearticles.

In my module XML file, I have the following (there are for for each field but they're the same with an updated field name):

<field name="articleOne"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

I can get this to output in the frontend, which is loading the ID. But how can I output the title, introtext and image?

I am trying to develop a custom module where I have 4 options to select a different Joomla article.

In my module XML file, I have the following (there are for for each field but they're the same with an updated field name):

<field name="articleOne"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

I can get this to output in the frontend, which is loading the ID. But how can I output the title, introtext and image?

I am trying to develop a custom module where I have options to select 4 different Joomla articles.

In my module XML file, I have the following:

<field name="articleOne"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

I can get this to output in the frontend, which is loading the ID. But how can I output the title, introtext and image?

Source Link
RustyJoomla
  • 2.1k
  • 4
  • 25
  • 33

Show article details from custom module

I am trying to develop a custom module where I have 4 options to select a different Joomla article.

In my module XML file, I have the following (there are for for each field but they're the same with an updated field name):

<field name="articleOne"
    type="sql"
    label="Select an article"
    query="SELECT id AS value, title AS articleOne FROM #__content"
/>

I can get this to output in the frontend, which is loading the ID. But how can I output the title, introtext and image?