[英]Multiple column articles in Joomla
I've got a client that requires that an article be displayed in two, sometimes three, columns in Joomla. 我有一个客户,要求一篇文章在Joomla中显示为两列,有时显示为三列。 I am fairly sure they won't be happy with having to edit 3 articles for 3 columns so the splitting would have to be done automatically.
我相当确定他们不会为3列编辑3篇文章而感到满意,因此拆分必须自动完成。
I've done something similar before where it'll split a chunk of HTML into n columns, but have no real idea how to accomplish this within Joomla itself. 在将HTML的大块拆分为n列之前,我已经做过类似的事情,但是不知道如何在Joomla本身中完成此工作。
Any ideas gratefully recieved! 任何想法表示感谢!
This doesn't seem to be easy. 这似乎并不容易。
At first thought this should be an CSS attribute, but if it exists, it is part of CSS 3.0 and as such only understood by modern browsers (if at all). 最初认为这应该是CSS属性,但是如果存在,它就是CSS 3.0的一部分,因此只有现代浏览器才能理解(如果有的话)。 But I didn't find any way to do this in CSS.
但是我没有找到任何在CSS中执行此操作的方法。
So you actually have to modify your HTML code. 因此,您实际上必须修改HTML代码。 I would propose the following:
我将提出以下建议:
This way, it is half-automized, without mangeling in the Joomla! 这样,它可以实现半自动化,而无需在Joomla中进行操作! files but only adding to extensions to it.
文件,但仅添加扩展名。
An alternative approach: 替代方法:
Use Javascript to split up the Article in several column in the browser. 使用Javascript将“文章”拆分为浏览器的几列。 Here I could imagine a full-automated approach could work.
在这里,我可以想象全自动的方法可以奏效。
Advantages (over the first approach): 优点(相对于第一种方法):
However, have in mind that it should rest usable for those who have Javascript disabled. 但是,请记住,它应该对禁用Javascript的用户可用。
the CSS 3 rules for multi-columns are: CSS 3的多列规则是:
-column-width
-列宽
-column-gap
-column隙
-column-rule
-column规则
-column-count
-column数
with the vendor label (-moz, -webkit) before. 之前带有供应商标签(-moz,-webkit)。
More info at http://www.css3.info/preview/multi-column-layout/ 有关更多信息, 请访问http://www.css3.info/preview/multi-column-layout/
I would use css and tell the people with Explorer to change browser! 我会使用CSS并告诉具有Explorer的人员更改浏览器! (i'm jocking of course)
(我在开玩笑)
Otherwise javascript is the way like said before. 否则,javascript就像之前所说的那样。 This script should do (not tested) http://13thparallel.com/archive/column-script/
该脚本应该执行(未经测试) http://13thparallel.com/archive/column-script/
This should be done through the template, some PHP coding is involved. 这应该通过模板来完成,其中涉及一些PHP编码。
One of our clients asked us to do the exact same thing before, and we have done it through template. 我们的一位客户要求我们之前做完全相同的事情,并且我们已经通过模板完成了。 Note that for very small articles we increased the font in order to split the article into 3 columns.
请注意,对于非常小的文章,我们增加了字体,以将文章分为3列。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.