egurb
egurb

Reputation: 1216

How to maintain similar content blocks on web site?

I am trying to find best way to maintain a web page which consist mostly of similar content blocks (blog type). I don't want to have one endless page and if I need to change something to go for each block one by one. I have the structure below right now.

<section>
    <!--all styles are same-->
    <div>
        <!--all styles are same-->
         <div>
             <!--different content-->
         </div>
    </div>
</section>

Considering the structure I thought about PHP Includes or AngularJS NG-Repeat but I am not sure. Could you please share you experience working with such type of structure and give some tips as I don't know which keyword to you to search similar topics. Thanks in advance.

Upvotes: 0

Views: 72

Answers (2)

Carl Vitullo
Carl Vitullo

Reputation: 923

If you're not already using Angular, just use PHP includes to do this. You can your pages into reusable chunks and just include those files where necessary.

PHP includes will take place on the server, while Angular will be rendered on the user's computer. It's not clear from your question if you're already using Angular or not, but if you aren't, it's 100% not worth adding it just for this.

Upvotes: 1

dejakob
dejakob

Reputation: 2092

Sure, look up angular directives, then you can make a component for a blog with this content.

https://docs.angularjs.org/guide/directive

Upvotes: 1

Related Questions