Joomla 文章布局基于导航的变化
我尝试在网上搜索很多但未能得到任何解决方案。
实际上我想根据用户导航更改 joomla 文章中的布局。
举个例子,假设用户访问 iPhone 案例研究&单击任何案例研究(例如:愤怒的小鸟),它包含 iPhone 屏幕上愤怒的小鸟项目的图像/幻灯片,而如果从 iPad 案例研究页面访问同一篇文章,它包含 iPad 屏幕的水平图像(注意:布局已更改)。
简而言之 - 我需要内容和内容根据导航或条件,同一文章中的布局发生变化。
有没有任何插件或组件可以帮助我实现这一目标?任何帮助将不胜感激。
谢谢
I tried search lot on net but failed to got any solution.
Actually I want to change layout in my joomla article based on the user navigation.
For an example let say if user visiting iPhone Case studies & click on any case study(eg: Angry Bird) it contains the images/slideshow of angrybird project in iphone screen, while if the same article visit from iPad case studies page it contains horizontal image of ipad screen (Note: layout is changed).
To be short - I need the content & layout change in same article base on navigation or condition.
Is there any plugin or component which will help me to achieve this ? Any help will be appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为解决这个问题的最简单的解决方案是针对上述每种情况使用两篇不同的文章。这样您就可以轻松地按照您想要的方式设计任一案例。与使用不同的文章相比,我认为使用一篇文章并没有什么特别的优势。如果您发现任何特殊优势,请与我们分享。
无论如何,如果您希望它仍然使用单个文章,在我看来,这将是一个更复杂的解决方案。据我所知,不存在可以满足您的特定用例的插件或组件。
I think the easiest solution for this problem would be to use two different articles for each of the above said cases. That way you can easily style either of the cases the way you want. And by using one article for it, I see no particular advantage, as opposed to using different articles. If you see of any particular advantage please share it with us.
In any case if you want it to still use a single article, it seems to me that it would be a more complex solution. From what I know, there does not exist a plugin or component to cater your particular use case.
我想到的一个快速而肮脏的解决方案包括 Jumi 扩展,您可以在这里找到它: http ://extensions.joomla.org/extensions/1023/details。 Jumi 允许您在文章等中包含 PHP。
然后,您可以进行用户代理检查并输出特定设备和特定文章所需的所有内容。
如果您需要为两种设备使用不同的模板/布局,我会推荐一个主题框架,它可以为您完成这些操作(为不同的设备应用不同的布局)。 Joomlart 的 T3 框架在这些方面做得很好: http:// www.joomlart.com/joomla/t3-framework-and-ja-purity-templates
A quick and dirty solution, that comes into my mind includes the Jumi extension, which you can find here: http://extensions.joomla.org/extensions/1023/details . Jumi allows you to include PHP in your articles, etc..
You can then make an user-agent check and output everything as you need it for that particular device and for that particular article.
If you need different templates/layouts for both devices, I would recommend a theming framework, which does these things for you (applying different layouts for different devises). The T3 Framework from Joomlart does these things pretty well: http://www.joomlart.com/joomla/t3-framework-and-ja-purity-templates
我认为你的问题的答案是“布局覆盖”。只需在用于内页的特定模板文件夹中为文章组件创建布局覆盖即可。
我认为您应该阅读以下 Wiki 页面以获得更清晰的理解 -
Joomla 1.5-http://docs。 joomla.org/How_to_override_the_output_from_the_Joomla!_core
Joomla 1.6(应该适用于1.7 也是如此)-http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6
希望这个解决你的问题。干杯。
I think the answer to your problem is 'Layout overrides'. Just create a layout override for the article component in the particular template folder you use for your inner-pages.
I think you should read through the following Wiki pages for a more clear understanding-
Joomla 1.5-http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
Joomla 1.6(Should be applicable for 1.7 as well)-http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6
Hope that this solves your problem. Cheers.
我在 Stackoverflow 上看到了另一篇文章。这表示我们可以将页面类后缀附加到标签中。以便根据菜单 ID 按照我们想要的方式设置每篇文章的样式。这可能比布局覆盖更容易。查看-
Joomla:我们如何分配不同的布局到不同的菜单ID?
I have seen another post here on Stackoverflow. Which says we can append page-class suffix to the tag. So as to style each article the way we we want, based on menu ids. This may be easier than a Layout override. Check out-
Joomla : How can we assign a different layouts to different menu IDs?