Recent Topics

1 Sep 21, 2006 23:30    

I'm trying to eliminate the text, "Post details:" from appearing - I still want the actual title to show up, just not the "post details" writing (To me, the fact that it's a permalink post should be apparent). However, I can't seem to find it anywhere and I don't want to just delete the title entirely ... any thoughts?

2 Sep 22, 2006 00:02

<?php
	// ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
	request_title( '<h2>', '</h2>' );
	// ------------------------------ END OF REQUEST TITLE -----------------------------
?>


Delete (or better still comment out) that bit and you'll have your post title but not the "post detail" bit. You also won't have page titles for stuff like archives and profile pages. Others too I'm sure, like category-specific titles. Anyway I'm pretty certain removing or commenting out it will remove the bit you don't want from your permalink pages.

3 Sep 22, 2006 13:19

Edb- that's not what I had in mind. All I want out is the words "post details" - I still want everything else (i.e. last comments, etc). This has to be defined somewhere right?

4 Sep 22, 2006 15:49

Exactly...
in 0.9 you had a list of all the titles, and you could easily delte 1 title that you don't want..

Now it is just 1 function..

I have no solution for you (yet)

5 Sep 22, 2006 16:03

Maybe try.. inc/_misc/_template.funcs.php

default:
			// We are displaying (a) message(s)...
			if( $preview )
			{	// We are requesting a post preview:
				$r[] = T_('PREVIEW');
			}
			elseif( intval($p) )
			{	// We are requesting a specific post by ID:
				if( $Item = & $ItemCache->get_by_ID( $p, false ) )
				{
					$r[] = T_('Post details').': '.$Item->get('title');
				}
			}
			elseif( !empty( $title ) )
			{	// We are requesting a specific post by title:
				if( $Item = & $ItemCache->get_by_urltitle( $title, false ) )
				{
					$r[] = T_('Post details').': '.$Item->get('title');
				}
			}

I'm not sure though!!

6 Sep 22, 2006 16:15

At the skin or in the core?

At the skin you can make that bit be conditional:

<?php
   // ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
   if( $disp != 'single' ) {
      request_title( '<h2>', '</h2>' );
      }
   // ------------------------------ END OF REQUEST TITLE -----------------------------
?>

In the core you go where John just pointed and change both instances of

$r[] = T_('Post details').': '.$Item->get('title');


to

$r[] = '';

7 Sep 22, 2006 16:19

<?php
   // ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
   if( $disp != 'single' ) {
      request_title( '<h2>', '</h2>' );
      }
   // ------------------------------ END OF REQUEST TITLE -----------------------------
?>

Neat... thanks for that.

8 Sep 22, 2006 23:55

If what you want to do is get rid of the preamble in the Title
eg: T_('Post details').': ' etc etc

simply delete everything between the $r[] = and the $Item->get('title');

so go from

$r[] = T_('Post details').': '.$Item->get('title');


to

$r[] = $Item->get('title');

9 Sep 25, 2006 04:56

Very cool. Did the one where it's conditional to the skin. Thanks a lot!

10 Oct 01, 2006 18:57

John wrote:

If what you want to do is get rid of the preamble in the Title
eg: T_('Post details').': ' etc etc

simply delete everything between the $r[] = and the $Item->get('title');

so go from

$r[] = T_('Post details').': '.$Item->get('title');


to

$r[] = $Item->get('title');

Where would I find the location of this file in ver 9.2? I want to change the "post details" text.

Thank you in advance,
DEL

Found it - core/_functions_bposts.php

11 Jan 01, 2007 22:28

I'm also trying to remove the "Post Details" string out of the title.

I tried the If statement but it didn't have any effect.

<title>
	<?php
		$Blog->disp('name', 'htmlhead');
		request_title( ' - ', '', ' - ', 'htmlhead' );
	?>
	
	</title>

Is there an If block for request_title( ' - ', '', ' - ', 'htmlhead' );

Thanks

12 Jan 02, 2007 00:02

esanchez wrote:

Is there an If block for request_title( ' - ', '', ' - ', 'htmlhead' );

Thanks

Not until you make one.

<title>
   <?php
      $Blog->disp('name', 'htmlhead');
      if( $disp != 'single' ) {
        request_title( ' - ', '', ' - ', 'htmlhead' );
        }
   ?>
   
   </title>


This will remove the post title from the <title> tag when someone is on a single post page.

13 Feb 02, 2007 05:37

Hi EdB,

I tried the code but the If Statement Removes the "Blog Post Title"

So that I get
"Blog Name" instead of
"Blog Name : Blog Article Title"

Are there any parameters for the request_title() Function?
Is there a way to replace ("Post Details:") via php...
e.g. Replace("Post Details:", "");

Having "Post Details" really looks bad in searches and when others link to your articles via RSS.

thoughts?

14 Feb 02, 2007 06:04

To get a title for a permalink page that says "blog name - article title" will require hacking a core file. So let's go there! Searching http://doc.b2evolution.net/v-1-8/elementindex.html for "request_title" leads me to http://doc.b2evolution.net/v-1-8/evocore/_blogs---inc---_misc---_template.funcs.php.html#functionrequest_title which doesn't really help much, but does link to http://doc.b2evolution.net/v-1-8/__filesource/fsource_evocore__blogsinc_misc_template.funcs.php.html#a59 shows that lines 103 and 110 is where the text you want gone shows up. Therefore it's time to open up inc/_misc/_template.funcs.php, find that bit, and change it to suit your needs. Something like this is probably where you want to be:

elseif( intval($p) )
{	// We are requesting a specific post by ID:
	if( $Item = & $ItemCache->get_by_ID( $p, false ) )
	{
		$r[] = $Item->get('title');
	}
}
elseif( !empty( $title ) )
{	// We are requesting a specific post by title:
	if( $Item = & $ItemCache->get_by_urltitle( $title, false ) )
	{
		$r[] = $Item->get('title');
	}
}

Untested though, so the only promise I'll make is that I'll cheerfully refund your purchase price if this hack destroys your blog and causes global warming to escalate rapidly. (As someone who learned the hard way once said: backup all files you're about to edit before you realize you should have backed up all the files you're about to edit.)

15 Feb 24, 2007 05:23

EdB,

I realize I never thanked you for this workaround. Thanks.

It's working very nicely.


Form is loading...