Hi I am trying to get the title from a blog post into the main template. I am using the defut temples are in the CGBlog.
I found this page which might be out of date and for CMSMS version 1.12 and I have the lastest version.
https://www.sigmaweb.co.uk/2015/09/CGBl ... s-to-Posts.
Also the site http://www.i-do-this.com/ is download.
Can someone point me to a updated guide please or how to.
Thank you
CGBlog and geting title Topic is solved
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Re: CGBlog and geting title
In the top of the blog detail template, you could set something like:
Then in your page template you should have access to $blogtitle, which you can use for conditionally changing $title or whatever else you like. I often do something like:
Code: Select all
{$blogtitle=$entry->title scope=global}
Code: Select all
{if $blogtitle}
{$title=$blogtitle}
{else}
{$title={title}}
{/if}
<title>{$title} - {sitename}</title>
Not getting the answer you need? CMSMS support options
Re: CGBlog and geting title
Personally I like this approach: https://cmscanbesimple.org/blog/base-cm ... d-metatags
Especially because it doesn't need the if-then-else construct.
Especially because it doesn't need the if-then-else construct.
Re: CGBlog and geting title
The method I describe here collects all possible (default) values and passes them to the template with general names, so you can use them for multiple purposes. Simple, but very powerful!velden wrote: ↑Thu Nov 19, 2020 7:57 am Personally I like this approach: https://cmscanbesimple.org/blog/base-cm ... d-metatags
Especially because it doesn't need the if-then-else construct.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Re: CGBlog and geting title
I well have a read and add it to my template. That so much better to do that as my template is getting messy with if-then-else.
Thank you guys.
Thank you guys.