Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
routing in Joomla 2.5
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
FRamonTB  
View profile  
 More options Sep 11 2012, 12:47 pm
From: FRamonTB <framo...@gmail.com>
Date: Tue, 11 Sep 2012 09:47:49 -0700 (PDT)
Local: Tues, Sep 11 2012 12:47 pm
Subject: routing in Joomla 2.5

Hello all,

   I have coded a router.php that build a SEF URI from this:

   www.mysite/index.php?option=myComp&controller=myContr&id=25

to this:

   www.mysite/index.php/component/myComp/item-number-25

But I would like to get a route like this:

   www.mysite/item-number-25

How could I achieve this coded in myCompBuildRoute() function?

I have tryed with:

   unset($query['option']);

but I get a SEF URI like this:

   www.mysite/index.php/component/item-number-25

I can't either to make the "component" segment disappear, nor the
"index.php". How could I do?

Thanks in advance.
Regards: framontb


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FRamonTB  
View profile  
 More options Sep 11 2012, 1:26 pm
From: FRamonTB <framo...@gmail.com>
Date: Tue, 11 Sep 2012 10:26:26 -0700 (PDT)
Local: Tues, Sep 11 2012 1:26 pm
Subject: Re: routing in Joomla 2.5

OK... after enabling the Use Apache mod_rewrite/URL rewriting option and
Save, only remains the "component" segment:

www.mysite/component/item-number-25

I want to delete it from the URI.

Any help will be appreciated.

Regards

El martes, 11 de septiembre de 2012 18:47:49 UTC+2, FRamonTB escribió:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
fornandakishore  
View profile  
 More options Sep 11 2012, 8:16 pm
From: fornandakishore <fornandakish...@gmail.com>
Date: Wed, 12 Sep 2012 05:46:25 +0530
Local: Tues, Sep 11 2012 8:16 pm
Subject: Re: [jgen] Re: routing in Joomla 2.5

Create a menu item for that link, then only the component word will gone.
i.e. you have created a menu item with alias name as 'item-number-25' then
the url should be www.sitename.com/item-number29

Thanks & Regards

Nanda Kishore. M
Senior PHP Developer

http://php-desk.blogspot.com

Mobile: + 91 98499 71144


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FRamonTB  
View profile  
 More options Sep 12 2012, 10:31 am
From: FRamonTB <framo...@gmail.com>
Date: Wed, 12 Sep 2012 07:31:31 -0700 (PDT)
Local: Wed, Sep 12 2012 10:31 am
Subject: Re: [jgen] Re: routing in Joomla 2.5

Thanks for the response Nanda !!!

Are there a way for suppressing the word "component" in the SEF URI without
creating a menu item? Perhaps something that I can do inside my router.php
file of my component?

Regards: framontb

El miércoles, 12 de septiembre de 2012 02:16:50 UTC+2, Nandu escribió:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FRamonTB  
View profile  
 More options Sep 12 2012, 12:44 pm
From: FRamonTB <framo...@gmail.com>
Date: Wed, 12 Sep 2012 09:44:49 -0700 (PDT)
Local: Wed, Sep 12 2012 12:44 pm
Subject: Re: [jgen] Re: routing in Joomla 2.5

Hello,

   finally I found a way for suppressing the word "component" when there is
no "option" in the URI segments. What I'm going to say probably is a  
 folly but I would like to know why...

   I have modified the function _buildSefRoute(&$uri) inside the
class JRouterSite (includes/router.php) so that the code:

if (!$built) {
$tmp = 'component/'.substr($query['option'], 4).'/'.$tmp;

}

   changed to be:

if (!$built) {
if (isset($query['option'])) $tmp = 'component/'.substr($query['option'],
4).'/'.$tmp;

}

so if there is no "option" (by means of a "unset( $query['option'] );"
inside my component router.php) there will not be "component" segment...
the point is: why I need the "component" word, if I have no "option"? have
I broken some functionality? I don't understand very well the insides of
the routing process, so I don't know if this little change have broken
something.

I know... it is not advisable to change the Joomla! core. The same can be
achieved by an external RewriteRule with the mod_rewrite module inside
apache, but such thing will decrease performance server.

Regards: framontb

El miércoles, 12 de septiembre de 2012 16:31:31 UTC+2, FRamonTB escribió:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Stephen Docherty  
View profile  
 More options Sep 14 2012, 12:23 am
From: Adam Stephen Docherty <adam.doche...@gmail.com>
Date: Thu, 13 Sep 2012 21:23:57 -0700 (PDT)
Local: Fri, Sep 14 2012 12:23 am
Subject: Re: [jgen] Re: routing in Joomla 2.5

>>> I don't understand very well the insides of the routing process, so I

don't know if this little change have broken something.

Join the club... does anyone know of any updated information / docs on
using JRoute in the new versions, ie 2.5?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Thomas  
View profile  
 More options Sep 14 2012, 7:00 am
From: Matt Thomas <m...@betweenbrain.com>
Date: Fri, 14 Sep 2012 07:00:38 -0400
Local: Fri, Sep 14 2012 7:00 am
Subject: Re: [jgen] Re: routing in Joomla 2.5

Hi framontb,

I'm not any sort of expert, but I don't see any good reason for hard coding
part of the URL. I'd like to encourage you to create a pull request, with
this change, to see if this can fixed in core.

Thanks for reporting your fix.

Best,

Matt Thomas
Founder betweenbrain™
Lead Developer Construct Template Development Framework
Phone: 203.632.9322
Twitter: @betweenbrain
Github: https://github.com/betweenbrain

Composed and delivered courtesy of Nexus 7.
On Sep 12, 2012 12:44 PM, "FRamonTB" <framo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
elin  
View profile  
 More options Sep 14 2012, 8:37 am
From: elin <elin.war...@gmail.com>
Date: Fri, 14 Sep 2012 05:37:08 -0700 (PDT)
Local: Fri, Sep 14 2012 8:37 am
Subject: Re: [jgen] Re: routing in Joomla 2.5

What if someone made a menu link  with the alias item-number-25?

I'm assuming that you mean item-number- woudl be replaced by an alias since
obviously  autogenerating item-number-25 from the id and nothing else you
would have a mega problem  if two components did the same thing?

Elin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FRamonTB  
View profile  
 More options Sep 14 2012, 11:04 am
From: FRamonTB <framo...@gmail.com>
Date: Fri, 14 Sep 2012 08:04:33 -0700 (PDT)
Local: Fri, Sep 14 2012 11:04 am
Subject: Re: [jgen] Re: routing in Joomla 2.5

Hello all,

   thanks for your kind responses.

    I think Elin is right in all that she said. Please, let me explain
myself a little more about the problem I'm involved with, so you could
understand this estrange things I'm proposing. Please, take it carefully
because I'm not very expertise (nor much, nor little) in the subject.
  All of these is regarding SEO, since a site-administrator's
perspective. Suppose I have a data base with thousand of items (say cars
for example). So, I can't generate a menu item for each of the items. I
want in my site an URI with only relevant words for the item
view specifically (nor other views, that I want process as the normal
router treatment). AFAIK, this is better for SEO. For example, the word
"component" is not relevant for search engines; neither the name of my
component... so I want these words out of the URI. Right?
   I have an easy way to do this... Simply writing the URI directly without
using JRoute::_ function. So, I can have an URI of the type described:
www.mysite/item-number-25
   Suppose that the number "25" could be any in the range  (1, 20.000). Now
Joomla! have a problem, because it doesn't know how to parse this query:
"item-number-25". For solving this problem I can put an "internal"
RewriteRule inside the .htaccess file provided by joomla! 2.5, and indicate
here what the component router should it use. The problem with these is
that now the component is not ready for use after install and need some
configuration work. Besides, there are two different ways to process the
URIs (with JRoute, and without), wich is not nice. So, I would like to
generate the 'simple' URI since the router component.
   For so speaking there are two problems:
- I can't generate the simple URI: www.mysite/item-number-25 inside my
router component, without touching the core.
- I can't say the Joomla routing process how to process it, without
touching the core.

   And this is the problem I'm trying to solve...
   Please, let me apologize , because I explain myself bad and besides,
probably I said wrong things and too long. I would appreciate someone that
open my eyes. Don't doubt to say "folly" if this is this the case !!!

Regads: framontb

El viernes, 14 de septiembre de 2012 14:37:08 UTC+2, elin escribió:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
elin  
View profile  
 More options Sep 14 2012, 11:31 am
From: elin <elin.war...@gmail.com>
Date: Fri, 14 Sep 2012 08:31:25 -0700 (PDT)
Local: Fri, Sep 14 2012 11:31 am
Subject: Re: [jgen] Re: routing in Joomla 2.5

As a webmaster all you need to do is make a menu link for each category
root in each extension (*not* the real category root), that will clean up
everything. It won't be pretty if you have deep categories but it will work
to get rid of the component segment.

Elin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Weavers  
View profile  
 More options Sep 14 2012, 8:59 pm
From: Nick Weavers <nickweav...@yahoo.co.uk>
Date: Fri, 14 Sep 2012 17:59:06 -0700 (PDT)
Local: Fri, Sep 14 2012 8:59 pm
Subject: Re: routing in Joomla 2.5

Hi  framontb,

I had a similar requirement.

My clients SEO company wanted to publish lots of topical content relevant
to the clients industry (mortgages) with chosen keywords appearing in the
urls, and for links to those articles to appear at the bottom of the home
page. When a link was clicked, the article was to be show alongside a "call
to action" form and other content.  

I managed to get things to function as I wanted for SEO as follows:

1) My component pretty much controls the whole site including the front
page, so I created a menu item with a title of Home Page and a link of the
type external URL type and gave it the URL of my component and the view for
the homepage (eg index.php?option=com_dealdirect&view=homepage).
2) I clicked the radio button for 'yes' on the Default Page option to make
this menu item get actioned when the site is visited via a URL with no
query or path appended to the domain name.
3) Now, since my component is running my home page, my custom router gets a
chance to parse and build my URL's. That means I can pretty much have any
url my router can build and parse.
4) Also, any module I write that is shown on the site template while my
component is in control can also create links that the component router
will parse.

So, if the front page of your site was a catalogue listing generated by
your component, you could create the links in the format you want
 (/item-number-25) and your components ParseRoute function could decode
this to build a query string like task=itemController.showItem&item=25 to
show a full page of info for the item.

You can see it in action on the site at www.dealdirectfinancial.co.uk.

Nick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »