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

Dynamic Page titles with Layout Templates?

How Do I?

liberty79's avatar
liberty79
135 posts
10 years ago
liberty79's avatar liberty79

I’m trying to have one layout template to rule them all. Basically, how can I pull something like this off for every page?

{exp:channel:entries channel="news" limit="1" status="open"}

{layout=”site/_layout” title=”{title}” }

{/exp:channel:entries}

Or more ideally:

if layout template title is not set, use channel entry title. I can’t figure this out!

Edit: I realize that syntax doesn’t work, I’m just trying to describe what i’m trying to achieve here.

       
liberty79's avatar
liberty79
135 posts
10 years ago
liberty79's avatar liberty79

bad timing, but i figured it out :(

after the template layout tag, i needed:

{exp:channel:entries channel="news" limit="1" status="open"}
{layout:set name="title"}{title}{/layout:set}
       
Jeremy S.'s avatar
Jeremy S.
353 posts
10 years ago
Jeremy S.'s avatar Jeremy S.

If you’re looking to expand on that, this post is pretty helpful: https://willowlightstudio.com/news/2015/seo-a-simple-approach-for-meta-tags-with-expressionengine

       
liberty79's avatar
liberty79
135 posts
10 years ago
liberty79's avatar liberty79
If you’re looking to expand on that, this post is pretty helpful: https://willowlightstudio.com/news/2015/seo-a-simple-approach-for-meta-tags-with-expressionengine

excellent post. thank you!

       

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.