Keyword

Advanced Search

Search Results (Searched for: k2 Tag)

  • Lefteris
  • Lefteris's Avatar
18 Feb 2016 17:57
Replied by Lefteris on topic k2 tools - tags by name and not popularity?

k2 tools - tags by name and not popularity?

Category: English K2 Community

@Kogos Grain

The only issue i see in your solution is performance related. If you have a really big number of tags this might slow down your page a bit. So just make sure that module caching is enabled.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
18 Feb 2016 12:51
Replied by Krikor Boghossian on topic k2 tools - tags by name and not popularity?

k2 tools - tags by name and not popularity?

Category: English K2 Community

Kudos :)
This is a robust solution.
  • Kogos Grain
  • Kogos Grain's Avatar
18 Feb 2016 11:14 - 18 Feb 2016 11:14
Replied by Kogos Grain on topic k2 tools - tags by name and not popularity?

k2 tools - tags by name and not popularity?

Category: English K2 Community

yeah, i thought so... i tried to dig a little dipper and i found a work around that seems to be working, without hacking any core files, just with a tag.php override...
so i'm posting the work around solution here, just in case somebody else needs it:

I added a huge Tag limit (X most popular) in modules settings (f.e. 30000). That means that practically the module will NOT filter any tags, unless we have more than 30000 tags (extremely rare). Now, in tags.php, i replaced:
<?php foreach ($tags as $tag): ?>

with:
<?php foreach (array_slice($tags, 0, 9, false) as $tag): ?>

Of course, 9 is the number of tags to show, so it'll need to be changed to the number of tags to show.

Also, if somebody needs to show them in reverse alphabetically order (like me), this line needs to change to this:
<?php foreach (array_slice(array_reverse($tags), 0, 9, false) as $tag): ?>

Actually, what this does is take the full array of tags, without filtering it by popularity, and force slice it.

This seems to work, but any comments are welcome :)
  • Lefteris
  • Lefteris's Avatar
17 Feb 2016 18:27
Replied by Lefteris on topic k2 tools - tags by name and not popularity?

k2 tools - tags by name and not popularity?

Category: English K2 Community

@Kogos Grain

This cannot be changed. The module is fetching the tags sorted by tagged items number. You need a different module for that.
  • Kogos Grain
  • Kogos Grain's Avatar
16 Feb 2016 10:44 - 16 Feb 2016 10:49
Replied by Kogos Grain on topic k2 tools - tags by name and not popularity?

k2 tools - tags by name and not popularity?

Category: English K2 Community

i'm afraid it's not working... I added
<?php sort($tags);?>
before foreach statement, but again, it's not changing anything

Let me explain a bit more what i want to do here... Let's say i got tags named tag1, tag2, tag3, tag4, tag5. Tag1 and tag5 are more popular than the other tags. I set k2tools module to display only 2 modules, and it shows tag1 and tag5, but i want it to show tag1 and tag2 (first 2 tags that it'll find in the array).

Actually, what i need is a simple list of all tags, sorted alphabetically (or reverse alphabetically) that i can choose how many of them will show in frontnend

Can it be done?
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
15 Feb 2016 19:58
Replied by Krikor Boghossian on topic k2 tools - tags by name and not popularity?

k2 tools - tags by name and not popularity?

Category: English K2 Community

You can use PHP's sort function - php.net/sort - in your overrides.
  • Kogos Grain
  • Kogos Grain's Avatar
15 Feb 2016 16:28
k2 tools - tags by name and not popularity? was created by Kogos Grain

k2 tools - tags by name and not popularity?

Category: English K2 Community

Hi,

i'm using k2 tools module (tag cloud) to show 10 tags, but i'd like to show them alphabetically and not by popularity. However, if in k2 tools BE, there is an option to set the numbers of tags to show by popularity only. I tried to figure out what to change in helper.php file, or maybe make a tags.php overide, with no luck.

I know that showing tags by name is not a tag cloud anymore, but it's more of a "tag list" module, but can it be done with k2 tools or any other module? ( I must say, i looked in JED for a tag list module, but couldn't find one).

Thanks in advance
  • claudio
  • claudio's Avatar
10 Feb 2016 15:17
Replied by claudio on topic k2 tools tag

k2 tools tag

Category: English K2 Community

works!!
<?php foreach($this->items as $item): ?> <?php if (in_array($item->category->id, $cat_tag)) { ?> <!-- Item Layout --> <?php } ?> <?php endforeach; ?>


thank you
  • claudio
  • claudio's Avatar
09 Feb 2016 17:01
Replied by claudio on topic k2 tools tag

k2 tools tag

Category: English K2 Community

in top of this file
/components/com_k2/views/itemlist/tmpl/tag.php
I wrote
<?php $taggs = $_GET["category"]; $cat_tag = explode(",", $taggs); ?>
now I have an array with categories id. right?

the next step ... it' more difficult (for me)
I have to work befor this foreach?
<?php foreach($this->items as $item): ?>
  • fabio
  • fabio's Avatar
09 Feb 2016 13:14
Stampare categoria + articolo k2 was created by fabio

Stampare categoria + articolo k2

Category: Comunità italiana K2

Buongiorno forum,
sono un nuovo arrivato ed ho una buona conoscenza del CMS Joomla.
Su un sito custom Joomla 3 + K2 avrei la necessita di stampare nel dettaglio dell'articolo la categoria -> Nome articolo senza dover ricorrere al breadcrumb.

Qual'è il codice PHP di k2 per stampare categoria ed articolo nel dettaglio articolo?

Grazie
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
08 Feb 2016 16:38
Replied by Krikor Boghossian on topic Related Items by Tag - Exclude Category

Related Items by Tag - Exclude Category

Category: English K2 Community

If you don't want to (and you should not) hack K2's core you need a K2 plugin.

Alternatively there are several 3rd party extensions in the JED that offer this functionality.
  • Kogos Grain
  • Kogos Grain's Avatar
08 Feb 2016 15:19 - 08 Feb 2016 15:19
Replied by Kogos Grain on topic Related Items by Tag - Exclude Category

Related Items by Tag - Exclude Category

Category: English K2 Community

i know that's an old post, but i came up with a similar problem... i wanted to exclude a category from "related items (by tag)" in item view...

What i did is create an override and add a "continue" statement immediately after "foreach" in item.php.

For example, in item.php, around line 384,
find
<?php if($this->item->params->get('itemRelated') && isset($this->relatedItems)): ?> <!-- Related items by tag --> <div class="itemRelated"> <h3><?php echo JText::_("K2_RELATED_ITEMS_BY_TAG"); ?></h3> <ul> <?php foreach($this->relatedItems as $key=>$item): ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?>">

and add "continue" based on category name, making it look like this:
<?php if($this->item->params->get('itemRelated') && isset($this->relatedItems)): ?> <!-- Related items by tag --> <div class="itemRelated"> <h3><?php echo JText::_("K2_RELATED_ITEMS_BY_TAG"); ?></h3> <ul> <?php foreach($this->relatedItems as $key=>$item): ?> [b]<?php if (($item->category->name) == 'NAMEOFCATEGORY') : continue; endif?>[/b] <li class="<?php echo ($key%2) ? "odd" : "even"; ?>">

Of course replace NAMEOFCATEGORY with your category name you want to exclude.

Now, the only problem i have is that if an item is excluded because it belongs to the "blacklisted" category, it's not replaced by another item. If i choose to show 6 related items, and one of them is excluded, i see 5... if 2 items are excluded, i see 4, etc...

Is there any way to make it always show the correct number of items, even if some are excluded, without hacking k2 core files???

Thanks in advance
  • Gonzalo Donoso
  • Gonzalo Donoso's Avatar
08 Feb 2016 14:09
Replied by Gonzalo Donoso on topic Problem loading the tags in items

Problem loading the tags in items

Category: English K2 Community

hi,

This.

K2_v2.6.9 and joomla 2.5
  • Giora Shimoni
  • Giora Shimoni's Avatar
07 Feb 2016 01:23
Accessibility Issue K2 tools was created by Giora Shimoni

Accessibility Issue K2 tools

Category: English K2 Community

Hi There
I would like to add Accessibility to K2 tools module (search) . where can I add label tag with form instruction for WCAG2 requirements?

Thanks

Best Regards,
-- Giora
  • Gonzalo Donoso
  • Gonzalo Donoso's Avatar
05 Feb 2016 17:33 - 05 Feb 2016 17:34
Replied by Gonzalo Donoso on topic Problem loading the tags in items

Problem loading the tags in items

Category: English K2 Community

hi,

This.

K2_v2.6.9 and joomla 2.5
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
05 Feb 2016 16:51
Replied by Krikor Boghossian on topic Problem loading the tags in items

Problem loading the tags in items

Category: English K2 Community

Hello,
Which version of Joomla! and K2 are you using?
  • Gonzalo Donoso
  • Gonzalo Donoso's Avatar
05 Feb 2016 16:40 - 05 Feb 2016 16:41
Problem loading the tags in items was created by Gonzalo Donoso

Problem loading the tags in items

Category: English K2 Community

I need urgent assistance from the master here .

Passes to enter an item to add tags and does not load , do not know that this problem should be but it 's driving me ape.


Greetings and hopefully not such a complicated problem.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
05 Feb 2016 16:39
Replied by Krikor Boghossian on topic k2 tools tag

k2 tools tag

Category: English K2 Community

This function will allow you to read data from the URL
php.net/manual/en/reserved.variables.get.php

You need to use these two functions in order to get the array of ids.

php.net/manual/en/function.explode.php
php.net/manual/en/function.in-array.php

In order to check if that item's category id ($item->category->id) belongs in the following value
  • claudio
  • claudio's Avatar
05 Feb 2016 15:16
Replied by claudio on topic k2 tools tag

k2 tools tag

Category: English K2 Community

this is the foreach in
/components/com_k2/views/itemlist/tmpl/tag.php
<?php foreach($this->items as $item): ?>

I think I have to do something before this code ...

I wait your help.

thank you
  • Wire Creative
  • Wire Creative's Avatar
05 Feb 2016 00:45
K2 Ignores Pagination Override? was created by Wire Creative

K2 Ignores Pagination Override?

Category: English K2 Community

Hi, I'm using a YooTheme template with K2. The pagination in category and tag views have no style, but display as a vertical list. Eventually I figured out that K2 is ignoring the pagination.php file in the HTML overrides folder of my template and is using the pagination.php file in the Joomla libraries directory instead.

Is there a way to get K2 to use the override file? Is there a reason why K2 doesn't use the override?

Thanks,
Greg
Displaying 1421 - 1440 out of 6582 results.

Powered by Kunena Forum