2

Hello Joomla community,

I'm forced to write a minimum Joomla (3.4.1) plugin that injects custom meta tags based on an URL parameter. It will be used to serve localized Facebook Open Graph stories.
The problem is, I have literally NO Joomla and PHP background and a VERY tight deadline! Can you please explain how this can be accomplished in a bare minimum implementation?

What I need to know is:

  • What's the easiest/fastest way to create an empty Joomla (3.4.1 compatible) component?
  • How can the current url be read?
  • How can a custom tag be injected to the page?

If those questions are answered, I should be able to figure out the rest by myself, so please explain in as much detail as possible.

Thank you very much!

  • I can't imagine how you will be able to develop a plugin - or component, within a tight deadline with no Joomla and PHP background. – FFrewin May 29 '15 at 14:43
  • That's a good point, but with a background in software development, it's not that hopeless. Thank you very much for getting me on the right track! – SePröbläm May 30 '15 at 19:02
6

Assuming that with "Read Current Url", you mean that you want to be able to get request data, then:

$jinput = JFactory::getApplication()->input;
$url_parameter = $jinput->get('url_param', 'default', 'filter');

Extended Documentation with info about the filter options: Retrieving_request_data_using_JInput


To add metadata in the head:

$document = JFactory::getDocument();
$document->setMetaData( 'tagname', 'tagcontent' );

As for the easiest/fastest way to create an empty component, check the Hello World component:

https://github.com/joomla/Joomla-3.2-Hello-World-Component

https://docs.joomla.org/J3.x:Developing_a_MVC_Component/Developing_a_Basic_Component

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.