Page titles
Is there a way for me to get the heading inside my template to be shown as the page title? Tried a few diff methods but cant get any of them to work. Want my heading, which also is the slub, to be my page title.
Is there a way for me to get the heading inside my template to be shown as the page title? Tried a few diff methods but cant get any of them to work. Want my heading, which also is the slub, to be my page title.
Yes, I'm sure. Can you show us the code you're using? We'd need some context to be able to help.
This is my project.php file:
This is my projects-template.html:
Which is the field you want to use as a title?
One of these:
Or
So you could do this:
My content don't show with 'skip-template', or maybe i've done something wrong?
Where exactly shall i paste your code? Sorry, not an php expert at all.
This is just to retrieve the heading, don't replace your existing code with this.
Documentation for perch_content_custom is here https://docs.grabaperch.com/docs/content/perch-content-custom/
The code Drew has given you is used to write the title from your content into a variable so it can be used in the title of your page, so you need to add this to your detail page.
I understand. So I placed the code Drew wrote me but cant find the part in your link where i can get the information out from the variable. I'm looking to make a page title as "My customer - title from the inside the template".
Thanks in advance
Are you outputting the value in your template?
No not yet. Can't find what code to place there.
Should just be:
I have now this code in my strategy.php file:
Ive tried to put this code in my <title></title> but couldnt get it the title. What have ive done wrong?
What does
<perch:showall />
output?Outputs
Page - <perch:showall />
. I've got this to work with my blog using the code:Is there a way to use this same technique to get the id="title" inside my perch_content_custom template?
I mean in the template where you're trying to use the title.
What shall I look for? I dont want to have <perch:showall /> there for a long time since my page is already live. It was very easy to get this to work properly with the blog app. Is there a way to use this same technique to get the id="title" inside my perch_content_custom template?
Can you not try it in your dev environment?
Click the link to see the output from
<perch:showall />
https://www.dunderverk.no/prosjekter/perchshowall.html
So it looks like
title
is set:Is that what you'd expect it to be?