[joomla] OK, I give up. Where is the "magic" for links?
David Roth
davidalanroth at gmail.com
Tue Jul 17 20:30:02 EDT 2012
I understand what you are saying. That makes a lot of sense.
At the root directory of one Joomla 2.5 installations I did this:
grep -l JURI `find .` | wc -l
And it counted 184 files which JURI is used. So it is being much more than
I would suspect. There might be other situations it is needed which I've
not come across yet. Here is a code snipped from K2 where it is used in a
/components/com_k2/views/item/view.html.php:
// Absolute URL
$uri = &JURI::getInstance();
$item->absoluteURL = $uri->toString();
David Roth
On Tue, Jul 17, 2012 at 11:40 AM, Chris French <contact at chrisfrench.me>wrote:
> Something seems not right about this.
>
> Relative paths are not a joomla thing they are a web thing, putting the
> domain in the href isn't only not needed it is not recommended because what
> if you change your domain name?
>
> Now this wouldn't be as much of an issue if you were using the juri to
> generate but still this is 99% of the time not needed.
>
> You should post the code you were writing and the problem and we can fix
> it for you
> On Jul 17, 2012 7:44 AM, "Matt Thomas" <matt at betweenbrain.com> wrote:
>
>> Hi David,
>>
>> Thanks. Out of curiosity, what was the code that you were writing?
>>
>> Best,
>>
>> Matt Thomas
>> Founder betweenbrain <http://betweenbrain.com/>™
>> Lead Developer Construct Template Development Framework<http://construct-framework.com/>
>> Phone: 203.632.9322
>> Twitter: @betweenbrain
>> Github: https://github.com/betweenbrain
>>
>>
>>
>> On Tue, Jul 17, 2012 at 10:12 AM, David Roth <davidalanroth at gmail.com>wrote:
>>
>>> Hi Matt.
>>>
>>> The mystery to me is that in the code I was writing I never did a call
>>> to JURI, so it must be done further up the chain or the Joomla template
>>> does it. Either way, it was alarming to 'echo' the variable only to see it
>>> didn't contain a full URL.
>>>
>>> I never paid attention to the relative paths before because they were
>>> working so I didn't bother to examine them until now.
>>>
>>> Thanks everyone. I learned something today. If the base URL is not
>>> working, then a call to JURI is needed. If it is working, it's because
>>> someplace it has already been taken care of by a call to JURI.
>>>
>>> David Roth
>>>
>>>
>>> On Tue, Jul 17, 2012 at 9:12 AM, Matt Thomas <matt at betweenbrain.com>wrote:
>>>
>>>> Hi David,
>>>>
>>>> Without seeing an example of the page source, I can only guess that K2
>>>> uses relative paths for the links. Can you post a link to the site in
>>>> question and cite an example link from that page?
>>>>
>>>> Best,
>>>>
>>>> Matt Thomas
>>>> Founder betweenbrain <http://betweenbrain.com/>™
>>>> Lead Developer Construct Template Development Framework<http://construct-framework.com/>
>>>> Phone: 203.632.9322
>>>> Twitter: @betweenbrain
>>>> Github: https://github.com/betweenbrain
>>>>
>>>>
>>>>
>>>> On Tue, Jul 17, 2012 at 8:53 AM, David Roth <davidalanroth at gmail.com>wrote:
>>>>
>>>>> I was poking around in K2, and when I had it print out via 'echo' a
>>>>> link, I noticed it didn't include the domain. It included everything after
>>>>> that. While I was playing with this K2 template I thought I had left
>>>>> something out. Then I did a view source on the page and all links didn't
>>>>> include the domain, but they work just fine.
>>>>>
>>>>> How is the domain being inserted when it's displayed as a web page? I
>>>>> am guessing this takes place as Javascript someplace? If so, where?
>>>>>
>>>>> Yes, I know we get this done for free and should be thankful, but I'd
>>>>> really like to know how this work. Thanks in advance for a
>>>>> kind explanation.
>>>>>
>>>>> David Roth
>>>>>
>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/joomla/attachments/20120717/f095c5d3/attachment.html>
More information about the Joomla
mailing list