Support the ongoing development of Laravel.io →
posted 11 years ago
Database

I'm trying to implement post formats on a project, much like WP does it. Post formats are used to give a blog a Tumblr style. You can chose to post an Standard Post / Galley / Video / Image / Link, etc. Each of these formats have meta data link links, IDs, etc. But I'm having trouble to figure out how lay down the tables for the post format meta data like link, images and stuff.

What table layout would you recommend?

Last updated 3 years ago.
0

Haven't tried this, but maybe you could create a layout for each post type?

<div class="youtube-post-type">
    @yield('post-content')
</div>

Then use it if the post is a certain type

@if($post['type'] == 'youtube')
    @extends('layouts.youtube-post-type')
Last updated 3 years ago.
0

No, that part is easy. I'm asking where in database should I store format metadata like youtube links and images ID. What would be the best approach of storing them?

Last updated 3 years ago.
0

Maybe create a separate metadata table with row post_id, meta_data and type. Then look for rows matching the post_id. This could allow multiple items per post as well.

Last updated 3 years ago.
0

Yep, that would work and that's exactly how WordPress does it. While it would work fine, I was looking for an alternative approach since I've tried to avoid using a metadata table.

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

banago banago Joined 21 Jan 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.