简体   繁体   English

Joomla:不同文章的多个模板

[英]Joomla: Multiple templates for different Articles

in Wordpress we can have different style or template for each posts. 在Wordpress中,我们可以为每个帖子使用不同的样式或模板。

I want to know how can I have something similar in Joomla 3. I need to have 3 different post style for articles. 我想知道如何在Joomla 3中提供类似的功能。我需要为文章提供3种不同的帖子样式。 one of them has no sidebar and full width post layout. 其中之一没有侧边栏和全角帖子布局。 I know I can have post without sidebar for specific category which assign to the menu but I need to have this option in post submit article in backend because I need this feature just for specific articles not all of articles in a category. 我知道我可以为菜单分配特定类别的不带侧边栏的帖子,但是我需要在后端的后提交文章中使用此选项,因为我仅针对特定文章而不是类别中的所有文章才需要此功能。

the challenging part of this, is how to remove sidebars and in specific articles. 最具挑战性的部分是如何删除侧边栏和特定文章。

by the way I have no problem using T3 or other framework to get this working. 顺便说一句,我没有问题使用T3或其他框架来完成此工作。 I just need clue to handle this. 我只需要线索来解决这个问题。

Take look at these example for better view: 请看以下示例以获得更好的视图:

normal post http://zoomg.ir/2015/10/08/68251/introduce-prime-world-defenders/ 正常发布http://zoomg.ir/2015/10/08/68251/introduce-prime-world-defenders/

no sidebar with full width post http://zoomg.ir/2015/04/18/28227/samsung-galaxy-s6-review-gaming/ 没有带有全角帖子的边栏http://zoomg.ir/2015/04/18/28227/samsung-galaxy-s6-review-gaming/

You can try the helix3 framework, it's easy to manage the layout. 您可以尝试helix3框架,它很容易管理布局。

Essentially on the default layout you have 2 positions, left and right, at the sides of the main content (component part), so if you create a module and assign it to left position it will appear on the left sidebar reducing the content size like in your first example. 本质上,在默认布局上,主要内容(组件部分)的两侧分别具有左右两个位置,因此,如果创建模块并将其分配给左侧位置,它将出现在左侧边栏上,从而减小了内容大小,例如在第一个示例中。

If you need just full article type and article with a sidebar (left or right no matter) this is the best solution. 如果您只需要完整的文章类型和带有侧边栏的文章(无论是左侧还是右侧),这就是最佳解决方案。

By the way, you can create custom templates for your joomla articles. 顺便说一句,您可以为joomla文章创建自定义模板。 Inside the template folder: html/com_content/article you find the override of the default article. 在模板文件夹:html / com_content / article中,您可以找到默认文章的替代内容。

You can duplicate the default.php and rename as, for example, sidebar.php. 您可以复制default.php并重命名为例如sidebar.php。 Then change the code as you prefer. 然后根据需要更改代码。 In this way you'll find the new alternative template inside you administrator panel, go to your article and under the options look at the last dropdown. 这样,您将在管理员面板中找到新的替代模板,转到您的文章,然后在选项下查看最后一个下拉列表。

Here more information: https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core 此处提供更多信息: https : //docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

Hope it helps, Marco 希望对您有所帮助,马可

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM