简体   繁体   中英

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

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/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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