[solved] CGblog post title in page title
[solved] CGblog post title in page title
Hello
I am wondering if there is a way to to have the CGblog post title appear when in detail view only on the page title like so{$entry->title|escape}
I was wondering if there was a way to do it with and {if} statement some how:
{if some variable here}{$entry->title|escape}{else}{description}{/if}
That would be ideal. But if there is another way to do it that would be good too.
I am wondering if there is a way to to have the CGblog post title appear when in detail view only on the page title like so{$entry->title|escape}
I was wondering if there was a way to do it with and {if} statement some how:
{if some variable here}{$entry->title|escape}{else}{description}{/if}
That would be ideal. But if there is another way to do it that would be good too.
Last edited by kalozura on Sat May 01, 2010 9:44 pm, edited 1 time in total.
Re: CGblog post title in page title
can you give us an example of a variable you'd be wanting to use?
Re: CGblog post title in page title
I want CGblog to display the post title on the page title as such {$entry->title|escape} only on detail view of the blog page and not the summary view. So I was wondering if there was a way to do it with an {if} statement in the . Im not sure what is possible but I was thinking something would identify that the page is now on detail view. This example wont obviously work but here is an idea of what I am hoping is possible.can you give us an example of a variable you'd be wanting to use?
{if $entry->detail}{$entry->title|escape}{else}{description}{/if}
so by $entry->detail I mean something that identifies the detail apart from the summary view on the blog page so that it will show the post name in the title as oppose to the {description}. Hope that makes sense.

Re: CGblog post title in page title
Are you not able to use the summary and details templates for this - just remove the title in the template where you don't want it to show. Will that work for you or is there a reason you need to do it the way you say?
Re: CGblog post title in page title
in detail view template insert:
and in template of page insert
vilkis
Code: Select all
{capture assign=custom_title}
{$entry->title|escape}
{/capture}
Code: Select all
{if !isset($custom_title)}
{capture assign=custom_title}{title}{/capture}{/if}
<title>{$title}</title>
Re: CGblog post title in page title
Thanks Vilkis
Altho what you gave me did not quite work for me, it did give me and idea that did work!
Here is what I did:
in the CGblog details template I added this code:
in the page template I added the following code the title tag:
Works like a charm so far
thanks to all for your help!
Altho what you gave me did not quite work for me, it did give me and idea that did work!
Here is what I did:
in the CGblog details template I added this code:
Code: Select all
{capture assign=blog_title}
{$entry->title|escape}
{/capture}
Code: Select all
<title>{if isset($blog_title)}{$entry->title|escape}{else}{title}{/if} | {sitename}</title>

Last edited by kalozura on Sat May 01, 2010 4:09 am, edited 1 time in total.
Re: CGblog post title in page title
Nice that you found the solution. I made mistake, the last code should be
by the way: http://forum.cmsmadesimple.org/index.ph ... 304.0.html
vilkis
Code: Select all
{if !isset($custom_title)}
{capture assign=custom_title}{title}{/capture}{/if}
<title>{$custom_title}</title>
vilkis
Re: CGblog post title in page title
Well it worked fine up until I added a list of recent blog post. I want to show a list view of the 5 recent posts...
then it no longer worked and just showed the title of the very first post on all the other posts in detail view. So if i went to view post number 3 the at the top of the page was that of post number one.
so not quite solved
I'm assuming that having the summary template in there is making it go crazy, anyone have any suggestions??
Thanks
Code: Select all
{CGBlog number="5" summarytemplate="list-template"}
Code: Select all
<title></title>
so not quite solved

I'm assuming that having the summary template in there is making it go crazy, anyone have any suggestions??
Thanks
Re: CGblog post title in page title
Do you use your or my code?
I did now. The last correction you made, made all the difference it works perfect now. Thanks gain Vilkis!!
[SOLVED] Re: [solved] CGblog post title in page title
I tried your code vilkis but it is not working for me. Any suggestions?
CMS Version
1.7.1
CGBlog
1.4
CMS Version
1.7.1
CGBlog
1.4
Last edited by inyerface on Thu Jul 08, 2010 4:37 am, edited 1 time in total.
Re: [solved] CGblog post title in page title
Hi,
if you enter
in detail view template what do you see?
vilkis
if you enter
Code: Select all
A{$entry->title|escape}A
vilkis
Re: [solved] CGblog post title in page title
I see the title of my Blog post
I have in my Details Template in CGBlog:
And in my regular CMS template I have:
I have in my Details Template in CGBlog:
Code: Select all
{capture assign=custom_title}
{$entry->title|escape}
{/capture}
Code: Select all
{if !isset($custom_title)}
{capture assign=custom_title}{title}{/capture}{/if}
<title>{$custom_title}</title>
Re: [solved] CGblog post title in page title
EDIT: forgot half of it... 
Try this in your CGBlog Details Template
And this in your CMS Template:

Try this in your CGBlog Details Template
Code: Select all
{assign var='custom_title' value=$entry->title|escape}
Code: Select all
<title>
{if isset($custom_title)}{$custom_title}
{else}{title}
{/if}
</title>
Last edited by panthus on Wed Jul 07, 2010 6:02 pm, edited 1 time in total.
Re: [solved] CGblog post title in page title
Ok, what is value of variable $config['process_whole_template'] in config.php? By the way what is a version of CMSMS?inyerface wrote: I see the title of my Blog post
I have in my Details Template in CGBlog:
And in my regular CMS template I have:Code: Select all
{capture assign=custom_title} {$entry->title|escape} {/capture}
Code: Select all
{if !isset($custom_title)} {capture assign=custom_title}{title}{/capture}{/if} <title>{$custom_title}</title>
vilkis