Length of URL Language Code in Joomla 2.5 - joomla

I need to change the content language URL Code for the french part of a Website to "costumes" (Found in the language manager under "content"). However the field stops after 7 letters, so that the last "s" is cut of.
I want to change that because the website-languages where set up as categories before, so that the french part is indexed by Google and others like that. Is there a way to allow 8 letters in this field?

Please try to change maxlength variable from file: /administrator/components/com_languages/models/forms/language.xml
<field name="lang_code" type="text"
description="COM_LANGUAGES_FIELD_LANG_TAG_DESC"
label="COM_LANGUAGES_FIELD_LANG_TAG_LABEL"
maxlength="7"
required="true"
size="10"
/>
<field name="sef" type="text"
description="COM_LANGUAGES_FIELD_LANG_CODE_DESC"
label="COM_LANGUAGES_FIELD_LANG_CODE_LABEL"
maxlength="7"
required="true"
size="10"
/>
This is a core change and every time you upgrade your joomla installation you have to check if it is getting overridden. If you want to create an override, you will need a 3rd party plugin.
Good Luck!

Related

How to use "editor" field type in joomla "repeatable" form field?

I am developing a module for Joomla 3.3.6. I want to use "editor" field type in "repeatable" field in the xml file. The code I am using is as follows:
<field
name="fpssibtos_img1subs"
type="Repeatable"
icon="list"
label="GLOBAL_SUBS"
description="GLOBAL_SUBS_DESC"
default="{'fpssibtos_img1sub':['test']}">
<fields name="params">
<fieldset hidden="true" name="fpssibtos_img1subs_modal" repeat="true">
<field
name="fpssibtos_img1sub"
default="test"
type="editor"
label="GLOBAL_SUB"
description="GLOBAL_SUB_DESC"
filter="safehtml"/>
</fieldset>
</fields>
</field>
The problem is the editor is not editable, I mean you cannot type anything in it.
I am using CKEditor, I changed it to TinyMCE and others ,but the problem persists. I know that repeatable form field is still buggy ,but I thought some of you guys might know the fix to this particular problem.
In case anyone else comes across this problem, the repeatable form fields only support simple field types. This is apparently due to Joomla not having a simple way for scripts to interact.
Comment on the issue from one of the devs here and here.

maxlength is not working in joomla 2.5 form fields

I am having an issue when using below code in plugin xml in Joomla 2.5 version.
maxlength is not working.
<field name="phone" type="text" default="" label="Phone"
description="Phone: Must not be greater than 13 numbers" maxlength="13" />
or
<param name="phone" type="text" default="" label="Phone"
description="Phone: Must not be greater than 13 numbers" maxlength="13" />
Please let me know what need to be done or i am doing wrong.
Thanks in advance.
You should definitely be using the first bit of code you've provided in your extension as Joomla 2.5 uses <field>, not <param>.
So once you have many any changes to the XML file, you need to ensure you open the Plugin in the Joomla backend, and click "Save" which will apply any changes made.

How to set parameters in menu Item Joomla Component

Following is my code.
<fields name="request">
<fieldset name="request">
<field name="format" type="list" label="COM_CPS_FIELD_FORMAT"
description="COM_CPS_FIELD_FORMAT_DESC" class="small"
default="raw"
>
<option value="">COM_CPS_FORMAT_HTML</option>
<option value="raw">COM_CPS_FORMAT_RAW</option>
</field>
</fieldset>
</fields>
When I save the menu with 2nd option it save the url like this index.php?option=com_cps&view=webservice&format=raw but when I save the menu with first option it does not remove the &format=raw If any one can help me out It would be great.
Default is defined as what to save if nothing is posted. It works like a Joomla input filter in that it changes what is actually saved as opposed to validation which stops the process and never posts. Therefore you cannot save nothing, since it will always be replaced by the default. Therefore if you want to be able to save blank you must not have a default.
What you may be looking for is a preset, which is a preselected value that can be unselected. Presets and defaults are totally different things although on the surface they appear similar.

why does Razor put validation attributes in #Html.Hiddenfor() helper?

it doesn't make any sense, is there anyway to make this not to act this way?
for
#Html.HiddenFor(model=>model.Id)
I get
<input type="hidden" value="e62fceab-588c-4777-bfe9-8516425a5028" name="Id" id="Id" data-val-required="The Id field is required." data-val="true">
MVC is automatically adding required validation to all non null-able fields. If you don't like this then you can make your id null-able.
It's just an additional layer of server side protection. It's trivial to change an outgoing hidden input with a man in the middle tool like Fiddler.
As for making it optional, there's almost surely a data attribute for that. Alternatively, adding a question mark after the property name in your model should do it.

Joomla 2.5 registration custom field as dropdown?

I added some extra field to Joomla 2.5. Everything working great. For example, I added "country" to registration.xml (components/com_users/models/forms):
<field name="country" type="text"
description="COM_USERS_REGISTER_COUNTRY_DESC"
filter="string"
label="COM_USERS_REGISTRATION_COUNTRY"
required="true"
size="40"
/>
But how to add a dropdown list? I want to give my users ability to select country from the list.
And similar question: I also added birthday field. How to add jQuery datepicker here?
In my opinion you should not edit Joomla core files. This could break your installation in future updates.
Although I don't recommend it, take a look at Standard form field and parameter types # Joomla Docs. At that page, see list for your dropdown list and calendar for your date.
Another way of adding extra fields would be with a extension. Check out:
ExtendedReg (commercial)
Community Builder
Joomla 2.5 has a 'profile' plugin to handle extra registration fields. You can edit that or write your own plugin. This avoids editing core files. Example of a country list using a database call (your database must have the table of counties). My table has country codes in two and three letters and I want to save the 3 letter code (example CAD).
<field
name="country"
type="sql"
id="country"
description="PLG_USER_PROFILE_FIELD_COUNTRY_DESC"
filter="string"
label="PLG_USER_PROFILE_FIELD_COUNTRY_LABEL"
message="PLG_USER_PROFILE_FIELD_COUNTRY_MESSAGE"
query="SELECT country_3_code as value, country_name as country FROM #__mycomponent_country
ORDER by country"
/>
For birthday use:
<field
name="birthday"
type="calendar"
label="Birth Day"
description="My Desc."
/>
And for country use the SQL as mentioned by #Gord Fisch

Resources