简体   繁体   English

PHP / MySQL的动态内容布局结构

[英]Dynamic content layout structure with PHP/MySQL

Unfortunately, my boss decided that our news site's home page layout should be like http://dailymail.co.uk 不幸的是,我的老板决定我们新闻网站的首页布局应类似于http://dailymail.co.uk

But I couldn't find a solution for their "dynamic layout". 但是我找不到他们的“动态布局”的解决方案。 They use full one column image/posts, two columns of short/small images/titles, half column image/post in an unordered column. 他们在无序列中使用完整的一列图像/帖子,两列短/小图像/标题,半列图像/帖子。 I couldn't find a way to do that. 我找不到办法。

There are two "solutions" crossed my mind: 我想到了两个“解决方案”:

  • Choose a "template" for each news item. 为每个新闻项目选择一个“模板”。 And show them according to this template. 并根据此模板向他们展示。 For example: "With Big Image / Full Column", "Align Right half of the column" or "Normal" etc. But as you can see from daily mail's layout these will create lots of work for editors. 例如:“带有大图/全列”,“对齐列的右半部分”或“普通”等。但是,如从每日邮件的版式中可以看到的那样,这些将为编辑器带来很多工作。
  • Create a "Drag and Drop" based area, where an editor can arrange news with a few options. 创建一个基于“拖放”的区域,编辑者可以在其中选择一些选项来安排新闻。 But this will create another problems for me. 但这会给我带来另一个问题。

If needed I can change DB structure. 如果需要,我可以更改数据库结构。 But for now it's very simple and I'm willing to keep it that way. 但是现在它非常简单,我愿意保持这种方式。 Also it would be very nice to keep layout options separate from news table. 另外,将布局选项与新闻表分开也是非常好的。

Could anyone suggest a better solution? 有人可以提出更好的解决方案吗?

can you use a grid system like this: http://960.gs/ 您可以使用这样的网格系统吗:http: //960.gs/

I didn't use something like this but I think storing classnames in database and using them in this grid type templates might help you. 我没有使用类似的东西,但我认为将类名存储在数据库中并在此网格类型模板中使用它们可能会对您有所帮助。

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

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