In Joomla! you can change the code of the landing/default page with template overrides. While adding HTML elements and classes is an easy task, I can't figure out two things:
- add options to the menu item
- add a contact form
1. add options to the menu item
If you override the "featured" layout of the content component, basically you have a simple blog layout. I rather would like to define 5 articles that are used for different purposes on the page.
For example:
article_col1: article-1
article_col2: article-2
article_col3: article-3
article_description: article-4
article_contact: article-5
Can I do this and how?
edit 2015/09/03:
I understand that I need to change the XML file describing the menu item type and its parameters. For now I copied the 'featured.xml' and added the request section from 'article.xml':
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_content/models/fields">
<field name="id_contact" type="modal_article"
label="COM_CONTENT_FIELD_SELECT_ARTICLE_LABEL"
required="true"
edit="true"
clear="false"
description="COM_CONTENT_FIELD_SELECT_ARTICLE_DESC"
/>
<!-- and some more article fields -->
</fieldset>
</fields>
Thus I can assign articles to the menu item now.
But how can I access and display them in the layout file?
I can see that the intro articles are accessed via $this->intro_items. Unfortunately $this->id_contact->text doesn't work. Do I have to tell Joomla to load the articles from the database somewhere somehow?
2. add a contact form
If I can set, access and display these articles, I could use a plugin to show the contact form in one of the articles. However, I know that I want to show the contact form of a single contact at my landing page and a plugin for this very single case seems overkill to me.
Is there a way to include the form via PHP code?