关于本课程

第一章,为选读部分,适用于首次接触Joomla的初学者。通过本阶段课程可以对Joomla有初步了解,并且介绍了Joomla的获取及安装。作为已经安装过Joomla的用户可以略过此内容,进入其他课程学习。

第二章,Joomla常用操作管理。Joomla的管理实际上就是文章、菜单、模块、模板的管理。尤其是掌握菜单与模块的结合显示,能够让我们随意控制页面的内容。通过模板管理我们可以为整个网站风格进行控制管理。

第三章,Joomla功能。本阶段需要了解Joomla组件与插件的区别,防止混淆组件与插件的概念,Joomla组件是我们比较常用的部分,比如安装在“线购物组件”后你的网站可以实现电商平台。插件只是管理部分功能的开或关,不能进行复杂的设置。
如果你要制作多语言网站,请关注Joomla多语言管理课程。也请关注Joomla扩展字段课程来了解更加灵活的内容管理。

第四章,Joomla扩展组件分享。通过本节我们介绍了多个优秀的Joomla组件,这些组件可以应用在大多数的网站建设中,方便客户更加灵活高效的管理网站(Joomla整站备份组件、JCE编辑器管理)、或制作精美的页面(SP Bulider、SC短代码编辑页面)、以及产生Joomla新的功能(RS form表单组件、Hikashop电商组件)等。

Warp架构中文说明——Theme layout 模板布局

模板布局

两个核心PHP文件确定主题的布局和样式。本节将学习如何显示小部件位置和他们的显示方式

THEME.PHP

每个主题的核心文件都是 theme.php. 这不同于标准的Joomla模板使用 index.php 文件作为主要文件

下面是 theme.php.的主题结构, 它需要导入的文件 theme.config.php, 呈现小部件位置,检索配置变量和渲染系统的输出。

<?php

// get theme configuration
include($this['path']->path('layouts:theme.config.php'));

?><!DOCTYPE HTML>
<html lang="<?php echo $this['config']->get('language');?>" dir="<?php echo $this['config']->get('direction');?>"  data-config='<?php echo $this['config']->get('body_config','{}');?>'>

  <head>
  <?php echo $this['template']->render('head');?>
  </head>

  <body>

    // render a widget position
    <?php echo $this['widgets']->render('widget-position');?>

    // retrieve a config variable
    <?php echo $this['config']->get('variable');?>

    // render the system output
    <?php echo $this['template']->render('content');?>

  </body>

</html>

配置对象

在 config.xml 获取值,存储在 config 对象.读取有效的值, 使用 get 方法.

// output the value of the branding variable<?php echo $this['config']->get('theme_branding');?>

// output the to-top scroller based on the theme setting<?php if($this['config']->get('totop_scroller')):?><a class="tm-totop-scroller" data-uk="smooth-scroll" href="#"></a><?php endif;>

Widget object

The widgets of the page are stored in the widgets object. To render all widgets in a position, use the render method. You can check, whether any widgets are published in a position, by using the count method.

<// render all widgets in Top A position
<?php echo $this['widgets']->render('top-a'));?>

// apply the parallel layout to all widgets in Top A position
<?php if($this['widgets']->count('top-a')):?><?php echo $this['widgets']->render('top-a', array('layout'=>'parallel'));?><?php endif;?>

THEME.CONFIG.PHP

While the theme.php basically only defines the theme's markup, the logic is outsourced to the theme.config.php. It is responsible for calculations, like the 3 column layout as well as the body classes and social buttons.

在中国六翼专注Joomla建站与策划设计,为您的品牌发展创造动力!