不同(更宽)的 Joomla 单页面布局和更多 HTML 控件
我用 Joomla 制作一个网站主要是因为用户级别。现在,我已经投入到开发工作中,无法退出,我意识到 Joomla 的主题并不像 WordPress 那样出色。
当我开始制作 Joomla 主题时,我意识到没有像 single.php 这样的单独模板来显示文章页面。但我希望当我单击文章链接时,页面布局更宽,以便整篇文章更具可读性,基本上我想在查看单篇文章时隐藏侧边栏并使文章栏更宽。< /em>
最大的问题是我已经完成了HTML& Joomla 之前的 CSS 或任何 CMS 都会跳转到所有 HTML5 标签等等。我认为会有像 WordPress 或类似的东西的模板标签让我完全控制我的 HTML,但使用 Joomla,所有内容都会呈现为完整的组件,其中 HTML 和 CSS 都已设置。当我想要的只是上一页和下一页的 2 个链接时,分页只是呈现为列表,这真是太痛苦了。是我做错了什么还是 Joomla 就是这样构建的。
如果我开始按照自己想要的方式更改组件和模块,当我更新核心时它们是否会更改回默认值。我在 1.7 Joomla 的某处读到集成了一键升级。
我真诚地希望我是错的。
很抱歉将三个问题合而为一,但我认为我的标题很有解释性,因此任何寻找类似问题的人都会理解。
谢谢!我感谢所有的帮助。
I am making a site with Joomla mainly because of the user levels. Now hands on into development enough that I cannot back out, I've realized that Joomla's theming is not as awesome as WordPress'.
When I started making the Joomla theme I realized there is no single.php like separate template for displaying article pages. But I want that when I click on an article link the page layout is wider so that the full article is more readable, basically I wanna hide the sidebar and make the article column wider when viewing a single article.
The biggest problem is that I have finished the HTML & CSS pre Joomla or any CMS jump with all the HTML5 tags and what not. I figured there would be template tags like WordPress or something similar that would give me complete control of my HTML but with Joomla everything just gets rendered as complete components with HTML and CSS all set in. It was such a pain when the pagination just rendered as a list when all I wanted was 2 links of previous page and next page. Am I doing something wrong or is Joomla just built this way.
If I start changing the components and modules the way I want, will they be changed back to defaults when I update the core. I read somewhere from 1.7 Joomla has integrated 1 click upgrades.
I sincerely hope I'm just wrong.
Sorry for jamming three questions in one but I think my title is quite explanatory so anyone looking for similar things would understand.
Thanks! I appreciate all the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
欢迎来到 Joomla。因为你的问题很长,所以你的答案会保持不变...
首先要澄清一下,Joomla 模板是一个合适的模板引擎,而 Wordpress 不是(它甚至不是 CMS - 检查他们的网站) ),这通常被认为是糟糕的编码而不是最佳实践,因为它是一个陡峭的学习曲线。
1) 我想在查看单篇文章时隐藏侧边栏并使文章列更宽。
这可以通过模板中的条件分配来完成,如果在模板中的 RH 列周围,您可以将其放置在 if声明:
您还需要应用此代码将一个类添加到您的主要内容周围的包装器中,以告诉您的 CSS 使其变宽。
2)让我完全控制我的 HTML,但使用 Joomla,所有内容都被渲染为完整的组件,并设置了 HTML 和 CSS
这并不完全正确,所有制作精良的扩展都有一个包含可覆盖 html 输出的视图文件夹。例如,如果您希望从 com_content 为文章视图输出不同的 HTML,您可以复制以下文件:
并将其放置在模板中,如下所示:
3) 如果我开始按照我想要的方式更改组件和模块,当我更新核心时它们是否会更改回默认值。
假设您按照我的指示并使用覆盖而不是核心黑客,那么在升级核心时您将不会丢失更改。当然,您永远不应该在生产环境中升级。
如果有任何部分不清楚,请发表评论,我会尽力提供帮助。
and welcome to Joomla. Because your question(s) are long so will your answer so hold still...
First of all just to clear it up, the Joomla templating is a proper templating engine where as Wordpress is not (it's not even a CMS - check their website), this is often construed as poor coding rather than best practice as it's more of a steep learning curve.
1) I wanna hide the sidebar and make the article column wider when viewing a single article.
This can be done through conditional assignment within your template, if around your RH column in your template you can place this if statement:
You will also need to apply this code to add a class to your wrapper around your main content to tell your CSS to make it wide.
2) give me complete control of my HTML but with Joomla everything just gets rendered as complete components with HTML and CSS all set in
That's not entirely true, all WELL made extensions have a views folder containing overridable html output. For example if you wished different HTML to be outputted for the article view from com_content you would copy this file:
and place it in your template like so:
3) If I start changing the components and modules the way I want, will they be changed back to defaults when I update the core.
Assuming you follow my instructions and use overrides rather than core-hacks then you will not lose changes when upgrading the core. Naturally you should never upgrade in a production environment.
If any parts are unclear just drop a comment and I will help as best I can.
你肯定做错了,Joomla的模板系统比WP先进和灵活得多。您需要阅读模板覆盖系统以及如何使用可折叠模块位置。官方文档仍然以 1.5 为重点,但就覆盖和模块而言几乎是相同的。
覆盖 - http://docs.joomla.org/Understand_Output_Overrides
折叠列 - http://docs.joomla.org/Collapsing_columns
所有模板文档 - http: //docs.joomla.org/Template_Development
您还应该查看新的模板样式选项。
You are definitely doing it wrong, Joomla's templating system is far more advanced and flexible than WP. You need to read up on the template override system and how to use collapsible module positions. The official documentation is still 1.5 focused, but it's pretty much the same thing as far as overrides and modules are concerned.
Overrides - http://docs.joomla.org/Understanding_Output_Overrides
Collapsing columns - http://docs.joomla.org/Collapsing_columns
All template docs - http://docs.joomla.org/Template_Development
You should also look in to the new template style options.