We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

One Blog Template, multiple embeds

How Do I?

szgalbraith's avatar
szgalbraith
3 posts
9 years ago
szgalbraith's avatar szgalbraith

Hi everyone,

Still working with EE 2 as that is what I’ve been working with for the last while trying to get a website up and running for a non-profit.

Basically, I am working on the blog/news portion of the website and I want to be able to make one template that houses the look of each individual post.

I may have missed it in my review of the docs so any help would be great.

Right now, I have the channel entries loop and then my HTML inside that.

{exp:channel:entries channel="blog" orderby="date" sort="desc" limit="10" paginate="bottom" dynamic="no"}
... HTML ...

What I want to do is put an embed in for the blog post template so that when I make changes to it, it will adjust no matter where someone is on the blog whether it be archives, search results, and so on.

If I can put the embed in, does it automatically recognize the tags from the channel entries?

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil

It does not automatically recognize the tags from a tag in the calling template, but there are a couple of things you could do:

1.) Have the whole {exp:channel:entries} tag in your embedded file. If you need different parameters you could either pass them on to the embed, or perhaps make use of url segments.

2.) You should probably give Layouts a try. I think they might be the best solution in your case.

       
Derek Jones's avatar
Derek Jones
7,561 posts
9 years ago
Derek Jones's avatar Derek Jones

I’m with Ingmar’s #2, layouts should work beautifully here and keep you nice and DRY.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.