Template Club Package Silver Pacakage Gold Pacakage Developer Pacakage Accepted Payments Member Login
TemplatePlazza Support Forum
Welcome, Guest
Please Login or Register.    Lost Password?
How can I use Xtypo in a Virtue browse page (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: How can I use Xtypo in a Virtue browse page
#11453
piper9537 (User)
FreshPlazzoic
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
How can I use Xtypo in a Virtue browse page 8 Months, 1 Week ago Karma: 0  
Hi,
is it possible to use Xtypo inside a category browse or Product Page. I am using VirtueMart

regards
Dave
Enter code here   
Please note, although no boardcode and smiley buttons are shown, they are still useable
 
Report to moderator   Logged Logged  
  Reply Quote
#11455
ronysyz (Moderator)
Moderator
Posts: 2923
graph
User Offline Click here to see the profile of this user
Gender: Male
Re:How can I use Xtypo in a Virtue browse page 8 Months, 1 Week ago Karma: 55  
hi David,
i've tried to use Xtypo in VM, and Xtypo doesn't to get working.
so for this time, i think that VM can't use this mambot.
but you could be trying about it, don't forget to share with us, please.

Best Regards
Rony
Enter code here   
Please note, although no boardcode and smiley buttons are shown, they are still useable
 
Report to moderator   Logged Logged  
  Reply Quote
#11575
ricardosousa (Moderator)
Moderator
Posts: 2218
graphgraph
User Offline Click here to see the profile of this user
Gender: Male ricardojrsousa@hotmail.com Location: Portugal Birthdate: 1992-05-21
Re:How can I use Xtypo in a Virtue browse page 8 Months, 1 Week ago Karma: 10  
Hi,

Maybe this is useful: http://forum.virtuemart.net/index.php?topic=19348.0

Best Regards and Merry Christmas,
Enter code here   
Please note, although no boardcode and smiley buttons are shown, they are still useable
 
Report to moderator   Logged Logged  
 
Best Regards,
Ricardo Sousa
TemplatePlazza Support Team
Please follow the rules

Help me Help you!

A Ninja Blog
  Reply Quote
#11678
piper9537 (User)
FreshPlazzoic
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:How can I use Xtypo in a Virtue browse page 8 Months, 1 Week ago Karma: 0  
Calling Joomla! Plugins

There are three main steps required to call a Joomla! plugin:

1. Get access to the global $_MAMBOTS object.
2. Load a plugin group (in our case, content plugins).
3. Trigger an event.

Thus, the code for running some text, say $text_to_process, through the Joomla! content plugins would look like this:

Plugin code

1. global $_MAMBOTS;
2. $_MAMBOTS->loadBotGroup( 'content' );
3. $tmp_row = new stdClass();
4. $tmp_params = new mosParameters('';
5. $tmp_row->text = $text_to_process;
6. $_MAMBOTS->trigger( 'onPrepareContent', array( &$tmp_row, &$tmp_params ), true );
7. $text_to_process = $tmp_row->text;


So, to make plugins work in VirtueMart pages, we just need to add this code to the VirtueMart files where we'd like the plugins to be called.
Be sure to back up the files before making any changes. All the files that you'll need to edit are located in the /administrator/components/com_virtuemart/html directory.

Product Details Pages

To show plugins on your product details pages, you'll need to edit shop.product_details.php. Look for the following line, near the bottom of the file (line 394):

shop.product_details.php

1. $template = preg_replace("/{vm_lang[^}]*)}/ie", "\$VM_LANG->\\1", $template);



Right after that line, add the plugin calling code:

shop.product_details.php

1. global $_MAMBOTS;
2. $_MAMBOTS->loadBotGroup( 'content' );
3. $tmp_row = new stdClass();
4. $tmp_params = new mosParameters('';
5. $tmp_row->text = $template;
6. $_MAMBOTS->trigger( 'onPrepareContent', array( &$tmp_row, &$tmp_params ), true );
7. $template = $tmp_row->text;

Notice that the text we are running the plugins on is contained in the $template variable.

Now just call the plugin from your product description (the long description) in VirtueMart.

Shop Browse Pages

You might also want to run a plugin on the shop browse pages - for example, on a category description or a product's short description. To do this, you'll need to modify shop.browse.php.

Near the top of the file, look for this line (19):

shop.browse.php

1. mm_showMyFileName( __FILE__ );



Right after this add just the code that loads the plugins:

shop.browse.php

1. global $_MAMBOTS;
2. $_MAMBOTS->loadBotGroup( 'content' );
3. $plug_row = new stdClass();
4. $plug_params = new mosParameters('';

Notice that we're loading the plugin group at the beginning of the file, but not actually triggering the plugins yet. We'll trigger the plugins later on the category descriptions and short product descriptions separately.

Now, to run plugins on category descriptions, look for these two lines (83-84):

shop.browse.php

1. echo '<div style="width:100%;float:left;">';
2. echo $desc;

Right between those two lines, add this code to trigger the plugins:

shop.browse.php

1. $plug_row->text = $desc;
2. $_MAMBOTS->trigger( 'onPrepareContent', array( &$plug_row, &$plug_params ), true );
3. $desc = $plug_row->text;

The variable $desc contains the category description.
Let's also make plugins work for the short product descriptions that appear on the shop browse pages. In the same file, shop.browse.php, look for this line (476):

shop.browse.php

1. echo $product_cell;

Right before it, add the following plugin code:

shop.browse.php

1. $plug_row->text = $product_cell;
2. $_MAMBOTS->trigger( 'onPrepareContent', array( &$plug_row, &$plug_params ), true );
3. $product_cell = $plug_row->text;

The variable $product_cell contains the short product description.

Now just add the appropriate plugin call to a category description or short product description in VirtueMart, and you'll have Joomla! plugins displayed in VirtueMart's shop browse pages.
Enter code here   
Please note, although no boardcode and smiley buttons are shown, they are still useable
 
Report to moderator   Logged Logged  
  Reply Quote
#11680
ricardosousa (Moderator)
Moderator
Posts: 2218
graphgraph
User Offline Click here to see the profile of this user
Gender: Male ricardojrsousa@hotmail.com Location: Portugal Birthdate: 1992-05-21
Re:How can I use Xtypo in a Virtue browse page 8 Months, 1 Week ago Karma: 10  
Howh... Great Explanation

Thanks for share! You get this info in my link?

Regards,
Enter code here   
Please note, although no boardcode and smiley buttons are shown, they are still useable
 
Report to moderator   Logged Logged  
 
Best Regards,
Ricardo Sousa
TemplatePlazza Support Team
Please follow the rules

Help me Help you!

A Ninja Blog
  Reply Quote
#11683
piper9537 (User)
FreshPlazzoic
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:How can I use Xtypo in a Virtue browse page 8 Months, 1 Week ago Karma: 0  
Hi,
No I posted first and then saw your Link

Regards
Enter code here   
Please note, although no boardcode and smiley buttons are shown, they are still useable
 
Report to moderator   Logged Logged  
  Reply Quote
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
ico spot