Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

Using the plugin tag in php source (K2 item template)

  • Balazs Daniel
  • Balazs Daniel's Avatar Topic Author
  • Offline
  • New Member
More
12 years 6 months ago #49380 by Balazs Daniel
Hi

I'd like to use the plugin in K2 item template php file but it's not working. I place the {gallery}folder{/gallery} tags and it shows the tags instead the gallery in the frontend.

If I'm right the problem is occuring because of the following row in the gallery php file:
// Find all instances of the plugin and put them in $matches
preg_match_all($regex, $row->text, $matches);

The code is searching the tags only in saved text in database.

I'm new to PHP and don"t know how to check the whole page and source code for the tag string.

Any solution to solve this?

Thanks for your help.

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago #49381 by Katia
Using K2 you don't need to write tags...
You just upload the gallery zip via the gallery tab in the K2 item.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Balazs Daniel
  • Balazs Daniel's Avatar Topic Author
  • Offline
  • New Member
More
12 years 6 months ago #49382 by Balazs Daniel
Hi

First of all thank you for your reply.

I know that method but it's too slow for me to make zip files and then open every item to attach. We are building a site with smartphone catalog and there are 500+ items.

I want to create the gallery from the k2 item template with placing the code below in the item.php file:
{gallery}<?php echo $this->item->id; ?>{/gallery}

The item ID will be the folder name (same as in the zip file method). This way is more time-saving for the editors. They have to only copy the folders via FTP.

Any idea? Thanks in advance.

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago #49383 by Lefteris
@danielbidala

By writing only the tag you are not creating galleries. There have to be images uploaded to the corresponding directory. If you however have the images uploaded you can write the tag in the introtext or fulltext of the item. To alter the K2 gallery functionallity you can write a K2 plugin which will auto-insert in every item the desired gallery.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum