I am developing a Joomla 2.5 component. So I'm using Hello world example component for reference... In the edit view of the admin back end
<?php foreach($this->form->getFieldset('details') as $field): ?> <div>
<?php echo $field->label; echo $field->input;?> </div>
where the array $this->form->getFieldset('details') is stored.. and how to add new fields to the form that will store the data to another database table. where to change the fielda of the forms.
If you need to add more fields in your form then you can add new field in to the helloworld.xml browse to the following file on to
administrator->components->com_helloworld->models->forms->helloworld.xml
Open this file you will find the number of fields are listed over there you can add your own field by copy any of the field and rename it as you want.
You can also refer this link : J2.5:Developing a MVC Component/Adding backend actions
For example you want to add description field on to your form then you just need to add this line between the fieldset tag.
<field
name="description"
type="text"
label="COM_HELLOWORLD_HELLOWORLD_DESCRIPTION_LABEL"
description="COM_HELLOWORLD_HELLOWORLD_DESCRIPTION_DESC"
size="40"
class="inputbox"
default=""
/>
I would prefer you first read full tutorial of how to create MVC component for Joomla.Then you would be able to know how it works. Here the link :
J2.5:Developing a MVC Component/Developing a Basic Component
You may also use different form field type : Form field
Related
We are on Sitecore 8 using Web Forms for Marketers.
I am trying to identify how to add information to the "display-section-info" class item in a sitecore WFFM form. Looking # The generated code I see an element (display-section-info class) after the Field Legend, and before the starts of our fields. I would like to put some basic information regarding the fields in this element (below has text "THIS IS WHERE I WOULD LIKE TO ADD TEXT").
Here is the source from "View Source" on the browser. Through developer tools I plugged in some info and that is exactly where I want it to go.
<fieldset class="display-section-fieldset">
<legend class="display-section-legend">1. OUTSIDE INTEREST:</legend>
<p class="display-section-info">THIS IS WHERE I WOULD LIKE TO ADD TEXT</p>
<div class="display-section-content">
<div class=" field-border">
<span class=" field-title">
<span class=" field-required">*</span>
In the field below, list exceptions
</span>
Update1:
per Jammycans response I added a few parameters to the section but did not seem to display. items have been published, I also confirmed on the prod DB.
Content Editor
Results:
Thanks in advance
There is no field in the Form Editor to set this information, you can set it directly on the section item itself.
In the Content Editor, expand the form and select the Form Section item. On the section item in the Parameters field set the information field text you need:
<Information>THIS IS WHERE I WOULD LIKE TO ADD TEXT</Information>
You can use the Localized Parameters field if you need to translate the text.
EDIT:
There is a bug in the logic on the default WFFM section view, located in \Views\Form\EditorTemplates\SectionModel.cshtml (for Sitecore 8 update 5 and earlier). On lines 18-21, the code reads:
#if (string.IsNullOrEmpty(Model.Information))
{
<p class="#Model.CssClass display-section-info">#Html.Sitecore().Field("Information", Model.InnerItem)</p>
}
The first line here should read:
#if (!string.IsNullOrEmpty(Model.Information))
Note the "!". That explains why you were seeing the markup previously, even though the parameter was not set. You need to update the code in the view in order to fix it.
I created a form which works if I add it as control to Presentation --> Details. What I need to do on another page is inserting the same web form as a web control like this:
<wffm:FormRender FormID="{72857A3A-B6C5-48C0-995B-FA053C82870F}" runat="server" />
The form is shown on the page, but the validations report not filled fields, although they are filled.
Am I missing something?
There you go. This is what you need to do.
<wffm:FormRender FormID="{72857A3A-B6C5-48C0-995B-FA053C82870F}" FormTemplate="/sitecore modules/web/Web Forms for Marketers/Control/SitecoreSimpleFormAscx.ascx" runat="server" />
Im trying to bild a joomla component where the user can choose two options (for example yes/no).
Joomla has the possibility to add grouped buttons through an XML file with radio & class "btn-group btn-group-yes-no". However it is also possible to add a form list through JHTML: JHTML::_('select.genericList', $publish, 'published', ' class="inputbox" '. '', 'value', 'text', published)
I can't find it anywhere on the internet, so i think its impossible through JHTML. I want to add a btn-group through JHTML...
Thanks for your effort!
Ron
If you're trying do it for Joomla! 3.x you should just write at the XML file like this:
`<field name="enable_quantity" type="radio" class="btn-group" default="0"
label="Enable quantity"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>`
It's valid with using JForm editing model.
I have followed the steps in the following link Template Settings and created custom templates for Entry, Comment and Category. To the Custom Entry Template, I have added an additional field. I have a requirement to display it in the Categories.ascx. I am able to override the Categories.ascx but I am unable to get the value of the added field using WeBlog's API. Here's the code that I am using. But the issue is that the Class EntryItem doesn't have the additional field that I have added. Is there a way to read this field using WeBlog API?
EntryItem[] blogEntries = ManagerFactory.EntryManagerInstance.GetBlogEntries();
EntryItem inherits from CustomItem I believe, so you can use the InnerItem Property to get access to the actual Item. Your field should then be available like this:
entryItem.InnerITem["YouField"];
You can use a field renderer in the Categories.ascx file to display the value of you field and use data binding to get the item assigned to the field renderer.
<sc:FieldRenderer ID="FieldRenderer1" runat="server" FieldName="YourField" item='<%# entryItem.innerItem %>'/>
In Categories.ascx you can add this code to render the new field on the front-end:
<sc:FieldRenderer FieldName="Your New Field Name" ID="frNewField" runat="server" />
Then in the C# code-behind, add this code to data bind the front-end field renderer to the entry item's underlying Sitecore item:
frNewField.Item = entryItem.InnerItem;
It's possible to customize the template for different types of content... for example, on homepage: 1 column, on category listing: 2 columns, on single article: 3 columns. In Wordpress it's quite easy, modifying home.php, category.php, single.php.
With what conditionals I can accomplish this in Joomla 1.5?
Thanks
You can conditionally display modules on a page by page basis (based on menu item). You can also assign completely different templates to each page. Furthermore, you can do things like
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
within your index.php and change the page based on the view/component.
Joomla's templating is excellent, with a lot of flexibility.
If only one column contains the real content (componenent/article) you could also work with collapsible module positions. Like this:
<?php if($this->countModules('left')) : ?>
<div class="left_column">
<jdoc:include type="modules" name="left" style="xhtml" />
</div>
<?php endif; ?></code></pre>
Then the presence or absence of modules in this column will determine the layout.