Archive

Archive for the 'joomla' Category

override the output from the Joomla! core

November 26th, 2008

There may be occasions where you would like to change the way a Joomla! Extension (such as a Component or Module, whether from the Joomla! Core or produced by a third party) is displayed on your site. Of course, you could recode the Extension from scratch, but that may be a bit ambitious for you! Thankfully, there is another way.

The standard output from any Joomla! Module or Component can be overridden by adding code to the html directory of your template. It is also possible to override two aspects of core functionality: Module chrome, and pagination.
Getting a head-start with overrides

If you are new to Joomla! Development, then it is probably easiest to start with an existing view, and try modifying it to get what you want. To do this, you should make a copy of the existing view in the html directory of your template, and then modify the copy.

The directory structure you need is:

TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php

For example, if you want to change the way that the 'Article' view displays a com_content article, then you should copy the file at

PATH_TO_JOOMLA/components/com_content/views/article/tmpl/default.php
to
TEMPLATE_NAME/html/com_content/article/default.php

(note the slight difference in directory structure)

Similarly, if you want to change how the mod_login Module is displayed, then you should copy

PATH_TO_JOOMLA/modules/mod_login/tmpl/default.php
to
TEMPLATE_NAME/html/mod_login/default.php

Joomla! Comes pre-packaged with a frontend template called Beez. Beez utilizes template overrides to produce a table-less layout for faster, smoother, and semantically correct markup. To see how it's done, locate your Joomla! Installation's template directory, and you 'll notice the Beez template. Inside the Beez template directory, you'll find a directory named html

the entire directory structure is as follows:

/your_joomla/templates/Beez/html/

If you want to try modifying the overrides used in Beez, you could simply copy and paste the Beez html directory into your own template's main directory. However you choose to make your override files, you will need to ensure that they are correctly installed with your template. To do this, you should add the following code to your template's templateDetails.xml file (in between the and tags):

html

The above code in essence lets the Joomla! Package installer know that there are files to extract, and that they are part of the template as a whole.
Further tips

Template overrides are almost limitless. They allow you to add, edit, and remove the components of the Joomla! Core output. Note: For the FireFox web browser, an extension is available called Firebug, which is useful for browsing a page's HTML source and matching it up with the PHP code used in template overrides.

More information is available from the following resources:

Joomla

joomla to determine whether it is Home

November 24th, 2008

1.0 general use among the home to determine the following code:

  ( ! ( ( ! $option ) || ( $option != "com_frontpage" ) ) ) { ?> <? php if (! ((! $ option) | | ($ option! = "com_frontpage"))) (?>
  else { ?> / / Non-home page <? Php) else (?>
 ?> / / Home <? Php)?> 

This method has been at 1.5 which is not to judge the need to use the following means to determine:

  <? php
     JSite :: getMenu ( ) ; $ menu = & JSite:: getMenu ();
      $menu -> getActive ( ) == $menu -> getDefault ( ) ) { if ($ menu -> getActive () == $ menu -> getDefault ()) (
 ? "
      else { ?> / / Home <? Php) else (?>
      ?> / / Non-home page <? Php)?> 

joomla

Joomla! Home Free Custom - specify a separate template for the home page

November 24th, 2008

Most of the Joomla! 1.5 template gives us enough freedom to express enough the home page rich content, but sometimes for us, three columns or two columns of expression is still not enough for us, and the Jian Zhan early, you may need to change the most is the home page of the planning, so as to achieve the best reading results. So how can we make out of the template page layout and display of arbitrary restrictions on content?

First in the / templates / directory to find the current template directory, copy the index.php to home.php and default.php, and then we modify index.php, index.php the code is as follows:

  <? php
 / / No direct access
 '_JEXEC' ) or die ( 'Restricted access' ) ; defined ( '_JEXEC') or die ( 'Restricted access');
 function isFrontPage () (
  JRequest :: getCmd ( 'option' ) == 'com_content' && ! JRequest :: getInt ( 'id' ) ) ; return (JRequest:: getCmd ( 'option') == 'com_content' & &! JRequest:: getInt ( 'id'));
 )
 isFrontPage ( ) ) { if (isFrontPage ()) (
  dirname ( __FILE__ ) . DS . '/home.php' ) ; include_once (dirname (__FILE__). DS. '/ home.php');
 { ) Else (
  dirname ( __FILE__ ) . DS . '/default.php' ) ; include_once (dirname (__FILE__). DS. '/ default.php');
 )
 ? " 

In fact, the visit is to determine whether the page, if the access to home, how can contain home.php, otherwise it is the default default.php.

The next step is according to your own wishes to modify the home.php, without any restrictions. Usually retain the original template page of the first part of the contents of any part may be your layout.

Joomla

joomla template single-Frequently Asked Questions

November 24th, 2008

What is a template (Template)?

Templates determine the overall appearance and layout of the site. Template provides a framework to integrate the common elements (modules and components), but also includes cascading style sheets (CSS). Site's front end (website) and background (management) have used the template.

Joomla! Install version includes a number of templates. You can find more from other websites templates, some free of charge (based on a variety of permits), but some are free. In addition, many designers are able to produce the template. You can also try to create your own templates.

菜单下。 Template through the Template Manager (Template Manager) management, and its entrance in the management of the expansion of the background (Extensions) menu.

How to install the template (install a tempalte)?

Background in management through the extension>> install and uninstall (Extensions »Install & Uninstall) menu, enter, upload. Zip format compressed file can be the template.

You can also copy the entire template folder directly to the / templates / directory.

How to modify the template (modify a template)?

Template is stored in / templates / directory of a series of xml, php, html and image files. You can edit these files directly, or through the Template Manager (Template Manager) to provide editing interface changes (which can modify the template html and css files).

How to specify a separate special page template?

Joomla! Set the default template, you can give a special "pages" separate designated template, where the page specific to a particular (s) received a necklace the menu page. Therefore, they wanted to specify a page template, first of all to ensure that a menu item point to this page. Reference Joomla! User manual - menus and menu items (Menu & Menu Item)

(Specify the template for the page is actually allocated for the template page. - Translators note)
单选框,然后从下面的下拉列表中,选择你希望应用这一模板渲染的页面,可多选。 Into the Template Manager, select the template to be applied, in the Menu Assignment (menu distribution), select the Select From List (from the list, select) a single box, and then from the following drop-down list, select the template you want to apply this rendering the page, it may select.

Note: You can not assign a page for the system default template.

In-depth understanding of: the system according to ItemID deciding which template. ItemID is generated when you create a menu item, which is why the allocation of the page for the template, the drop-down list, only the menu items to choose from.

(When trying to allocate the same page to multiple template, what happens then? - Translator's questions)

Can remove the Powered by Joomla! Information?

Yes, you can remove this information from the footer.php. But you can not remove the copyright and license code instructions.

What is a switching module (module switches)? (-1, -2, -3)

Module switch is mosLoadModules (string module_name, int module_switch) function, the second argument refers to the way display module. -1 Indicated he did not make any modification, only a <div/> container packaging module HTML code; -2 indicated that the module name is displayed in a <h3/> tab, while the entire module is packaged in a container <div/> ; -3 In addition to the module name that is displayed in <h3/> label, the nested container package with multiple <div/> modules through CSS technology show rounded; module_switch parameter when the default, it will use a 2 row 1 column table package module, the first line of a cell to display the module title, the first two lines load the module code in the cell.
(This answer is omitted in the original text of the code examples for reference only.)

Original: http://docs.joomla.org/Template_FAQs

Joomla

joomla plug-ins and extensions that can download wordpress worse than the more

November 16th, 2008

These two days would like to use joomla frame a station. Joomla extensions and plug-ins found in Download Center, compared to wordpress plug-ins Download Center, there really is much worse.

1. Slow. Are in the same in the U.S., I feel that wordpress plug-in download page to open soon.

2. Classification complex. May also be because the joomla extensions and plug-ins too much sake bar. More than 4000. wordpress I did not go to pay attention, but the estimate does not even less than joomla.

3. Wordpress plug-in Download Center a brief description, installation, features screenshots, download statistics, very good. Greatly improve the plug-in we have not downloaded before it is understood. That screenshot is only one, that's pretty good. Also download the statistics, you can see the download sub-date statistics. Understanding of the plug-in is hot. The joomla's a lot more backward. Downloads are also a little bit troublesome.

4. The most annoying thing is that one has. joomla plug-ins to download is not joomla website. But the chain to each plug-in developer's Web site. Many websites have to register in order to download, too annoying. So, circling the firefox plug-in Bugmenot. Said that you can search the database automatically go to Tianxie Registered Users

Joomla

joomla templates to create the jdoc instructions

November 15th, 2008

jdoc: include
<jdoc:include type="component" />
<jdoc:include type="head" />
<jdoc:include type="installation" />
<jdoc:include type="message" />
<jdoc:include type="module" name="breadcrumbs" />
<jdoc:include type="module" name="menu" />
<jdoc:include type="module" name="submenu" style="rounded" id="submenu-box" />
<jdoc:include type="modules" name="debug" />
<jdoc:include type="modules" name="icon" />
<jdoc:include type="modules" name="left" style="rounded" />
<jdoc:include type="modules" name="left" style="xhtml" />
<jdoc:include type="modules" name="right" style="xhtml" />
<jdoc:include type="modules" name="status" />
<jdoc:include type="modules" name="syndicate" />
<jdoc:include type="modules" name="title" />
<jdoc:include type="modules" name="toolbar" />
<jdoc:include type="modules" name="top" />
<jdoc:include type="modules" name="top" style="xhtml" />
<jdoc:include type="modules" name="user1" style="xhtml" />
<jdoc:include type="modules" name="user2" style="xhtml" />
<jdoc:include type="modules" name="user3" />
<jdoc:include type="modules" name="user4" />

type attribute

jdoc: include element in the type attribute specifies the type of content to be rendered, the attribute value can be component, head, installation, message, module, modules
component
The output part of the main page content, in the template page <body> element should only occur once.

head
Filling the current page style, script, meta relevant elements, should be the template <head> element appears only once.

installation
Just install the template useful, in the foreground and background of the template is not used, to some extent with similar type component, rendering installation steps in the main content of a page.

message
In the template <body> element appears only once, filling system, or error from.

module
Rendering by the name attribute specifies a single module, the module must be published and the current user has access to, they can layout as well as the controller properties.

modules
Rendering template specify the name of all the modules, the module must be published and the current user has access to, they can layout as well as the controller properties.
style attribute

For the module and the modules type, style is an optional attribute, this attribute specifies the module is rendered style, if he does not specify the style, default is none

/ templates / system / html / modules.php statement of the standard style: table, horz, xhtml, rounded, outline
Template designers can customize the style in the following documents
/ user-template/html/modules.php.

Joomla