Joomla 2.5 Component SEF hide the View name

1,307 views
Skip to first unread message

Mushr00m

unread,
Jul 19, 2012, 9:03:31 PM7/19/12
to joomla-de...@googlegroups.com
Hi all ! First post on the group for me ;-)

I'm developping a component in frontend for J2.5 ans I'm having a little issue with the SEF URL.
I have 2 views "Items" and "Item". When I click on an item to see its details the URL SEF looks like this :
http://www.MYWEBSITE.com/MenuName/item/12-thenameoftheitem.html

How should I do to delete the "item" value ? I think it's the name of the view but I don't understand how to delete this in the URL...

Thanks a lot !

Mushr00m

unread,
Jul 23, 2012, 3:41:23 PM7/23/12
to joomla-de...@googlegroups.com
Ok I found the solution, so in the router.php in the BuildRoute function use :
        unset( $query['view'] );

Maqsood

unread,
Jul 23, 2012, 3:46:02 PM7/23/12
to joomla-de...@googlegroups.com
Hi I am facing same issue with 2.5 SEF URL 

my component url show as below
website/es/destination/Italy/Rome/49.html

do you know how can i take off destination (component name) and 49 (iteam from url)

Mushr00m

unread,
Jul 23, 2012, 3:48:30 PM7/23/12
to joomla-de...@googlegroups.com
You have to use router.php in your component and specialy the BuildRoute function to create your SEF URL

Alan Hartless

unread,
Jul 23, 2012, 3:50:13 PM7/23/12
to joomla-de...@googlegroups.com
I believe the component name will always be displayed for any component that isn't attached to an Item id, otherwise Joomla does not know what component to call up.  Create a menu item for the component and the component name will be replaced by your menu name.

Thanks!
Alan Hartless
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/uOcVv5q5daEJ.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Mushr00m

unread,
Jul 23, 2012, 4:01:10 PM7/23/12
to joomla-de...@googlegroups.com
I agree with you for the component name, sorry I didn't saw "destination" was to component name, but he seems to want to change also the ID 49 and change we need to know by what you want to change it ? 49 is the item ID or the menu item ID ?

Maqsood

unread,
Jul 23, 2012, 4:05:43 PM7/23/12
to joomla-de...@googlegroups.com
OK I agree with component name. Currently my URL Is like this
website/es/destination/Italy/Rome/49.html

How can i change it to 
website/es/destination/Italy/rome.html

i don't want to show item id. Do you know how to remove it from url?

Thank you
Maqsood

Mushr00m

unread,
Jul 23, 2012, 4:09:36 PM7/23/12
to joomla-de...@googlegroups.com
In the router.php :
if (isset($query['id'])) {
        unset( $query['id'] );
    };

Alan Hartless

unread,
Jul 23, 2012, 4:09:57 PM7/23/12
to joomla-de...@googlegroups.com
You are sure 49 is the Item Id?  If you disable SEF, what does the non-sef URL look like?

Thanks!
Alan Hartless


--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/NmNQ53od998J.

Maqsood

unread,
Jul 23, 2012, 5:16:21 PM7/23/12
to joomla-de...@googlegroups.com
After disable sef url my component url is: com_pregistrations&view=destination&id=3&country=91&Itemid=571&lang=en
so iteam id is: 571



On Monday, July 23, 2012 4:09:57 PM UTC-4, harty83 wrote:
You are sure 49 is the Item Id?  If you disable SEF, what does the non-sef URL look like?

Thanks!
Alan Hartless


On Monday, July 23, 2012 at 1:05 PM, Maqsood wrote:

OK I agree with component name. Currently my URL Is like this
website/es/destination/Italy/Rome/49.html

How can i change it to 
website/es/destination/Italy/rome.html

i don't want to show item id. Do you know how to remove it from url?

Thank you
Maqsood
 

On Monday, July 23, 2012 4:01:10 PM UTC-4, Mushr00m wrote:
I agree with you for the component name, sorry I didn't saw "destination" was to component name, but he seems to want to change also the ID 49 and change we need to know by what you want to change it ? 49 is the item ID or the menu item ID ?

Le vendredi 20 juillet 2012 03:03:31 UTC+2, Mushr00m a écrit :
Hi all ! First post on the group for me ;-)

I'm developping a component in frontend for J2.5 ans I'm having a little issue with the SEF URL.
I have 2 views "Items" and "Item". When I click on an item to see its details the URL SEF looks like this :
http://www.MYWEBSITE.com/MenuName/item/12-thenameoftheitem.html

How should I do to delete the "item" value ? I think it's the name of the view but I don't understand how to delete this in the URL...

Thanks a lot !

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/NmNQ53od998J.
To post to this group, send an email to joomla-dev-general@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-general+unsub...@googlegroups.com.

Mushr00m

unread,
Jul 23, 2012, 5:30:42 PM7/23/12
to joomla-de...@googlegroups.com
Ok so "destination" is your view and not your component name so you can get rid of it with my previous post


Le vendredi 20 juillet 2012 03:03:31 UTC+2, Mushr00m a écrit :

Bruno Batista

unread,
Jul 25, 2012, 10:32:18 AM7/25/12
to joomla-de...@googlegroups.com

Bruno Batista

unread,
Jul 25, 2012, 10:32:47 AM7/25/12
to joomla-de...@googlegroups.com

Mushr00m

unread,
Jul 25, 2012, 9:33:04 PM7/25/12
to joomla-de...@googlegroups.com
Just an other question. For my link I have the Catid and the alias like this : 3:NameOfMyCategorie. So the Sef URL gives : www.mywebsite.com/3-nameofmycategorie/1-myitem.html
I want to remove the ID of my category from the URL to have just : www.mywebsite.com/nameofmycategorie/1-myitem.html

Is that possible ?

Thanks


Le vendredi 20 juillet 2012 03:03:31 UTC+2, Mushr00m a écrit :
Reply all
Reply to author
Forward
0 new messages