Planet Joomla! English

Category talk:Tips and tricks 1.5

Joomla! Official Documentation Wiki - vor 1 Stunde 6 Minuten

get language properties

New page

for get language property

بدست آوردن زبان و راست به چپ بودن و زبان سایت


===== get main name language =====
$lg = &JFactory::getLanguage();
$language = $lg->get('name');
echo $language;


===== get direction language (sample : check farsi and arabic) =====
$lg = &JFactory::getLanguage();
$language = $lg->get('rtl');
if ($language)
echo $language;



===== get name language =====
$lg = &JFactory::getLanguage();
$language = $lg->get('name');
echo $language;

===== get code page language =====
$lg = &JFactory::getLanguage();
$language = $lg->get('winCodePage');
echo $language;

===== get name language =====
$lg = &JFactory::getLanguage();
$language = $lg->get('backwardLang');
echo $language; Ebrahimiali
Kategorien: Planet Joomla! EN

Joomla secrets

Joomla! Official Documentation Wiki - 27. August 2008 - 21:06

Changed number format to English style and edited for readability

←Older revision Revision as of 21:06, 27 August 2008 Line 1: Line 1: This Joomla secrets page lists some Joomla trivia that is neither really a secret, nor well known. This Joomla secrets page lists some Joomla trivia that is neither really a secret, nor well known. -== How many articles can a Joomla website contain? ==+== How many articles can a Joomla! website contain? == -Yes, there is a limitation to the amount of articles a default Joomla website can store: just over 2 billion articles.+Yes, there is a limitation to the number of articles a default Joomla! website can store: just over 2 billion articles. -Technical background: All articles are stored in a MySQL database, in a table called jos_contents. Every article has its unique ID, which is stored in the ID field. The ID field is of field type INT(11). The highest number that can be stored in INT(11) is 2.147.483.647, hence the maximum ID that you can use, hence the maximum amount of articles (if you start counting by one, and won't delete any of you articles).+Technical background: All articles are stored in a MySQL database, in a table called <code>jos_contents</code>. Every article has its unique ID, which is stored in the <code>ID</code> field. The <code>ID</code> field is of field type INT(11). The highest number that can be stored in an INT(11) field, and hence the maximum ID that can be used, is 2,147,483,647. So, the maximum number of articles that a Joomla! website can contain is 2,147,483,647. == How to show the module positions of a Joomla website? == == How to show the module positions of a Joomla website? == Mike dowler
Kategorien: Planet Joomla! EN

Category parameter type

Joomla! Official Documentation Wiki - 27. August 2008 - 19:52

Possible bug report now resolved - was not a bug. Text amended to explain reason for behaviour.

←Older revision Revision as of 19:52, 27 August 2008 Line 2: Line 2: The '''category''' parameter type provides a drop down list of published categories from a given section. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. The first option on the list is always '- Select Category -' (which is a translatable string) and is given the value 0. The '''category''' parameter type provides a drop down list of published categories from a given section. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. The first option on the list is always '- Select Category -' (which is a translatable string) and is given the value 0. -<font color="red">[[[ Note: At present this does not check if the section is published (only the categories). See tracker #12256. ]]]</font>+Note that categories will still be shown in the drop-down list even if the section they belong to is not published. This is to make it possible to build draft content areas without having to first publish a section. * '''type''' (mandatory) must be category. * '''type''' (mandatory) must be category. Chris Davenport
Kategorien: Planet Joomla! EN

Template:Most popular pages

Joomla! Official Documentation Wiki - 27. August 2008 - 16:31

Updated for today's statistics.

Chris Davenport
Kategorien: Planet Joomla! EN

Template

Joomla! Official Documentation Wiki - 26. August 2008 - 22:49

←Older revision Revision as of 22:49, 26 August 2008 Line 18: Line 18: == How can I create a new template? == == How can I create a new template? == -If you are interested in creating your own template than there are a few thing that you might want to know before you start. first you will need to know [http://www.w3schools.com/css CSS], [http://www.w3schools.com/html HTML], and [http://www.w3schools.com/PHP PHP]. Joomla! has created a [http://dev.joomla.org/content/view/1136/79/ tutorial] for those how would like to create their own template.+If you are interested in creating your own template than there are a few thing that you might want to know before you start. first you will need to know [http://www.w3schools.com/css CSS], [http://www.w3schools.com/html HTML], and [http://www.w3schools.com/PHP PHP]. Joomla! has created a [http://dev.joomla.org/content/view/1136/79/ tutorial] for those who would like to create their own template. == More Template Information. == == More Template Information. == Tm.storm
Kategorien: Planet Joomla! EN

Adding a new menu

Joomla! Official Documentation Wiki - 26. August 2008 - 22:47

←Older revision Revision as of 22:47, 26 August 2008 Line 1: Line 1: {{review}} {{review}} To add a new menu: To add a new menu: -#Log in to the Joomla! Back-end Administrator.+#Log in to the Joomla! Administrator Back-end. #Click '''Menus > Menu Manager''' on the toolbar menu. The Menu Manager screen opens. #Click '''Menus > Menu Manager''' on the toolbar menu. The Menu Manager screen opens. #Click the ''New'' toolbar button. The New/Edit Menu screen opens. #Click the ''New'' toolbar button. The New/Edit Menu screen opens. Tm.storm
Kategorien: Planet Joomla! EN

Deleting an Article

Joomla! Official Documentation Wiki - 26. August 2008 - 22:44

←Older revision Revision as of 22:44, 26 August 2008 (2 intermediate revisions not shown.)Line 1: Line 1: -{{inuse}}+{{review}}  +To delete an article:  +#Login to the Joomla! Administrator Back-end.  +#Go to '''Content''' > '''Article Manger''' on the toolbar menu.  +#Now check the box next to the article you want to delete.  +[[Image:Article_delete.jpg]]  +   +Then click '''Trash''' button.  +   +[[Image:Article_trash.jpg]]  +   +If you want to make sure the Article is compleatly gone go '''Content''' > '''Article Trash''' and delete every thing in there.  +   +[[Image:Article_trash_manager.jpg]] Tm.storm
Kategorien: Planet Joomla! EN

Moving a menu to a different position

Joomla! Official Documentation Wiki - 26. August 2008 - 22:16

←Older revision Revision as of 22:16, 26 August 2008 (One intermediate revision not shown.)Line 1: Line 1: -{{cookiejar}}+{{review}} -{{inuse}}+ == Moving a menu to a different position == == Moving a menu to a different position ==  +  + === Joomla! 1.5 === === Joomla! 1.5 ===  +  + Go to '''Extensions'''>'''Module Manager''' and select the module that your menu is being displayed through. Go to '''Extensions'''>'''Module Manager''' and select the module that your menu is being displayed through.  +  + [[Image:Menu_Module.jpg]] [[Image:Menu_Module.jpg]]  +  + Next select the position that you would like your your menu to be in on the front end of your site. (Positions vary from theme to theme so make sure you know your theme) Next select the position that you would like your your menu to be in on the front end of your site. (Positions vary from theme to theme so make sure you know your theme)  +  + [[Image:Menu_Module_position.jpg]] [[Image:Menu_Module_position.jpg]]  +  + === Joomla! 1.0 === === Joomla! 1.0 ===  +  +  +  +Go to '''Modules'''>'''Site Modules''' and select the module that your menu is being displayed through.  +  +  +  +[[Image:Module_1_0.jpg]]  +  +  +  +Next select the position that you would like your your menu to be in on the front end of your site.  +  +  +  +[[Image:Module_1_0_Positions.jpg]]  +  + == Related Articles == == Related Articles == Tm.storm
Kategorien: Planet Joomla! EN

Creating a language definition file

Joomla! Official Documentation Wiki - 26. August 2008 - 21:06

Minor amendment to wording.

←Older revision Revision as of 21:06, 26 August 2008 Line 11: Line 11: The “''KEY''” must be in all capitals or the string will not be found. The case of the source string does not matter as strings are folded to upper case before searching takes place. So “additional information”, “Additional Information” or even “AdDiTiOnAl InFoRmAtIoN” will be matched. The “''KEY''” must be in all capitals or the string will not be found. The case of the source string does not matter as strings are folded to upper case before searching takes place. So “additional information”, “Additional Information” or even “AdDiTiOnAl InFoRmAtIoN” will be matched. -The “''KEY''” may include spaces and other punctuation characters but there should not be any spaces either side of the equals sign as spaces are significant. If more than one entry has the same left-hand side, the last entry in the file is the one to perform the translation.+The “''KEY''” can include spaces and other punctuation characters but there should not be any spaces either side of the equals sign as spaces are significant. If more than one entry has the same left-hand side, the last one to be encountered is the one that will be used. <noinclude> <noinclude> ---- ---- <references/></noinclude> <references/></noinclude> Chris Davenport
Kategorien: Planet Joomla! EN

Talk:Copying a Joomla website

Joomla! Official Documentation Wiki - 26. August 2008 - 12:58

←Older revision Revision as of 12:58, 26 August 2008 Line 24: Line 24: instead (so with double "--" ) see: http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html instead (so with double "--" ) see: http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html  +  +Both forms should work. [[User:Chris Davenport|Chris Davenport]] 08:58, 26 August 2008 (EDT) Chris Davenport
Kategorien: Planet Joomla! EN

Talk:Setting up your workstation for Joomla! development

Joomla! Official Documentation Wiki - 25. August 2008 - 22:57

New section: Please Post a Question to Joomla! Coding 101 Forum

←Older revision Revision as of 22:57, 25 August 2008 Line 8: Line 8: There is probably some 'obvious' global setting I've missed but I can't find any solution through google although I have found a few threads by people with the same problem (and no solution). There is probably some 'obvious' global setting I've missed but I can't find any solution through google although I have found a few threads by people with the same problem (and no solution).  +  +== Please Post a Question to Joomla! Coding 101 Forum ==  +  +Hi. Why don't you post your question to the Joomla! Coding 101 Forum. I'll try to look for it, and there are probably people there who know way more about this than I do. Thanks. [[User:Dextercowley|Mark Dexter]] 18:57, 25 August 2008 (EDT) Dextercowley
Kategorien: Planet Joomla! EN

Textarea parameter type

Joomla! Official Documentation Wiki - 25. August 2008 - 14:52

Bug now fixed.

←Older revision Revision as of 14:52, 25 August 2008 Line 1: Line 1: [[Image:Params.textarea.jpg|right]] [[Image:Params.textarea.jpg|right]] The '''textarea''' parameter type provides a text area for entry of multi-line text. If the parameter has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected. The '''textarea''' parameter type provides a text area for entry of multi-line text. If the parameter has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected. -  -<font color="red">[[[ Note that there is currently a bug such that the field cannot handle more than one line of data – see Tracker #12261. ]]]</font>  * '''type''' (mandatory) must be ''textarea''. * '''type''' (mandatory) must be ''textarea''. Chris Davenport
Kategorien: Planet Joomla! EN

PHP essentials

Joomla! Official Documentation Wiki - 24. August 2008 - 12:07

PHP essentials - programMed

←Older revision Revision as of 12:07, 24 August 2008 Line 10: Line 10: if-then-else syntax using extracts from a template for illustration. if-then-else syntax using extracts from a template for illustration. -The best resource to learn PHP is probably hands on experience and Joomla can provide that to you thanks to it's native PHP code. This can be overwhelming for people who have not programed before. Though Joomla is easy enough to [[Installation|install]] with the help of the community and a little of your time you'll have people asking you to do their websites.+The best resource to learn PHP is probably hands on experience and Joomla can provide that to you thanks to it's native PHP code. This can be overwhelming for people who have not programmed before. Though Joomla is easy enough to [[Installation|install]] with the help of the community and a little of your time you'll have people asking you to do their websites. One place that has a nice short list if functions and examples is http://en.wikiversity.org/wiki/25_Essential_PHP_Functions which is good to get familiar with PHP. Though for an extensive function list, explanations, and examples go to http://www.php.net. One place that has a nice short list if functions and examples is http://en.wikiversity.org/wiki/25_Essential_PHP_Functions which is good to get familiar with PHP. Though for an extensive function list, explanations, and examples go to http://www.php.net. Sever
Kategorien: Planet Joomla! EN

About CSS page layouts

Joomla! Official Documentation Wiki - 24. August 2008 - 12:05

About CSS page layouts - Corrected script -> sheet, and tags from <script> to <style>

←Older revision Revision as of 12:05, 24 August 2008 Line 3: Line 3: Professional websites separate styling from content. There are many reasons for this, the most obvious (to a developer) being the ability to control the appearance of many pages by changing one file. Styling information includes: fonts; backgrounds; images (that recur on every page); position and dimensions of elements on the page. Your HTML file will now be left with: header information; a series of elements; the text of your website. Because you are creating a Joomla! template, you will actually have: some header information; php code to request the rest of the header information; a series of elements; php code to request each module position; php code to request the main content. Professional websites separate styling from content. There are many reasons for this, the most obvious (to a developer) being the ability to control the appearance of many pages by changing one file. Styling information includes: fonts; backgrounds; images (that recur on every page); position and dimensions of elements on the page. Your HTML file will now be left with: header information; a series of elements; the text of your website. Because you are creating a Joomla! template, you will actually have: some header information; php code to request the rest of the header information; a series of elements; php code to request each module position; php code to request the main content. -Style information is coded in CSS, cascading style script, and usually stored in files with the suffix .css. A webpage contains a link to the associated .css file so a browser can find the appropriate style information to apply to the page. CSS can also be placed inside a html file between <script></script> tags.+Style information is coded in CSS, cascading style sheet, and usually stored in files with the suffix .css. A webpage contains a link to the associated .css file so a browser can find the appropriate style information to apply to the page. CSS can also be placed inside a html file between <style type="text/css"></style> tags. All CSS code is applied to an element of the html/xml page. If you want a style to encompass a whole page, you would probably apply it to the <body> element. You can apply styles to any html element such as <nowiki><p></nowiki>, <nowiki><table></nowiki> or <nowiki><div></nowiki> elements. To style a particular element it needs to have an ID. For example, to apply styles to the <nowiki><div></nowiki> containing the title, you would first include an ID in the html - <nowiki><div ID="title"></nowiki>. All CSS code is applied to an element of the html/xml page. If you want a style to encompass a whole page, you would probably apply it to the <body> element. You can apply styles to any html element such as <nowiki><p></nowiki>, <nowiki><table></nowiki> or <nowiki><div></nowiki> elements. To style a particular element it needs to have an ID. For example, to apply styles to the <nowiki><div></nowiki> containing the title, you would first include an ID in the html - <nowiki><div ID="title"></nowiki>. Sever
Kategorien: Planet Joomla! EN

Category:Languages

Joomla! Official Documentation Wiki - 24. August 2008 - 10:58

New page: This is a category page for all documentation about language extension support within Joomla. To appear on this page each topic page should have the following code inserted at the end: <c...

New page

This is a category page for all documentation about language extension support within Joomla. To appear on this page each topic page should have the following code inserted at the end: <code><nowiki><noinclude>[[Category:Languages]]</noinclude></nowiki></code>
[[Category:Extensions]] Chris Davenport
Kategorien: Planet Joomla! EN

Tutorial:Template translations

Joomla! Official Documentation Wiki - 24. August 2008 - 10:56

Chris Davenport
Kategorien: Planet Joomla! EN

Outline for Template Tutorials

Joomla! Official Documentation Wiki - 24. August 2008 - 10:54

Template translations -

←Older revision Revision as of 10:54, 24 August 2008 Line 110: Line 110: * [[Amending the templateDetails.xml file]] * [[Amending the templateDetails.xml file]] * [[Embedding translatable strings in the template]] * [[Embedding translatable strings in the template]]  +* [[Formatted fields in language translation strings]] * [[Debugging a translation]] * [[Debugging a translation]] Chris Davenport
Kategorien: Planet Joomla! EN

Embedding translatable strings in the template

Joomla! Official Documentation Wiki - 24. August 2008 - 10:53

Oops! Forgot to add to the templates category.

(Difference between revisions) Chris Davenport
Kategorien: Planet Joomla! EN

Formatted fields in language translation strings

Joomla! Official Documentation Wiki - 24. August 2008 - 10:50

Separated from template-specific page and promoted as a generic languages page.

New page

Sometimes it is necessary to include specially formatted fields within a string to be translated. This usually happens where numbers are involved but can occur for dates and times or when precise formatting instructions are required. If the strings were not to be translated the standard PHP functions ''printf'' and ''sprintf'' could be used. The ''printf'' function outputs a string formatted using embedded formatting instructions; the ''sprintf'' function returns a string formatted using the same embedded formatting instructions.

The JText class provides wrapper methods for the ''printf'' and ''sprintf'' functions allowing static text to be translated while also allowing formatted fields to be embedded using the same syntax as the PHP functions.

For example, suppose you have the string “Donations of 12.45 GBP have been received” where the amount comes from a variable, $donations”, say. You could split the string into two like this

<source lang="php">
JText::_( 'Donations of' ) . “ $donations GBP “ . JText::_( 'have been received' )
</source>
with language definition strings

<source lang="ini">
DONATIONS OF=Donations of
HAVE BEEN RECEIVED=have been received
</source>
but this does not work well in languages where the embedded data is not in a similar place in the translated string. Instead use the ''sprintf'' method like this

<source lang="php">
JText::sprintf( 'Donations have been received', $donations )
</source>
with language definition string

<source lang="ini">
DONATIONS HAVE BEEN RECEIVED=Donations of %.2f GBP have been received
</source>
You can include more than one format specifier in a translation string. Substitutions are carried out in order so this works as expected

<source lang="php">
JText::sprintf( 'String with numbers in it', $num1, $num2, $num3 )
</source>
with language definition string

<source lang="ini">
STRING WITH NUMBERS IN IT=First %d, second %d, third %d
</source>

=== Syntax of format specifiers ===
The format specifier consists of a percent sign (''%''), followed by one or more of these elements, in order:
{| class="wikitable"
| <center>'''Order'''</center>
| '''Type'''
| '''Values'''
| <center>'''Description'''</center>

|-
| <center>1.</center>
| Sign
| + or -
| Optional. Forces a sign (+ or -) to be used on a number. By default, only the – sign is used on a number if it's negative. This specifier forces positive numbers to have the + sign attached as well.

|-
| <center>2.</center>
| Padding
| <nowiki><space></nowiki>

or 0

<nowiki>or '<char></nowiki>
| Optional. Character to be used for padding the results to the correct string size. May be a space character or a ''0'' (zero character). The default is to pad with spaces. An alternative padding character can be specified by prefixing it with a single quote (''''').

|-
| <center>3.</center>
| Alignment
| <nowiki><null> or -</nowiki>
| Optional. Determines if the result should be left-justified or right-justified. The default is right-justified; a ''-'' character here will make it left-justified.

|-
| <center>4.</center>
| Width
| Number
| Optional. Number of characters (minimum) that the conversion should result in.

|-
| <center>5.</center>
| Precision
| Number
| Optional. Number of decimal digits that should be displayed for floating-point numbers. When using this specifier on a string, it acts as a cutoff point, setting a maximum character limit to the string.

|-
| rowspan="13" | <center>6.</center>
| rowspan="13" | Type
| colspan="2" | Mandatory. The type of the argument data. Possible types are:

|-
| <center>%</center>
| A literal percent character. No argument is required

|-
| <center>b</center>
| The argument is treated as an integer and presented as a binary number.

|-
| <center>c</center>
| The argument is treated as an integer and presented as the character with that ASCII value.

|-
| <center>d</center>
| The argument is treated as an integer and presented as a signed decimal number.

|-
| <center>e</center>
| The argument is treated as scientific notation (e.g. 1.2e+2). The precision specifier stands for the number of digits after the decimal point since PHP 5.2.1. In earlier versions, it was taken as the number of significant digits (one less).

|-
| <center>u</center>
| The argument is treated as an integer and presented as an unsigned decimal number.

|-
| <center>f</center>
| The argument is treated as a float and presented as a floating-point number (locale aware).

|-
| <center>F</center>
| The argument is treated as a float and presented as a floating-point number (non-locale aware).

|-
| <center>o</center>
| The argument is treated as an integer and presented as an octal number.

|-
| <center>s</center>
| The argument is treated and presented as a string.

|-
| <center>x</center>
| The argument is treated as an integer and presented as a hexadecimal number (with lowercase letters).

|-
| <center>X</center>
| The argument is treated as an integer and presented as a hexadecimal number (with uppercase letters).

|}
=== Format argument swapping ===
The format string supports argument numbering and even swapping. This is useful where two or more data items must be embedded in a string but differences in language structure means that the order of use of the data items is not the same.

For example, suppose we have the following code

<source lang="php">
echo JText::sprintf( 'Balls in the bucket', $number, $location );
</source>

with this language translation string

<source lang="ini">
BALLS IN THE BUCKET=There are %d balls in the %s
</source>

Then if

<source lang="php">
$number = 3
$location = 'hat'
</source>

this would output “There are 3 balls in the hat”. But consider if you wanted to change the translation to

<source lang="ini">
BALLS IN THE BUCKET=The %s contains %d balls
</source>

This would now output “The 3 contains hat balls” which is clearly nonsense. Rather than change the code, you can indicate in the translation string which argument each of the placeholders refer to. Change the translation to

<source lang="ini">
BALLS IN THE BUCKET=The %2$s contains %1$d balls
</source>

and the output becomes “The hat contains 3 balls” as expected.

An added benefit of being able to number the arguments is that you can repeat the placeholders without adding more arguments in the code. For example, change the translation to

<source lang="ini">
BALLS IN THE BUCKET=The %2$s contains %1$d balls, so there are %1$d balls in the %2$s
</source>

and this will correctly output “The hat contains 3 balls, so there are 3 balls in the hat”.
<noinclude>[[Category:Languages]]</noinclude> Chris Davenport
Kategorien: Planet Joomla! EN
Inhalt abgleichen