modify mospagebreak?

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
User avatar
fabs
Joomla! Explorer
Joomla! Explorer
Posts: 432
Joined: Mon Apr 03, 2006 4:04 pm
Location: Germany
Contact:

modify mospagebreak?

Post by fabs » Thu Jul 26, 2007 6:50 pm

The comments in mospaging code sugests that the pagebreak title can be appended to the article title.
How does that work and how does the code neeed to be modified? the current code just appends the mospagebreak heading to article title. Will the article title be changed dynamically according to the page on that you are when modifying to append mospagebreak title to article title??

this is the corresponding code in mospaging:

Code: Select all

	// adds heading or title to <site> Title
	 	if ( $title ) {
			$page_text = $page + 1;
			$row->page_title = _PN_PAGE .' '. $page_text;
			if ( !$page ) {
				// processing for first page
				parse_str( html_entity_decode( $matches[0][2] ), $args );

				if ( @$args['heading'] ) {
					$row->page_title = $args['heading'];
					//$row->page_title = '';
				} else {
					$row->page_title = '';
				}

			} else if ( $matches[$page-1][2] ) {
				parse_str( html_entity_decode( $matches[$page-1][2] ), $args );

				if ( @$args['title'] ) {
					$row->page_title = ': '. stripslashes( $args['title'] );
				}
			}
	 	}
Last edited by fabs on Thu Jul 26, 2007 6:52 pm, edited 1 time in total.
Please visit my personal website and leave many traces ;)
http://www.ffaabbiiaann.de
If you need webdesign services I can help you out:
http://www.webdesign2punkt0.de

User avatar
nathandiehl
Joomla! Champion
Joomla! Champion
Posts: 6044
Joined: Fri Aug 19, 2005 3:03 pm
Location: Indiana, USA
Contact:

Re: modify mospagebreak?

Post by nathandiehl » Thu Jul 26, 2007 7:09 pm

{mospagebreak Title here}

if you put that in your content when you call {mospagebreak}, that does what you are looking for, yes?
If you're new to Joomla, Please read Anna's Joomla! Tips: http://forum.joomla.org/viewtopic.php?t=5503

http://nathandiehl.com | Find out what makes me tick

User avatar
fabs
Joomla! Explorer
Joomla! Explorer
Posts: 432
Joined: Mon Apr 03, 2006 4:04 pm
Location: Germany
Contact:

Re: modify mospagebreak?

Post by fabs » Thu Jul 26, 2007 7:16 pm

sorry... it does not...
have mospagebreak with a title each but there is no title being appended to article title depending on page...
Please visit my personal website and leave many traces ;)
http://www.ffaabbiiaann.de
If you need webdesign services I can help you out:
http://www.webdesign2punkt0.de

User avatar
fabs
Joomla! Explorer
Joomla! Explorer
Posts: 432
Joined: Mon Apr 03, 2006 4:04 pm
Location: Germany
Contact:

Re: modify mospagebreak?

Post by fabs » Mon Jul 30, 2007 12:54 am

Is there really no way to append the page title dynamically to the Article title?
Please visit my personal website and leave many traces ;)
http://www.ffaabbiiaann.de
If you need webdesign services I can help you out:
http://www.webdesign2punkt0.de

shumisha
Joomla! Guru
Joomla! Guru
Posts: 520
Joined: Sat Aug 20, 2005 3:15 pm
Contact:

Re: modify mospagebreak?

Post by shumisha » Tue Aug 07, 2007 11:08 am

Hello,

It is actually a small bug in Joomla ! It's been quite some time I have ben bugged by this, so i wanted to correct this with my sh404SEF component. Then I saw it was already there, simply it was not working. To fix it :

- Open /components/com_content/content.html.php
- locate function show(???), near line 435 (J! 1.0.13)
- locate this piece of code at line 445

Code: Select all

// adds mospagebreak heading or title to <site> Title
		if ( isset($row->page_title) && $row->page_title ) {
			$mainframe->setPageTitle( $row->title .' '. $row->page_title );
		}
- move or copy it down a few lines, immediatly after :

Code: Select all

// process the new bots
		$_MAMBOTS->loadBotGroup( 'content' );
		$results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );
So the beginning of function show now looks like :

Code: Select all

	function show( &$row, &$params, &$access, $page=0 ) {
		global $mainframe, $hide_js;
		global $mosConfig_live_site;
		global $_MAMBOTS;

		$mainframe->appendMetaTag( 'description', 	$row->metadesc );
		$mainframe->appendMetaTag( 'keywords', 		$row->metakey );

		// calculate Itemid
		HTML_content::_Itemid( $row );

		// determines the link and `link text` of the readmore button & linked title
		HTML_content::_linkInfo( $row, $params );

		// link used by print button
		$print_link = $mosConfig_live_site. '/index2.php?option=com_content&task=view&id=' . $row->id .'&pop=1&page='. $page . $row->Itemid_link;

		// process the new bots
		$_MAMBOTS->loadBotGroup( 'content' );
		$results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );
		
		// adds mospagebreak heading or title to <site> Title
		if ( isset($row->page_title) && $row->page_title ) {
			$mainframe->setPageTitle( $row->title .' '. $row->page_title );
		}
		
		if ( $params->get( 'item_title' ) || $params->get( 'pdf' )  || $params->get( 'print' ) || $params->get( 'email' ) ) {
			?>
			<table class="contentpaneopen<?php echo $params->get( 'pageclass_sfx' ); ?>">
			<tr>
Basically, addition of page_title was done before firing mambots, while it is the mambots that were calculating the page_title.

I have done very limited testing, I hope it does not break anything else.

I think I am still trying to make a workaround in sh404SEF.

Regards

PS: could you set up a bug in bug tracker if this is confirmed ?
4SEO, all-in-one SEO extension for Joomla 3 & 4 - https://weeblr.com
I don't reply to PM anymore. Thanks for using 4SEO and wbAMP

User avatar
jakebls
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Wed Nov 23, 2005 3:53 pm

Re: modify mospagebreak?

Post by jakebls » Tue Aug 07, 2007 1:04 pm

In your content add {mospagebreak title=Page Title}

You need to add the = sign in order for this to work. 

Hope this helps!
Jake

shumisha
Joomla! Guru
Joomla! Guru
Posts: 520
Joined: Sat Aug 20, 2005 3:15 pm
Contact:

Re: modify mospagebreak?

Post by shumisha » Tue Aug 07, 2007 1:18 pm

Hi jake,

Actually what you need to add is :
{mospagebreak title=Page Title&heading=My page title}

When you insert this, "Page" will be used as article title for the NEXT page, and "My page title" is used for the page before the mospagebreak tag. It is the 'heading' that is used in the TOC. So one would assume that heading should also be used in the HTML page Title tag, and that is what Joomla is doing, however the bug listed above was preventing the page HTML title tag to be set correctly.

Regards
4SEO, all-in-one SEO extension for Joomla 3 & 4 - https://weeblr.com
I don't reply to PM anymore. Thanks for using 4SEO and wbAMP

User avatar
jakebls
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Wed Nov 23, 2005 3:53 pm

Re: modify mospagebreak?

Post by jakebls » Tue Aug 07, 2007 1:32 pm

Thanks shumisha!  I didn't know that !

Gotta love the forums!

Jake

GabyZ
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Sat Jan 06, 2007 11:57 pm
Contact:

Re: modify mospagebreak?

Post by GabyZ » Wed Jan 30, 2008 9:40 pm

shumisha wrote: Hello,

It is actually a small bug in Joomla ! It's been quite some time I have ben bugged by this, so i wanted to correct this with my sh404SEF component. Then I saw it was already there, simply it was not working. To fix it :
Works! This is a bug, yes. Many many thanks man, your support is appreciated ;)


Locked

Return to “General Questions - 1.0.x”