2
votes

I want to link a pdf file in a Joomla(2.5) article page. This pdf file resides in

PROJECT_NAME/pdf/filename directory.

Is there any solution by using which I don't need to write the whole path statically or I can say if there is any way to get base_url in article?

Same way I also need to link some menu items in article text.

2

2 Answers

1
votes

I think if you want to add just Link to PDF then no need to add full path

it will work just normal image or normal page link

just try to check with remove / before your href link and let me know wether it is working or not

In my project it is working just having

href="dir1/dir2/dir3/file.pdf"

if you try this

href="/dir1/dir2/dir3/file.pdf" 

then you will have different address in both case

in my case href="dir1/dir2/dir3/file.pdf" it is working

2
votes

JURI::base() looks like the command you looks for.

Documentation here

Note:

In a template you can use the shortcut $this->baseurl instead of JURI::base( true ).