Keyword

Advanced Search

Search Results (Searched for: k2 Tag)

  • JoomlaWorks
  • JoomlaWorks's Avatar
26 Sep 2018 10:22
Replied by JoomlaWorks on topic How do I edit or add tags after posting articles?

How do I edit or add tags after posting articles?

Category: English K2 Community

Use "K2 Tags" for editing existing tags (in the backend) and the item form to add new ones (or delete existing ones).
  • JoomlaWorks
  • JoomlaWorks's Avatar
26 Sep 2018 10:11

After updating to version 2.9 "tag rating" doesnt display the log

Category: English K2 Community

Disable JCH Optimize and test again (make sure you clear your J cache after that). If that's the issue, either add k2.css as an exception or skip CSS compression overall. There are no JS issues on your site.
  • Adem B
  • Adem B's Avatar
25 Sep 2018 17:54
Replied by Adem B on topic Lightbox + responsive images for K2

Lightbox + responsive images for K2

Category: English K2 Community

I fixed problem.
I added data-k2-modal="image" to a tag for modal links in template\html\com_k2\default\item.php problem solved.
Thanks.

But like i said in demo page of k2 modal does not work.
  • Franz Heine
  • Franz Heine's Avatar
22 Sep 2018 09:03

After updating to version 2.9 "tag rating" doesnt display the log

Category: English K2 Community

Hi,

ive updated from 2.8 to 2.9

Ive "extended" my tag.php with the rating like this:
<?php if($item->params->get('catItemRating')): ?> <!-- Item Rating --> <div class="catItemRatingBlock"> <div class="itemRatingForm"> <ul class="itemRatingList"> <li class="itemCurrentRating" id="itemCurrentRating<?php echo $item->id; ?>" style="width:<?php echo $item->votingPercentage; ?>%;"></li> <li><a href="#" data-id="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li> <li><a href="#" data-id="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li> <li><a href="#" data-id="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li> <li><a href="#" data-id="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li> <li><a href="#" data-id="<?php echo $item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li> </ul> <div id="itemRatingLog<?php echo $item->id; ?>" class="itemRatingLog"><?php echo $item->numOfvotes; ?></div> <div class="clr"></div> </div> <div class="clr"></div> </div> <?php endif; ?>

in version 2.8. it works. Do ive to change the code?

Thx
  • JoomlaWorks
  • JoomlaWorks's Avatar
18 Sep 2018 13:04
Replied by JoomlaWorks on topic List k2 Items owned by logged in user

List k2 Items owned by logged in user

Category: English K2 Community

The "My Items" menu can just be a link to the login page. Once you login, you see the menu bar and click the option you want. If the user is not logged in there is no point to your version as well (how would the code match the user ID to the K2 user ID if they are not logged in first?)...

As for your other comments:
- limit item per user : bit.ly/2D85k12 - Why?
- better edit Front-end form : bit.ly/2xjPCKQ (even CSS classed are the same!) - the item edit form has changed substantially since v2.7.0.
- limit tag number in Front-end form (it's unlimited! ) - use locked tags, this feature exists since v2.0 of K2.
- support 3rd party captcha plugin in comment form (we have to use recaptcha only?) - you can write your own plugin if you want or better still, use another commenting system that supports K2 and has more security options.

We can add all the world's features for sure, but that's not always the best case. K2 has been carefully designed to be extensive for this specific reason.
  • Kran Chi
  • Kran Chi's Avatar
18 Sep 2018 11:09
Replied by Kran Chi on topic List k2 Items owned by logged in user

List k2 Items owned by logged in user

Category: English K2 Community

I want to users see [My Items] menu before login and it's can not be done by module. maybe we can show them a custom module or alias menu but these ways are not user friendly and just wasting the time.

So in my opinion, it's better that k2 add this item to menu too . like many other features that didn't care about :

- limit item per user : bit.ly/2D85k12
- better edit Front-end form : bit.ly/2xjPCKQ (even CSS classed are the same!)
- limit tag number in Front-end form (it's unlimited! )
- support 3rd party captcha plugin in comment form (we have to use recaptcha only?)
- ...
  • JoomlaWorks
  • JoomlaWorks's Avatar
15 Sep 2018 11:44
Replied by JoomlaWorks on topic Empty itemRelIntrotext

Empty itemRelIntrotext

Category: English K2 Community

Related items are retrieved based on tags. Are you using tags for your content in K2?
  • lam xuyen
  • lam xuyen's Avatar
14 Sep 2018 13:10
Tag subtemplte does not override was created by lam xuyen

Tag subtemplte does not override

Category: English K2 Community

Hi there!
I have an issue with overriding tag.php template. I got 2 sub templates for 2 different categories in /mytemplate/html/com_k2/.
Then I use k2 tools tag cloud functionality as a submenu, and all tag links generate tag listings in the default template.
I am sure I have done everything right. Reinstalled K2 several times. J3.8.1 K2 2.8.0.
Please give some hints what might be the cause of this!
greetings

The two instances of K2 tools tag cloud modules are published here: 2017.sklada.bg/bg/novini/ and here: 2017.sklada.bg/bg/izbrani-brandove/
As it might be seen the tag template in the second link is OK since it follows the menu link template (category), but in the first link as soon as any of the two submenu links (tags) "изложба | изложения" is clicked the tag listing has a template that has nothing to do with the previous view
  • JoomlaWorks
  • JoomlaWorks's Avatar
13 Sep 2018 13:12
Replied by JoomlaWorks on topic Display Custom Field conditionally on menu id

Display Custom Field conditionally on menu id

Category: English K2 Community

1) It may be better to just trigger the code to render a module position within your K2 views. Use something like:
// Include a module position anywhere <?php if(JModuleHelper::getModules('SOME_MODULE_POSITION_HERE')): ?> <?php foreach (JModuleHelper::getModules('SOME_MODULE_POSITION_HERE') as $module): ?> <div class="someClass"> <?php echo JModuleHelper::renderModule($module, array('style' => '')); ?> </div> <?php endforeach; ?> <?php endif; ?>

If the above does not work in Joomla 3.x, you may need to add this before:
<?php jimport( 'joomla.application.module.helper' );

2. You can't control that because depending on the plugin type, K2 already renders various plugin groups on different places. If the plugins are developed by you, add rendering conditions. If they are not and happen to be "system" type plugins, then you can just add the {plugin}whatever{/plugin} tags in your HTML and they will be rendered properly. Alternatively, you can create extra fields and add the plugin tags in a text-type field. K2 will trigger any content plugins that match the tag (perhaps this is a better option).

3. Use "$item->extraFields->EXTRAFIELD_ALIAS_HERE->value", e.g.
<?php if ($item->extraFields->color->value == "red") { // do this if the color is "red" }
  • maz
  • maz's Avatar
13 Sep 2018 12:35 - 13 Sep 2018 12:50

Display Custom Field conditionally on menu id

Category: English K2 Community

Thank you so much for such a clear explanation. That solved a massive issue for me. I originally had many thousands of page 'combinations' which you have helped me to instantly reduce to a few hundred. However, to get these to a handful, there are still some related issues I need help with.

1. Joomla uses {loadmodule positionX} to load a module directly (at positionX in this example) onto a joomla page. In need to do the same but onto K2 pages as per your guide above controlled by the itemid. For example:

if ($itemid == 1){
// show {loadmodule positionX}
}
I just need the exact code to replace the "// show {loadmodule positionX}" part, so that I can vary this to load different modules.

UPDATE
.... I am now thinking... is it just a simple matter of interlacing php with html? In other words, putting php tags around the php code and then adding html and then closing it with php again?? for example

<opening php tag> if ($itemid == 1){ <closingPHPtag>
<HTMLCODE> // show {loadmodule positionX} <CLOSING HTML CODE>
<opening php tag>}<closingPHPtag>

2. Similarly, I also want to run some third party plug-ins. These are basically graphs and pie chart plugins. Again as an example

if ($itemid == 1){
// run {plugin y}
}
I just need the exact code to replace the "// run {plugin y}" part, so that I can vary this for different joomla plugins.

3. And a very quick example of the use of ELSE based on field values. For example, field is colours.
so, IF field colour == red
show field 3 (or show a piece of text or load 'module positionX' for example)

Thank you
  • JoomlaWorks
  • JoomlaWorks's Avatar
11 Sep 2018 16:20

How to set size for Popup lightbox in Link Extra fields?

Category: English K2 Community

You can use the trick of pulling the modal extra field separately. How would you directly output individual extra fields in your K2 overrides? Simple. Just do something like this (e.g. in item.php) to get the extra field name:

$this->item->extraFields->EXTRAFIELD_ALIAS_HERE->name

To get the extra field value you would simply do this:

$this->item->extraFields->EXTRAFIELD_ALIAS_HERE->value
OR
$this->item->extraFields->EXTRAFIELD_ALIAS_HERE->rawValue (for date type only)

Simply replace EXTRAFIELD_ALIAS_HERE with the actual alias of the extra field you wish to output.

If you get the value, it means you get the image path which you can then insert in a new <a> tag and apply your own modal popup.
  • JoomlaWorks
  • JoomlaWorks's Avatar
08 Sep 2018 17:08
Replied by JoomlaWorks on topic og-metatag not rendered correctly

og-metatag not rendered correctly

Category: English K2 Community

K2 properly adds opengraph tags for Facebook and Twitter. You don't need to do that. If you did not see the meta tags in your source, perhaps some other (system) plugin is stripping them up.

See the source code here for example: demo.getk2.org/item
  • Steven Trooster
  • Steven Trooster's Avatar
07 Sep 2018 16:34
og-metatag not rendered correctly was created by Steven Trooster

og-metatag not rendered correctly

Category: English K2 Community

I've added meta tags to a template override to have OG-metatags for Facebook and Twitter in the rendered page of an (K2) article. For safety reasons it is advised to escape the title tag. So my code is:
$document->addCustomTag('<meta property="og:title" content="'.$this->escape($this->item->title).'">');

This will create a tag that looks like this, where the title of the page is Ugenda's festivaloverzicht :
<meta property="og:title" content="Ugenda&amp;#039;s festivaloverzicht">

See an example here: www.ugenda.nl/agenda/festivals

Note that the title has the wrong encoding for the apostrophe. It should be &#039; or &apos;.
So Facebook doesn't recognize the titel correctly and it shows the encoding instead of the apostrophe. (See: www.facebook.com/Ugenda/posts/10156534292767719 )

Am I escaping the item->title falsely? Or is there no need to escape it? (And what about security?)

Note that in pages in the eventlist part of our site, the og-tag is rendered correctly. See for example: www.ugenda.nl/agenda/event/102529-battlefield-fietstour-de-bevrijding-van-nijmegen where the tag is:
<meta property="og:title" content="Battlefield Fietstour 'De bevrijding van Nijmegen'">
and the code:
$document->addCustomTag('<meta property="og:title" content="'.$this->escape($this->item->title).'">');
  • JoomlaWorks
  • JoomlaWorks's Avatar
07 Sep 2018 12:35
Replied by JoomlaWorks on topic RSS feed struggle

RSS feed struggle

Category: English K2 Community

The easiest way for you to create a custom RSS feed from any categories (and unlike Joomla's com_content which is still rocket science in 2018) is this:

- Create a menu in Joomla that you don't retrieve anywhere in the frontend (let's call it "Hidden").
- In that menu, create a new menu item pointing to K2 Categories (jmp.sh/ZNor0F3). In there select the categories you want. For new K2 menu items, the RSS options are enabled by default.
- Before saving, make sure you add a descriptive yet short menu item alias, e.g. "allnews". Save the menu item.
- If this is a top level menu item, simply go to the site's frontend and call: /allnews?format=feed
- Done.

K2 uses the convention in RSS URLs that nearly all components that support RSS output use and that's the "?format=feed" when you are in itemlists, be it a category, tag or user page.

However, unlike other components, K2 can also output JSON which means it's dead simple to create a mobile or JS web app purely out of JSON data. Just append "?format=json" at the end of *ANY* K2 URL, even an item.
  • JoomlaWorks
  • JoomlaWorks's Avatar
31 Aug 2018 21:19
Replied by JoomlaWorks on topic Cannot add Tags

Cannot add Tags

Category: English K2 Community

You're welcome :)

So it was some old leftover override. Sometimes template devs just copy the entire templates folder in K2 even if they don't use some file...
  • JoomlaWorks
  • JoomlaWorks's Avatar
30 Aug 2018 00:46
Replied by JoomlaWorks on topic What K2 Friendly Map extension are you using?

What K2 Friendly Map extension are you using?

Category: English K2 Community

As an update, seeing at the specs of this extension, I believe we could do better with separate DB tables for better performance and filtering flexibility.

As for extensions from third parties dying off, most of the times it boils down to loss of interest from the developers. And to be honest, Joomla is not making things easier for 3rd party developers. We built K2 with integrators and other devs in mind when we designed it, exactly so we don't change the damn thing every 4-5 years. Now Joomla 4 is repeating history. And this is the reason we're now re-writing K2 to be both more performant and only 1% integrated to Joomla's API/framework (to maintain our sanity for future releases of Joomla).

But still, despite Joomla's drawbacks, the advantages outweigh its disadvantages. And e.g. supporting WP down the road will only be a business decision, not a true preference.
  • JoomlaWorks
  • JoomlaWorks's Avatar
30 Aug 2018 00:36
Replied by JoomlaWorks on topic Links error

Links error

Category: English K2 Community

I would not use such a solution if I were you. This robots.txt file will block valid URLs from crawling.

Instead, at least for K2, create a new menu in Joomla which you WILL NOT publish anywhere. In there, create a new menu item pointing to all K2 categories. Name the "alias" of that menu item as "content". This will stop K2 content that is not linked to a menu item to use /component/k2/...

Check the K2 blog and its tags as an example: getk2.org/blog
  • JoomlaWorks
  • JoomlaWorks's Avatar
29 Aug 2018 23:52
Replied by JoomlaWorks on topic Item thumbnails on Category Listing

Item thumbnails on Category Listing

Category: English K2 Community

Unlike Joomla's mind-f*ck approach in category setups, where the menu item exclusively controls the output of a category, in K2, when you link to a single category, the layout options come directly from the category settings.

If you have uploaded images with your K2 items (in the K2 image tab), by default you'll see these images in any category listing (or tag/user/date etc. listing). So unless you've disabled the option to show the K2 item image, it should be there.

However, if you're migrating from Joomla content articles and you have images embedded within your content (within introtext/fulltext), you need this little cool plugin to extract the first such image and "make" it a K2 image (aka serve it in a separate variable in the K2 item object): github.com/getk2/k2-iaki

If you like K2, don't forget to rate it at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/
  • JoomlaWorks
  • JoomlaWorks's Avatar
29 Aug 2018 23:47
Replied by JoomlaWorks on topic Cannot add Tags

Cannot add Tags

Category: English K2 Community

First look carefully for differences in "system" plugins. These types of plugins can load CSS/JS on any URL in Joomla. If you have template overrides for K2 in your template, locate and delete the file itemform.php (but only inside your template's /html/com_k2/ folder - and if it exists of course).
  • trogladyte
  • trogladyte's Avatar
29 Aug 2018 01:16
Replied by trogladyte on topic Cannot add Tags

Cannot add Tags

Category: English K2 Community

Thanks Fotis. Unfortunately, that didn't work. I have another site for this client - www.tastecaliforniatravel.com - which uses the same template creator and has (or had) the same version of K2 installed, but it works flawlessly. So it's something about this particular site.
Displaying 621 - 640 out of 6582 results.

Powered by Kunena Forum