Creating a link from an article id only

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
cclofton
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 20, 2008 1:08 am

Creating a link from an article id only

Post by cclofton » Thu Mar 20, 2008 1:20 am

Hi there, I'm just beginning to get inside joomla 1.5, and I'm stuck. I have made a very basic custom component that calls the jom_content table, so I have access to the id of each article. I'm wondering if there is some internal function in Joomla that creates a url that can be linked in standard html ONLY from the article id. Yes, I could call the other tables and build it up....but I'm sure there must be a better way.

....and before I get flamed for asking such an obvious question - yes, I have searched the forums and the internet. I'm probably not using the right terminology to search, my fault, but it doesn't help that the titles in the forum search are cut short so you can't see each subject!

Thanks

cclofton
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 20, 2008 1:08 am

Re: Creating a link from an article id only

Post by cclofton » Thu Mar 20, 2008 5:18 pm

OK - related question.....I'm using includephp to run php within an article, and I was wondering what variables are available. Presumably, since the data is already being parsed by some script, there must be a simple way to call variables for the current article. In particular, I'm looking for the title-alias and id of the article that the php is in.

Also....in case it's not obvious, I could really do with a good link to understanding the joomla internal structure. I have looked through the api, but I need something a little more basic with examples.

Any help would be much appreciated.

Thanks

User avatar
THE_AI
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Jun 03, 2006 4:33 pm
Contact:

Re: Creating a link from an article id only

Post by THE_AI » Sun Mar 23, 2008 4:22 pm

What do you mean with HTML only link?

Perhaps the getArticle function from com_content will help you.

http://forum.joomla.org/viewtopic.php?f=476&t=269637
Well, now I will try to develop extensions :)

cclofton
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 20, 2008 1:08 am

Re: Creating a link from an article id only

Post by cclofton » Sun Mar 23, 2008 5:09 pm

I meant how do you produce a standard url if you know nothing except the article id? However, what I really want to know is my second question - when an article is being parsed in php, what variables are available (if any) to any php INSIDE the article (using includephp). It would be very helpful to know. I only want to do very simple actions. At simplest, I just want to print the article id WITHIN the article using php. If this is possible, I should be able to find my way around doing slightly more complex things.

Thanks for the reply.


Post Reply