Joomla! Discussion Forums



It is currently Tue Nov 24, 2009 7:56 pm (All times are UTC )

 




Post new topic Reply to topic  [ 161 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
Posted: Wed Jun 27, 2007 10:20 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Thu Sep 14, 2006 11:41 am
Posts: 225
Location: Berlin
Hi,
please have a look at: http://forum.joomla.org/index.php/topic,175396.0.html. If an url is parsed and you do not use an item-id every time the parameters of the default-menu-item used (router.php function parse()). The only solution I imagine is, to append all additional parameters to your link.

hsm


Top
  E-mail  
 
Posted: Wed Jun 27, 2007 2:55 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
nobitavn94 wrote:
$link =JRoute::_('index.php?option=com_reports');
$this->setRedirect($link,'Saved article successuflly');


This should be :

Code:
$link =JRoute::_('index.php', false);
$this->setRedirect($link,'Saved article successuflly');


If you only want to redirect to the active component you don't need to add the option to the route, doing so will result in  unwanted behavior.

Note the false in in the JRoute function, this is needed to make sure the route is not espaced for xhtml compilance.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
Posted: Tue Aug 21, 2007 3:25 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Sep 15, 2005 9:45 am
Posts: 37
Location: Italy
I really enjoy the new way of routing but... be careful on how you create URLs!

To my knowledge (RFC 1738, http://www.faqs.org/rfcs/rfc1738.html), the usage of an unescaped ":" in an URL is forbidden!
So, ...&id=38:ArticleName&... is not a valid URL!

Here is an extract from the RFC:
Quote:
  Reserved:

  Many URL schemes reserve certain characters for a special meaning:
  their appearance in the scheme-specific part of the URL has a
  designated semantics. If the character corresponding to an octet is
  reserved in a scheme, the octet must be encoded.  The characters ";",
  "/", "?", ":", "@", "=" and "&" are the characters which may be
  reserved
for special meaning within a scheme. No other characters may
  be reserved within a scheme.

  Usually a URL has the same interpretation when an octet is
  represented by a character and when it encoded. However, this is not
  true for reserved characters: encoding a character reserved for a
  particular scheme may change the semantics of a URL.

  Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
  reserved characters used for their reserved purposes may be used
  unencoded within a URL.


  On the other hand, characters that are not required to be encoded
  (including alphanumerics) may be encoded within the scheme-specific
  part of a URL, as long as they are not being used for a reserved
  purpose.


Just for completeness, if you try to pass the URL through Joomla's JFilterOutput::stringURLSafe function, all the ":" are removed, as expected!

Anyway, really a good job!

_________________
Fabrizio Sala
Netdream


Top
   
 
Posted: Tue Aug 21, 2007 5:53 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6431
There are many applications that use unencoded ':' in their URL's for none-schema specific parts. Even Google creates URL's with unencoded ':' in it. I'm personaly not too worried about the RFC.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
   
 
Posted: Thu Oct 16, 2008 7:02 pm 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Jan 25, 2006 6:37 am
Posts: 133
Location: USA
pollen8 wrote:
also is there any way to remove the "index.php" from the url?

e.g.

http://localhost/joomla15/index.php/component/2

becomes

http://localhost/joomla15/component/2


Use Apache mod_rewrite set to yes

_________________
High Quality Joomla Templates http://www.youjoomla.com
Joomla Templates | Free Joomla Templates | Joomla Tutorials


Top
  E-mail  
 
Posted: Thu Oct 16, 2008 8:12 pm 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Jan 25, 2006 6:37 am
Posts: 133
Location: USA
@jinx,
thnx for the improvemant , I see most aspects are covered but 1 of them either I was not able to find an answer to or was never asked.

If I have a module that outputs the links to news items , I need these links to open full article page ,
put as you know the engine ads Itemid1 to the end of the link ,
I have tried to make a fake item id like we used to do in j1.0 but no go ,


I tried this
Code:
$id = $row->id.':'.$row->alias;
$link = "index.php?view=article".$row->catid."&id=".$id;";


like you mentioned in the beginning but no go if SEF is on or OFF , I get 500 error

this works but only with SEF off

Code:
$link="index.php?view=article&id=".$row->id.":".$row->alias."&catid=".$row->catid."
&option=com_content&Itemid=1000";


both of them are called by

Code:
echo ".JRoute::_($link).";



could you please advise what original news item link output should be used

_________________
High Quality Joomla Templates http://www.youjoomla.com
Joomla Templates | Free Joomla Templates | Joomla Tutorials


Top
  E-mail  
 
Posted: Thu Oct 16, 2008 8:31 pm 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Jan 25, 2006 6:37 am
Posts: 133
Location: USA
ok fund a working link for article but still itemid1 is being added

Code:
$link = "index.php?view=article&id=". $row->id .":".$row->alias;

_________________
High Quality Joomla Templates http://www.youjoomla.com
Joomla Templates | Free Joomla Templates | Joomla Tutorials


Top
  E-mail  
 
Posted: Fri Oct 17, 2008 5:04 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Wed Nov 22, 2006 3:35 pm
Posts: 6423
Location: Nebraska
It is a good idea to use threads that are less than 3 months old - this one has been over a year since the last post.

In modules - use this approach to get a good URL for an article:

Code:
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
...
Query
....
JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));


Best approach is to see what core is doing, and follow suite. Hope that helps,
Amy :)

_________________
http://Twitter.com/AmyStephen
Unofficial Joomla Developer and Site Builders Network http://AllTogetherAsAWhole.org


Top
   
 
Posted: Fri Oct 17, 2008 5:10 am 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Wed Jan 25, 2006 6:37 am
Posts: 133
Location: USA
Thnx Amy :) , I was hoping somone will answer and just did not want to open
new thread with same question

it seems I also fund a way to get a fake on , here it is and works perfect with sef on off and 404Sef

Code:
$link = "index.php?view=article&id=". $row->id .":".$row->alias."&option=com_content&Itemid=";


please let me know if this should not be used or it might cause some errors or slowdown the installation in any way

thank you again, I will also try your fix

_________________
High Quality Joomla Templates http://www.youjoomla.com
Joomla Templates | Free Joomla Templates | Joomla Tutorials


Top
  E-mail  
 
Posted: Sun Oct 26, 2008 6:44 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Sep 19, 2008 12:47 am
Posts: 7
So i've been told I'm having what appears to be an ItemID problem. Regardless I need to fix this quickly.

For example, when clicking on a link associated with a article in mod_latestnews, the article is displayed ~below~ the rows/modules located in the center column, but that is not what I need to happen. The article should display top-to-bottom in the center column.

The same problem occurs with any module that displays an article including: mod_latestnews, mod_mostread, mod_minifrontpage


From another source/person helping me to troubleshooting this problem...

1.Go to the site so the url looks like this
http://www.techmediaglobal.com/

2.Then click the link the first popular pages link in the module in the sidebar

--> Integration of MPLS with Optical Transport Networks

3.Now click the home link again and look at the url
http://www.techmediaglobal.com/inde...t ... &Itemid=77

**Notice the Itemid

4. Now click or hover on any links in the latest or popular papers and you will see they now ll have the same itemid=77

The modules now will load on all these pages because the modules load based on the itemid number its assigned to it. The Itemid is what Joomla uses to decide which modules and templates need to appear on the page.... Perhaps its just a bug in the Joomla latest and popular modules.

OK, I did a quick google search and found a module that helps fix itemid problems with these 2 modules. I am not 100% sure if it is related or not... but you have a read and search around I am sure this is where the problem lies.

First: long joomla thread about this
viewtopic.php?t=125365

A module that fixes the latestnews itemid:
http://extensions.joomla.org/compon...k ... Itemid,35/ http://electronicmother.com/cms/ind...ew&id=23&Itemid=9

One other place to look at the details of this issue is a great article from Alledia
http://www.alledia.com/blog/joomla-...- ... d-itemids/
..........

k.


Top
  E-mail  
 
Posted: Sun Oct 26, 2008 6:51 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Jun 01, 2006 1:52 pm
Posts: 778
Location: Moscow, Russia
Hi, kirby!
Please check and fix the links in your message. They are somehow "shortened" :(

_________________
Text of all my messages is available under the terms of the GNU Free Documentation License: http://www.gnu.org/copyleft/fdl.html


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 161 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

Quick reply

 



Who is online

Users browsing this forum: becyn, ianmac, Matrix818181, PommeVerte, stevenca and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group