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

Problem displaying Layout title

How Do I?

Matahi's avatar
Matahi
29 posts
2 years ago
Matahi's avatar Matahi

When I try to display the title of a layout (layout:title) in a template and the original entry is titled with a number less than 3 digits, it is blank. Only if I include a letter in the title or the title is greater than three digits does it appear correctly.

Does anyone know why?

       
JCOGS Design's avatar
JCOGS Design
148 posts
2 years ago
JCOGS Design's avatar JCOGS Design

It would help you get a faster / more complete reply if you could:

  • Provide information about the version of ExpressionEngine you are using
  • Provide some information about the hosting environment being used (e.g. php version, server type)
  • Provide an example of the template tag that you are having difficulty with

?

       
Matahi's avatar
Matahi
29 posts
2 years ago
Matahi's avatar Matahi

Of course, JCOGS. I am using the 7.3.14 version of EE running on the 8.24 version of XAMPP.

{exp:channel:entries channel="films" require_entry="no" dynamic="yes" limit="1"} {layout:set name='title'}{title}{/layout:set} {/exp:channel:entries}

Thnx.

       
Russ K.'s avatar
Russ K.
174 posts
2 years ago
Russ K.'s avatar Russ K.

Hi Matahi, Just to confirm, you are using a layout variable with a layout Template and not trying to call it inside the same file. Correct?

General page to page_layout structure should be:

For the page:

{layout="_layouts/_my_page_layout"}

{exp:channel:entries channel="films" require_entry="no" dynamic="yes" limit="1"}
    {layout:set name='title'}{title}{/layout:set}
{/exp:channel:entries}

In the page “_layouts/__my_page_layout” :

{layout:title}

R

       
Matahi's avatar
Matahi
29 posts
2 years ago
Matahi's avatar Matahi

That is correct, Russ K. I am not trying to call it inside the same file.

Thnx

       
Rob Allen's avatar
Rob Allen
3,105 posts
2 years ago
Rob Allen's avatar Rob Allen

What happens if you rename the parameter to something unique, e.g.

{layout:set name='page-title'}{title}{/layout:set}

and use {layout:page-title} in your layout template.

       
JCOGS Design's avatar
JCOGS Design
148 posts
2 years ago
JCOGS Design's avatar JCOGS Design

I have been unable to replicate on my local system (EE7.3.14, php 8.1). What happens if you try some variations - do you get a result when you use this tag (for example)?

{exp:channel:entries channel="films" require_entry="no" dynamic="yes" limit="1"} 
    {layout:set name='title'}x-{title}{/layout:set}
{/exp:channel:entries}

and then in the template where you retrieve the value

{layout:title:replace find="x-" replace=""}

Would be interesting to know if it makes any difference. ?

       
Matahi's avatar
Matahi
29 posts
2 years ago
Matahi's avatar Matahi

Renaming the parameter to something unique nor using another tag does not work either.

I am pretty sure the problem is the title. Using a a two or three digits title instead a combination of letters and numbers. ?

       

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.