Keyword

Advanced Search

Search Results (Searched for: k2 Tag)

  • Johan
  • Johan's Avatar
28 Aug 2015 10:10

Code to show a list of articles with specific tag

Category: English K2 Community

Dear all,

I use K2 to write articles for my website and now I'm looking for some (php) code that can show a list of articles with a specific tag on a own designed template. Can anyone help me?

Thanks in advance!

Greetz,
Johan
  • Quintin
  • Quintin's Avatar
28 Aug 2015 06:20
K2 Search Text Box was created by Quintin

K2 Search Text Box

Category: English K2 Community

Hi

I have a question regarding the K2 search text box, is it possible to set this up so that it not only searches in the item title & body text but and also meta data (category, author, tags, date etc.) & comments - basically everything related to the k2 item?

Thanx
  • Kumar Sara
  • Kumar Sara's Avatar
27 Aug 2015 04:39
Replied by Kumar Sara on topic My Feature Requests (Wish List) for K2 v3

My Feature Requests (Wish List) for K2 v3

Category: English K2 Community

I did not see that wish in the list.

You could just create a category and add items with just the intro image then display the images with the K2 content module. You may have search engine errors though since the pages may be cached and returned in search results. It could become quite chaotic, cumbersome and negate search scores so this may not be a good option.

I think banner management has to remain as a separate extension. What is needed is a function to tie into K2's tags
  • aow666
  • aow666's Avatar
26 Aug 2015 21:27
Soundcloud problem was created by aow666

Soundcloud problem

Category: AllVideos

Hello,

i have a problem on my website. I have J2.5. I put soundcloud tag in K2 article, and it wokred. But after my website was loaded long time i changed "Compress player JS scripts using PHP" on "Yes", and soundcloud stops working.

How to fix it?

Regards
AoW
  • Joe Campbell
  • Joe Campbell's Avatar
25 Aug 2015 23:42
Replied by Joe Campbell on topic My Feature Requests (Wish List) for K2 v3

My Feature Requests (Wish List) for K2 v3

Category: English K2 Community

Thanks for providing such a detailed post.

As for banners, I am actually using K2 for that as well.

The core banner component has a limitation of only being able to be assigned to one category.

My banner categories mirror the content categories. Using K2 for banners, I am able to assign each banner to one or multiple categories by way of tags (Banner-Music, Banner-Shop, etc.)

I then randomly display one banner per module with the use of NoNumber Articles Anywhere.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
21 Aug 2015 15:41
Replied by Krikor Boghossian on topic Social Media share below comments

Social Media share below comments

Category: English K2 Community

You need to override the item.php file, or edit your template's existing overrides.
This post will help you locate the file:
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

Open the file and locate the social sharing section by reading the comments.
<?php if($this->item->params->get('itemTwitterButton',1) || $this->item->params->get('itemFacebookButton',1) || $this->item->params->get('itemGooglePlusOneButton',1)): ?> <!-- Social sharing --> <div class="itemSocialSharing"> <?php if($this->item->params->get('itemTwitterButton',1)): ?> <!-- Twitter Button --> <div class="itemTwitterButton"> <a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal"<?php if($this->item->params->get('twitterUsername')): ?> data-via="<?php echo $this->item->params->get('twitterUsername'); ?>"<?php endif; ?>> <?php echo JText::_('K2_TWEET'); ?> </a> <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> </div> <?php endif; ?> <?php if($this->item->params->get('itemFacebookButton',1)): ?> <!-- Facebook Button --> <div class="itemFacebookButton"> <div id="fb-root"></div> <script type="text/javascript"> (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="fb-like" data-send="false" data-width="200" data-show-faces="true"></div> </div> <?php endif; ?> <?php if($this->item->params->get('itemGooglePlusOneButton',1)): ?> <!-- Google +1 Button --> <div class="itemGooglePlusOneButton"> <g:plusone annotation="inline" width="120"></g:plusone> <script type="text/javascript"> (function() { window.___gcfg = {lang: 'en'}; // Define button default language here var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> </div> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?>

Now you can move it above the comments (<!-- Item comments -->).
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
19 Aug 2015 16:56
Replied by Krikor Boghossian on topic change font colour on multiple /articles

change font colour on multiple /articles

Category: English K2 Community

You can enforce a colour with !important to override these inline styles, but a better solution would be to use K2's content cleaning settings.
These settings are located in K2's parameters where you can define which tags you want to keep.
  • Tarun Das
  • Tarun Das's Avatar
17 Aug 2015 11:49
Replied by Tarun Das on topic Facebook comments module and K2 Category

Facebook comments module and K2 Category

Category: English K2 Community

All that I wanted was to add a FB comment module that would appear at the end of the item page of K2. The problem was that FB module would appear in K2 category listing pages too. I did not want that. Users need to comment only in the article not on the article lists. Sounds logical isn't it? So I was thinking how to remove that module from K2 Category listings. ( Wonder why nobody faced this problem before me). Module Anywhere is a wonderful extension. But it does not suit my requirement. Module Anywhere ADDs a module anywhere you want it does not REMOVE a module from the place you want. What Module Anywhere does is it makes a module acts like a plugin so that you can write the parameters in any writable area of your page. With Module Anywhere I had to put my FB comment module inside the introtext area of item pages as that's the only writable area of the page. ( I did not use Extra Fields). Now, think how it would look in a page if comments appears in the middle of the page before "Tagged under" and "Related Posts" things. Secondly, I have to edit all my old and future articles and put the Module Anywhere tag below it. That's certainly not the proper solution. For the same reason I did not use any FB comment plugin extension available for Joomla. The proper solution would be a module that appears only in K2 item pages. Extensive search in internet did not solve my problem. But Krikor gave me some hint in his reply when he wrote, "My approach however would be to create a new position in the item.php" . First I thought that would involve coding. Since I am not a coder and all my skills are limited to copy and paste ( that's ok with me, I am not a professional website maker, it's my hobby, I make websites only for non profit organisation for free) I searched in internet and found that two simple copy and paste would solve my problem. First I need to add a line:
<position>fbcomments</position>
in templateDetails.xml file. That would be my new module position name.
Second, I need to add a div at the end of the item.php file. This time I was lucky and found the code in Gavick site.
<div> <?php $position = 'fbcomments'; $params = array('style'=>'gk_style'); $document = &JFactory::getDocument(); $renderer = $document->loadRenderer('module'); $contents = ''; foreach (JModuleHelper::getModules($position) as $mod) { $contents .= $renderer->render($mod, $params); } echo $contents; ?> </div>

Those two simple cut and paste solved my problem. Thank you Krikor for your hint. Now you got to tell me whatever I did is right?

Regards
Tarun
  • Joe Campbell
  • Joe Campbell's Avatar
16 Aug 2015 13:47
Replied by Joe Campbell on topic [SOLVED] Module position in k2 template?

[SOLVED] Module position in k2 template?

Category: English K2 Community

Hi Roman,

The code Krikor provided can ONLY load a module position (outputs all modules assigned to that position).

While NoNumber Modules Anywhere can BOTH output an entire module position OR just one specific module.

Note: You can set Modules Anywhere to also handle the {loadposition} tags. In that case, you can safely disable the {loadposition} plugin all together.

Source: www.nonumber.nl/extensions/modulesanywhere

I hope this helps,

Joe Campbell
  • Uber Gruber
  • Uber Gruber's Avatar
15 Aug 2015 19:37 - 15 Aug 2015 20:08

Make user author page with articles pointing to other items

Category: English K2 Community

Hello there!
So the title is a bit confusing and I don't know how to put it better, so I'll explain a bit more the situation.
I'm working on a project for a magazine. The website will have an "Archive" category with each item corresponding to a number of the magazine. As you can guess, each magazine issue is composed by several articles from various authors.

The client asked me to have the possibility that each author has a page with an index of every article wrote in any magazine issue. Nothing fancy so far. A normal site with items composed by each author would have been an easy task.
The problem rising here is that actually none of these articles exist as a K2 item! The client wants that every article should point to the Magazine item in the “Archive” category where the user can download the .pdf file of the whole number. Look at the image below for more details on the author page example.

Not only that, the client also asked for tags with each article, and possibly to filter the various articles in each author page based on a quick filter search that will include either words in the title or the tags of the article.

While I’m quite confident with the Joomla CMS, I’m not very skilled with the K2 CCK. I know its possible to have tags and stuff for each article and so on, but dunno how to actually handle this “non existence” of the articles themselves!

My first thought was to create an item for each article (with title, image, tags and so on), then thanks to the new implemented redirect Joomla component, have bulks of redirections for each article to the proper Magazine Issue, or create a rewrite rule in .htaccess .

I’m wondering tho if this is a proper solution and if there isn’t anything else I can do, more efficient and less error prone.
Also is the article filter thing possible? Even if there are several pages of results? An ajax filter maybe? Is there any module or plugin you know to work well with K2?

Thank you for any suggestion and support!
  • Roman Lipatov
  • Roman Lipatov's Avatar
14 Aug 2015 23:01 - 17 Aug 2015 22:46

[SOLVED] How to get ratingValue for Google Microdata

Category: English K2 Community

Hi!
I trying to configure Ratings stars for Google Microdata

I can't understand, hot to get ratingValue

This is code with already working parameters:

aggregateRating [AggregateRating]:
worstRating:
bestRating:
ratingCount:

But without ratingValue
<?php if($params->get('itemRating')): ?> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" class="itemRatingBlock"> <span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span> <meta itemprop="worstRating" content="1"> <meta itemprop="bestRating" content="5"> <div class="itemRatingForm"> <ul class="itemRatingList"> <li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li> <li> <a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a> </li> <li> <a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a> </li> <li> <a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a> </li> <li> <a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a> </li> <li> <a href="#" rel="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a> </li> </ul> <div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog" <?php echo $this->item->numOfvotes; ?></div> <meta itemprop="ratingCount" content="<?php echo (preg_replace('/[^0-9]/', '', $this->item->numOfvotes)); ?>"/> </div> </div> <?php endif; ?>

Thanks!
  • Scott Oman
  • Scott Oman's Avatar
14 Aug 2015 11:55 - 14 Aug 2015 15:21
The Future of K2 was created by Scott Oman

The Future of K2

Category: English K2 Community

Dear JoomlaWorks and K2 Community,

I am new to K2. (I know, you are probably thinking, how is that possible?) See, I just got around to migrating my content from a Joomla 1.5 site to 3.+. The update and redesign of my site is going fairly well, and I'm pleased with the functionality of K2. Essentially I still prefer K2 over the Joomla core article management system, even though it now utilizes tags, because K2 also contains a nice comments feature and basically eliminates my need for Community Builder — though I may integrate K2 and CB together at a later date.

The thing is, I'm concerned K2 might not get upgraded for future Joomla versions, such as for Joomla 4, 5, etc... If that's the case, I would much prefer to just deal with the issue now by relying completely on the Joomla core system. (In the past I ran into a problem with one extension I was using to run my site. It was "the" main component and later wasn't upgraded by the developer. This really caused a huge problem: why I didn't get around to updating my site to Joomla 3.+ until now.)

Can you please tell me if I should be worried about K2 not being upgraded for use in future Joomla installs? What are the plans for the future of K2? Some information on the topic or reading material would be useful and much appreciated.

Many thanks in advance!
Scott

PS. I'm new, so please don't mind my ignorance if this issue has already been discussed at length or is totally obvious to others.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
12 Aug 2015 15:41
Replied by Krikor Boghossian on topic ID Extrafield

ID Extrafield

Category: English K2 Community

"Normal" search only looks in the item's content, not the extrafields.
One way to force K2 to look into ALL of the item's data (and get past MySQL's stop words) as well as search into tags and categories would be to enable Google Search integration.

I think that if you enable this setting (check K2's params) you won't need to map the ID into extrafields. The default frontend search will now "look" into your entire content.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
10 Aug 2015 17:21
Replied by Krikor Boghossian on topic Search in Tags, Category and Title only

Search in Tags, Category and Title only

Category: English K2 Community

Hello razen,

By default this is not possible,
K2's search only looks into the item's text.

For a solution I can refer you to this thread: www.joomlaworks.net/forum/k2-en/42214-search-two-or-more-words
  • kloud
  • kloud's Avatar
08 Aug 2015 11:27
Replied by kloud on topic show GPS Tools tracks in K2 items page

show GPS Tools tracks in K2 items page

Category: English K2 Community

thanks for answer but it does not works.
<?php defined('_JEXEC') or die('Restricted access'); jimport( 'joomla.plugin.plugin' ); jimport( 'joomla.html.parameter' ); defined('DS') or define('DS', DIRECTORY_SEPARATOR); defined('G_APP_NAME') or define('G_APP_NAME', 'com_gpstools'); require_once JPATH_ROOT.DS.'components'.DS.G_APP_NAME.DS.'helpers'.DS.'constants.php'; require_once JPATH_ROOT.DS.'components'.DS.G_APP_NAME.DS.'lib'.DS.'gps_helper.php'; require_once JPATH_ROOT.DS.'components'.DS.G_APP_NAME.DS.'lib'.DS.'gps_loader.php'; class plgContentGpsContent extends JPlugin{ function plgContentGpsContent( &$subject, $params ){ parent::__construct( $subject, $params ); } public function onContentPrepare($context, &$article, &$params, $page = 0){ //Don't run this plugin when the content is being indexed if ($context != 'com_content.article' || $context == 'com_finder.indexer') { return true; } // simple performance check to determine whether bot should process further if (strpos($article->text, 'GPSCONTENT') === false) { return true; } // j2.5 return plgContentGpsContent::process_content($article, $params, $page, $context); } function process_content(&$article, &$params, $page, $context){ $document = JFactory::getDocument(); $cjlib = JPATH_ROOT.DS.'components'.DS.'com_cjlib'.DS.'framework.php'; if(file_exists($cjlib)){ require_once $cjlib; }else{ die('CJLib (CoreJoomla API Library) component not found. Please download and install it to continue.'); } $language = JFactory::getLanguage(); $language->load('com_gpstools', JPATH_ROOT); CJLib::import('corejoomla.framework.core'); CJLib::import('corejoomla.ui.bootstrap', true); $article->text = preg_replace_callback('/\{GPSCONTENT(.*?)\}/', 'replace_gps_tags', $article->text); } } ?>
I guess that only this part of php file is looking for displaying maps in com_content, but I don't know what and how to change to make it work with K2
  • razen
  • razen's Avatar
06 Aug 2015 13:12

Search in Tags, Category and Title only

Category: English K2 Community

Hello,

I use K2Tools/Search as a search-function on my website. It only search through the main-categories
articles and that's ok. BUT: Right now it search through title and through extrafields, but it should ONLY
search through title, category or tags. Is there any way I can realise this?

Thanks for the help :)
  • Michael Yaeger
  • Michael Yaeger's Avatar
05 Aug 2015 21:28 - 05 Aug 2015 21:29
Replied by Michael Yaeger on topic Search Two or More Words

Search Two or More Words

Category: English K2 Community

Krikor wrote: Did you double check its settings? Is the container class present in your template?


I changed the container ID settings from "k2GoogleSearchContainer" to "k2Container" and the search results displayed. However, the Google search layout is horrendous (granted I haven't customized a template for Google search, yet), and even though I get results for 2+ word searches, the results displayed are all over the place. It returns tag pages, item pages, category pages, etc.--it's a jumbled up mess.

More testing yielded that if I search for any number of words that are in the item text or extra fields, I get good results. However, if I search for 2+ words in a category name, I get zero results. But, if I search for 1 word in a category name, I get good results.

I believe there is still an issue with the K2 search function. However, from my findings, I believe I can create a (hidden) extra field to store the category for each item and then I should be able to get good results for 2+ word searches. I'll be testing this out in the next few days.
  • Marc Solaris
  • Marc Solaris's Avatar
03 Aug 2015 15:46

Stop Google from indexing 'tag' pages when tags are used ?

Category: English K2 Community

Heya

Yes, I am aware of what Google says, but the reason why I'm posting here is because I used rel="nofollow" on other parts of the website and the online service I mentioned earlier (XML Sitemap Generator) removed these links, or lets say didn't index them, for the sitemap, wheres these k2 tag links are not being removed from the resulting sitemap (thus my worry that if the sitemap generator creates the links, goggle most probably will also index these links, even if I remove them from the sitemap).
  • Lefteris
  • Lefteris's Avatar
31 Jul 2015 18:38
Replied by Lefteris on topic K2 tags not working

K2 tags not working

Category: English K2 Community

Try to disable all the third-party installed system, K2 and content plugins on your site one by one until you find what is causing this. I recommend to do this on a development copy of your site. I also recommend to try to copy your site to a different server ( even a local one on your computer ) so we are sure that this is not caused due to server setup.

Finally try to edit your current .htaccess file and copy into it the contents of the htaccess.txt file found in your site root directory.
  • Lefteris
  • Lefteris's Avatar
31 Jul 2015 18:32
Replied by Lefteris on topic Where can I find tags page view / controller

Where can I find tags page view / controller

Category: English K2 Community

Hi,

The core file that generates the output on tag listing pages is /components/com_k2/templates/default/tags.php . Hacking directly this file is not recommended, you should create an override.
Displaying 1741 - 1760 out of 6582 results.

Powered by Kunena Forum