The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
PostPosted: Wed May 13, 2009 5:26 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Dec 19, 2006 6:56 am
Posts: 28
Hi Guys,

I am using the 'accordion menu apple style' plugin, and can access it by typing the following in an articels text box:
Code:
{Accordion_Menu_Apple_style}
<a href="http://www.site1.com">Clothing</a>
- <a href="http://www.site1.com">Shirts</a>
- <a href="http://www.site1.com">Shorts</a>
- <a href="http://www.site1.com">Pants</a>
- <a href="http://www.site1.com">Skirts</a>
- <a href="http://www.site1.com">Dresses</a>
<a href="http://www.site1.com">Accessories</a>
- <a href="http://www.site1.com">Shirts</a>
- <a href="http://www.site1.com">Shorts</a>
- <a href="http://www.site1.com">Pants</a>
- <a href="http://www.site1.com">Skirts</a>
- <a href="http://www.site1.com">Dresses</a>
<a href="http://www.site1.com">Jewellery</a>
{/Accordion_Menu_Apple_style}


I want to try and use this style for the virtuemart category menu. I am new to the Joomla 1.5 Framework and am not sure how to call a plugin within php. If I try adding that {Accordion_Menu_Apple_style} into the php i get a syntax error.

Has anyone come across this before, or have a similar solution?

Cheers,
Paul

_________________
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
» http://paulmason.name - Web Development Blog «
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••


Top
 Profile  
 
PostPosted: Thu May 14, 2009 7:16 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Dec 19, 2006 6:56 am
Posts: 28
Did I post this in the wrong forum category, or do I need to explain it better? Please let me know. Thanks.

_________________
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
» http://paulmason.name - Web Development Blog «
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••


Top
 Profile  
 
PostPosted: Thu May 14, 2009 7:55 am 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Fri Sep 09, 2005 2:13 pm
Posts: 7954
Location: The Netherlands
I don't know it thjis is working.
Is this just a PHP file or are you creating a component?

_________________
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards


Top
 Profile  
 
PostPosted: Mon May 18, 2009 3:52 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Dec 19, 2006 6:56 am
Posts: 28
The php file i want to edit is a component. It's the virtuemart component. Basically I want to get the same effect of using the plugin braces {} in a textbox but in a php file.

So if {plugin_test} hello world {/plugin_test} rendered out to <table id='plugin_test'> hello world </table> then how do i get those same results in a joomla php file. I'm guesing it would be something like plugin['plugin_test'].input('hello world'); I'm just not familiar with the syntax of the joomla 1.5 framework.

Any help would be great. Thanks.

_________________
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
» http://paulmason.name - Web Development Blog «
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••


Top
 Profile  
 
PostPosted: Mon May 18, 2009 11:21 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Oct 22, 2006 1:29 am
Posts: 104
Location: Montréal
Your extension need to output the same code the plugin understand
Code:
echo '{Accordion_Menu_Apple_style}';
 ....
echo '{/Accordion_Menu_Apple_style}';


...then the plugin should work.

_________________
http://www.vivahate.org :: Music & Web dev Blog


Top
 Profile  
 
PostPosted: Wed May 20, 2009 1:04 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Dec 19, 2006 6:56 am
Posts: 28
meloman wrote:
Your extension need to output the same code the plugin understand
Code:
echo '{Accordion_Menu_Apple_style}';
 ....
echo '{/Accordion_Menu_Apple_style}';


...then the plugin should work.


When I echo '{Accordion_Menu_Apple_style}'; it just prints {Accordion_Menu_Apple_style} straight to the html. Do i need to import a file to render a {plugin} in the echo statement?

Can anyone hear use the Joomla API or point me in the right direction. I've been to this page: http://api.joomla.org/li_Joomla-Framework.html and I can't see an efficient way to learn from it. I have to read through class by class and the descriptions don't explain things very well.

_________________
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
» http://paulmason.name - Web Development Blog «
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••


Top
 Profile  
 
PostPosted: Wed May 20, 2009 11:10 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Oct 22, 2006 1:29 am
Posts: 104
Location: Montréal
Hmmm... I thought the plugin would catch the {Accordion_Menu_Apple_style} and replace it with the appropriate code. Maybe the plugin don't process the code from the modules. I'm not an expert in plugin, maybe someone else can help you with that problem! :(

_________________
http://www.vivahate.org :: Music & Web dev Blog


Top
 Profile  
 
PostPosted: Thu May 21, 2009 12:09 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10890
Location: Ireland
Hi, You will need to trigger the event to call the plugin as well.

In your case, I believe this would be something like this:
Code:
global $mainframe;

$content = '{Accordion_Menu_Apple_style}';
$content .= '<a href="http://www.site1.com">Shirts</a>';
/*... */
$content .= '{/Accordion_Menu_Apple_style}';

$article = new stdClass();
$article->text = $content;
$dispatcher   =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$limitstart = 0;
$params = array();
$results  = $dispatcher->trigger('onPrepareContent', array (& $article, & $params, $limitstart));
echo $article->text;

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Thu May 21, 2009 3:29 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
ooffick wrote:
Hi, You will need to trigger the event to call the plugin as well.

In your case, I believe this would be something like this:
Code:
global $mainframe;

$content = '{Accordion_Menu_Apple_style}';
$content .= '<a href="http://www.site1.com">Shirts</a>';
/*... */
$content .= '{/Accordion_Menu_Apple_style}';

$article = new stdClass();
$article->text = $content;
$dispatcher   =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$limitstart = 0;
$params = array();
$results  = $dispatcher->trigger('onPrepareContent', array (& $article, & $params, $limitstart));
echo $article->text;



Hmm... that's one way to do it...

I'd probably do something more like:
Code:
$content = '{Accordion_Menu_Apple_style}';
$content .= '<a href="http://www.site1.com">Shirts</a>';
/*... */
$content .= '{/Accordion_Menu_Apple_style}';
$content = JHTML::_('content.prepare', $content);


Ian


Top
 Profile  
 
PostPosted: Wed May 27, 2009 3:14 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Jan 16, 2006 10:43 am
Posts: 46
Location: Australia
Hi,

hope someone can help.

I'm using:
- joomla 1.5.
- jumi 2.1
- plugin_googlemap_J15.2.12i

I'm using jumi. I assume it's similiar to calling the plugin via a php file.

I am trying to call the plugin {mosmap} from

tech.reumer.net

ie. google maps


I have got
Code:
$mosmapCall = '{mosmap address='1 pitt st, 2000, sydney, South Australia,Australia'} ;

$mosmapCall = JHTML::_('plugin_googlemap2.prepare', $mosmapCall);


Am I missing something?

All that results is that the text gets displayed.

thanks in advance.

_________________
http://www.geeksupport.com.au


Top
 Profile  
 
PostPosted: Wed May 27, 2009 3:42 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
juicyfruit wrote:
Hi,

hope someone can help.

I'm using:
- joomla 1.5.
- jumi 2.1
- plugin_googlemap_J15.2.12i

I'm using jumi. I assume it's similiar to calling the plugin via a php file.

I am trying to call the plugin {mosmap} from

tech.reumer.net

ie. google maps


I have got
Code:
$mosmapCall = '{mosmap address='1 pitt st, 2000, sydney, South Australia,Australia'} ;

$mosmapCall = JHTML::_('plugin_googlemap2.prepare', $mosmapCall);


Am I missing something?

All that results is that the text gets displayed.

thanks in advance.

Yes... there is no such class as JHTMLPlugin_googlemap2
it should be:
JHTML::_('content.prepare', $mosmapCall);

Ian


Top
 Profile  
 
PostPosted: Wed May 27, 2009 11:05 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Jan 16, 2006 10:43 am
Posts: 46
Location: Australia
Thankyou Ian for responding.

It really helped. ;-)

The code in jumi that was working is as follows:
Code:
<?php

echo "hello world!";

$mosmapCall = '{mosmap}' ;

$mosmapCall = JHTML::_('content.prepare', $mosmapCall);

echo $mosmapCall;

?>

_________________
http://www.geeksupport.com.au


Top
 Profile  
 
PostPosted: Fri May 29, 2009 3:41 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Dec 19, 2006 6:56 am
Posts: 28
Thanks Olaf & Ian,

Both solutions worked!

Just one more quick question:

If I were to find these solutions using the documentation provided by Joomla where would I look. Is there a problem solving process you can explain to this solution. The more detail the better (such as using api's, debugging etc.).

Thanks again,
Paul

_________________
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
» http://paulmason.name - Web Development Blog «
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 



Who is online

Users browsing this forum: No registered users and 5 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® Forum Software © phpBB Group