[SUPERSEDED] SEF friendly URLs not displaying on some links

Locked
richieboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Fri Jun 23, 2006 9:04 pm

[SUPERSEDED] SEF friendly URLs not displaying on some links

Post by richieboy » Sun Jul 30, 2006 10:48 pm

Please see my post here:

http://forum.joomla.org/index.php/topic,81437.0.html

Running: Joomla 1.0.10.
Last edited by Robin on Wed Nov 15, 2006 8:21 am, edited 1 time in total.

richieboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Fri Jun 23, 2006 9:04 pm

Re: SEF friendly URLs not displaying on some links

Post by richieboy » Mon Jul 31, 2006 7:37 am

Here are some screenshots of the problem's i am having:

Image

I had a look in mod_mainmenu.php and sefRelToAbs is set for all links, so i dont understand why the menu links arent being SEF'd.

I also dont understand why the edit content link does'nt SEF (see above), as when looking in content.html.php it has this:

Code: Select all

		$link 	= 'index.php?option=com_content&task=edit&id='. $row->id . $row->Itemid_link .'&Returnid='. $row->_Itemid .'';
		$image 	= mosAdminMenus::ImageCheck( 'edit.png', '/images/M_images/', NULL, NULL, _E_EDIT, _E_EDIT );

		if ( $row->state == 0 ) {
			$overlib = _CMN_UNPUBLISHED;
		} else {
			$overlib = _CMN_PUBLISHED;
		}
		$date 		= mosFormatDate( $row->created );
		$author		= $row->created_by_alias ? $row->created_by_alias : $row->author;

		$overlib 	.= '<br />';
		$overlib 	.= $row->groups;
		$overlib 	.= '<br />';
		$overlib 	.= $date;
		$overlib 	.= '<br />';
		$overlib 	.= $author;
		?>
		<a href="<?php echo sefRelToAbs( $link ); ?>" onmouseover="return overlib('<?php echo $overlib; ?>', CAPTION, '<?php echo _E_EDIT; ?>', BELOW, RIGHT);" onmouseout="return nd();">
			<?php echo $image; ?></a>
Which seems to me like the link should be SEF'd!

Please help guys.  ???
Last edited by richieboy on Mon Jul 31, 2006 7:39 am, edited 1 time in total.

richieboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Fri Jun 23, 2006 9:04 pm

Re: SEF friendly URLs not displaying on some links

Post by richieboy » Mon Jul 31, 2006 4:40 pm

I have looked into this some more and if i edit any link to not contain "new" in the URL, for example:

index.php?option=com_content&task=new&sectionid=1&Itemid=0

to

index.php?option=com_content&task=newitem&sectionid=1&Itemid=0

It will SEF'ise the link. Does this mean that Joomla is specifically not SEF'ing any link that contains the text "new" or "edit" after the "task=" parameter?

I have added a function within weblinks and news components that does the same as "new" and "edit" but called them "newlink", "newnews" and "editnews" etc and this has fixed it, but its not ideal. Does anyone know of how to just tell Joomla to stop not SEF'ising URLs that have "new" or "edit" in them?

richieboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Fri Jun 23, 2006 9:04 pm

Re: SEF friendly URLs not displaying on some links

Post by richieboy » Sat Aug 05, 2006 2:11 pm

So can someone confirm that if Joomla finds a task=new or task=edit in the URL it wont bother to convert the string into an SEF URL?

Is there a reason for this?

User avatar
toubkal
Joomla! Hero
Joomla! Hero
Posts: 2860
Joined: Thu Aug 18, 2005 4:35 pm
Location: Cheshire, England
Contact:

Re: SEF friendly URLs not displaying on some links

Post by toubkal » Sat Aug 05, 2006 2:52 pm

I do not know why this decision was taken. I had a vague recollection of an answer somewhere but could not find it with a search.

To be honest, I found several posts asking the question but no answer.

I just looked in /includes/sef.php

and looked for instances of "new" and found several places where these are excluded.

if you edit them out, then the links do get SEF'd

My guess is that it was thought not necessary to SEF those as you are likely logged in and therefore search engines never see them anyway and it just reduces SEF overhead. This is just a guess.

here it is for content links

Code: Select all

// Component com_content urls
	if ( ( $parts['option'] == 'com_content' || $parts['option'] == 'content' ) && ( $parts['task'] != 'new' ) && ( $parts['task'] != 'edit' ) ) {
here it is for other components e.g. weblinks

Code: Select all

// all other components
	} else if ( ( strpos( $parts['option'], 'com_' ) !== false ) && ( @$parts['task'] != 'new' ) && ( @$parts['task'] != 'edit' ) ) {
if you remove e.g. && ( $parts['task'] != 'new' ) then you will get SEF for the links with task=new
Last edited by toubkal on Sat Aug 05, 2006 2:55 pm, edited 1 time in total.
Do you want the answer to be as vague as your question?

richieboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Fri Jun 23, 2006 9:04 pm

Re: [UNDER REVIEW] SEF friendly URLs not displaying on some links

Post by richieboy » Sat Aug 05, 2006 3:25 pm

Thankyou for your response, kind sir, i also searched and found these strings in the sef.php file but decided to leave it just in case i was going to mess something up. Basically i would just like all of my links to be search engine friendly, because it looks better if all the links are similar, and because it makes my pages XHTML compliant!

Thankyou again.

richieboy
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Fri Jun 23, 2006 9:04 pm

Re: [UNDER REVIEW] SEF friendly URLs not displaying on some links

Post by richieboy » Sat Aug 05, 2006 3:36 pm

Only slight problem i have found with this is when you view a submit/edit content page (frontend) after following a SEF'd link the tabbing at the bottom of the page (for Images/Publishing/Metadata) doesn't work and the tabs are turned into hyperlinks instead.

Its not a big problem, but if you know why it is doing that it would be good to fix it? Everything else seems to work perfectly, the content you are adding/editing goes through without problem.

User avatar
Robin
Joomla! Master
Joomla! Master
Posts: 15753
Joined: Thu Aug 18, 2005 10:41 am

Re: [UNDER REVIEW] SEF friendly URLs not displaying on some links

Post by Robin » Wed Nov 15, 2006 8:20 am

Q&T Note; unable to confirm in 1.0.11, for example Submit Weblink does get SEF'd. Marking as superseded.

@richieboy, if you still have problem, let me know here.


Locked

Return to “Superseded Issues - Archive”