gantry / joomla编辑主体HTML? [英] gantry/joomla edit mainbody html?
问题描述
我是Joomla,Gantry-Framework和PHP :)的初学者,我有一个关于如何编辑html的问题主体文件。或者,更接近地说,在我想要/可以编辑之前我必须理解文件的代码,因此我有一个问题。
目标我想要实现的是:Gantry-Framework使用具有12列布局的网格。主体部分由内容顶部,主体,内容底部和侧边栏组成(请参见此处)。现在,我想改变我只有主体部分的HTML。我认为我已经实现了,但现在已经存在的问题是,我希望mainboy-section能够适应整个12列的宽度而不仅仅是目前的6列。当我使用chrome的开发人员工具检查网站时,我可以看到,当我手动更改它时,我只使用6网格列布局实现了我的目标,但现在我想编辑模板而我真的不明白该怎么办。
这是原始代码:
Hi,
i'm a beginner on working with Joomla, the Gantry-Framework and PHP :) and i have a question about how to edit the html of the mainbody file. Or, to say it closer, before i want/could edit it i have to understand the code of the file and because of that i have a question.
The Goal that i want to achieve is: The Gantry-Framework uses a grid with 12-column layout. The mainbody section consisting of content-top, mainbody, content-bottom and a sidebar (see here). Now, i want to change the HTML that i only have the mainbody section at all. I think this i already achieved, but now the problem already exist, is that i want the mainboy-section to fit with the width of the whole 12 columns and not only 6 like at the moment. When i examine the site with developer tools of chrome i can see, that there are only 6-grid column layout is used an when i manually change it i achieve my goal, but now i want to edit the template and there i not really understand what to do.
This is the original code:
<?php
/**
* @version $Id: body_mainbody.php 6306 2013-01-05 05:39:57Z btowles $
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*
* Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
*
*/
defined('GANTRY_VERSION') or die();
gantry_import('core.gantrylayout');
/**
*
* @package gantry
* @subpackage html.layouts
*/
class GantryLayoutBody_MainBody extends GantryLayout {
var $render_params = array(
'schema' => null,
'pushPull' => null,
'classKey' => null,
'sidebars' => '',
'contentTop' => null,
'contentBottom' => null
);
function render($params = array()){
/** @var $gantry Gantry */
global $gantry;
$app = JFactory::getApplication();
$fparams = $this->_getParams($params);
// logic to determine if the component should be displayed
$display_mainbody = !($gantry->get("mainbody-enabled",true)==false && $app->input- >getString('view') == 'featured');
$display_component = !($gantry->get("component-enabled",true)==false && ($app->input->getString('option') == 'com_content' && $app->input->getString('view') == 'featured'));
ob_start();
// XHTML LAYOUT
?>
<?php if ($display_mainbody) : ?>
<div id="rt-main" class="<?php echo $fparams->classKey; ?>">
<div class="rt-container">
<div class="rt-grid-<?php echo $fparams->schema['mb']; ?> <?php echo $fparams- >pushPull[0]; ?>">
<?php if (isset($fparams->contentTop)) : ?>
<div id="rt-content-top">
<?php echo $fparams->contentTop; ?>
</div>
<?php endif; ?>
<?php if ($display_component) : ?>
<div class="rt-block">
<div id="rt-mainbody">
<div class="component-content">
<jdoc:include type="component" />
</div>
</div>
</div>
<?php endif; ?>
<?php if (isset($fparams->contentBottom)) : ?>
<div id="rt-content-bottom">
<?php echo $fparams->contentBottom; ?>
</div>
<?php endif; ?>
</div>
<?php echo $fparams->sidebars; ?>
<div class="clear"></div>
</div>
</div>
<?php endif; ?>
<?php
return ob_get_clean();
}
}
我将其更改为:
and i changed it to:
<?php
/**
* @version $Id: body_mainbody.php 6306 2013-01-05 05:39:57Z btowles $
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
*
* Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
*
*/
defined('GANTRY_VERSION') or die();
gantry_import('core.gantrylayout');
/**
*
* @package gantry
* @subpackage html.layouts
*/
class GantryLayoutBody_MainBody extends GantryLayout {
var $render_params = array(
'schema' => null,
'pushPull' => null,
'classKey' => null,
'sidebars' => '',
'contentTop' => null,
'contentBottom' => null
);
function render($params = array()){
/** @var $gantry Gantry */
global $gantry;
$app = JFactory::getApplication();
$fparams = $this->_getParams($params);
// logic to determine if the component should be displayed
$display_mainbody = !($gantry->get("mainbody-enabled",true)==false && $app->input->getString('view') == 'featured');
$display_component = !($gantry->get("component-enabled",true)==false && ($app->input->getString('option') == 'com_content' && $app->input->getString('view') == 'featured'));
ob_start();
// XHTML LAYOUT
?>
<?php if ($display_mainbody) : ?>
<div id="rt-main" class="<?php echo $fparams->classKey; ?>">
<div class="rt-container">
<div class="rt-grid-<?php echo $fparams->schema['mb']; ?> <?php echo $fparams->pushPull[0]; ?>">
<?php if ($display_component) : ?>
<div class="rt-block">
<div id="rt-mainbody">
<div class="component-content">
<jdoc:include type="component" />
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="clear"></div>
</div>
</div>
<?php endif; ?>
<?php
return ob_get_clean();
}
}
我不明白:
•fparams包含一些参数?例如'mb'或'pushpull'?但它在哪里填补? •我认为mb包含值6 ...但我想要一个12 - >我必须改变它吗?
我希望我以你理解的方式描述我的问题,有人可以帮助我。另外,我希望我正确地在我的文章中格式化代码 - 我尽力并使用菜单栏中的给定工具,但我还没有写很多文章。所以,如果有错误我为此道歉,当有人告诉我如何让它变得更好时会很高兴,所以我可以用更好的方式写下面的帖子。
经过我自己的一点研究后,我意识到了一些新东西:
好的,我清除了所有缓存,然后当我在模板的布局设置下检查配置时,我意识到,我的设置赢了'保存。当我选择位置1并且位置选择下的滑块设置为12(选择位置1时唯一有效的值)我点击按钮保存。首先配置是正确的,但是当我关闭模板管理器并再次打开它我发现在layout-> mainbody定位旧值。然后postion是2并且它下面的滑块值是6 | 6.现在我不确定是否有可能达到我的需要。但是为什么会提供?
我期待着您的回复!
最诚挚的问候,
Dennis
There i dont't understand:
• fparams contains some parameter? for example 'mb' or 'pushpull'? But where it is filled? • I think mb contains the value 6...but there i want a 12 -> where i have to change it?
I hope i've described my problem in a way that you understood and somebody can help me. In addition i hope i formatted the code in my article correctly - i tried my best and uses the given tools in the menubar but i don't write many articles yet. So, if there are mistakes i apologize for it and would be glad when somebody tells me how to make it better, so i could write following posts in a better way.
After a little research by myself i realized something new:
Ok,i cleared all caches and then when i checked the configuration under the layout-settings of the template,i realized,that my settings won't be saved.When i choose position 1 and the slider under the selection of the position is set to 12(the only value which is valid when position 1 is chosen)i click on button save.first the configuration are correct,but when i close the template manager and open it again i find under layout->mainbody positions the old values.Then postion is 2 and the slider value under it is 6|6.Now im not sure if it is possible to reach my needs.But why it will be offered?
I look forward to hearing from you!
Best Regards,
Dennis
推荐答案
Id:body_mainbody.php 6306 2013-01-05 05:39:57Z btowles
Id: body_mainbody.php 6306 2013-01-05 05:39:57Z btowles
* @author RocketTheme http://www.rockettheme.com
* @copyright版权所有(C)2007 - 2014 RocketTheme,LLC
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU / GPLv2仅
*
* Gantry使用Joomla Framework(http://www.joomla.org),一个GNU / GPLv2内容管理系统
*
* /
定义(< span class =code-string>' GANTRY_VERSION')或 die();
gantry_import(' core.gantrylayout');
/ * *
*
* @package gantry
* @subpackage html.layouts
* /
class GantryLayoutBody_MainBody扩展GantryLayout {
var
* @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only * * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system * */ defined('GANTRY_VERSION') or die(); gantry_import('core.gantrylayout'); /** * * @package gantry * @subpackage html.layouts */ class GantryLayoutBody_MainBody extends GantryLayout { var
render_params = array(
' schema' => null,
' pushPull' => null,
' classKey' => null,
< span class =code-string>' sidebars' => ' ',
' contentTop' = > null,
' contentBottom' => null
);
函数渲染(
render_params = array( 'schema' => null, 'pushPull' => null, 'classKey' => null, 'sidebars' => '', 'contentTop' => null, 'contentBottom' => null ); function render(
这篇关于gantry / joomla编辑主体HTML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!