Keyword

Advanced Search

Search Results (Searched for: k2 Tag)

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
09 Sep 2016 19:41
Replied by Krikor Boghossian on topic Custom K2 Content Module Assistance

Custom K2 Content Module Assistance

Category: English K2 Community

Here you go mate:
<?php /** * @version 1.0 * @package Get the current item's data * @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html */ // no direct access defined('_JEXEC') or die('Restricted access'); // imports require_once (JPATH_SITE.'/components/com_k2/helpers/route.php'); require_once (JPATH_SITE.'/components/com_k2/helpers/utilities.php'); // required params $mainframe = JFactory::getApplication(); $db = JFactory::getDBO(); $user = JFactory::getUser(); $option = JRequest::getCmd('option'); $view = JRequest::getCmd('view'); // Execute only in a K2 item if($option == 'com_k2' && $view == 'item') { // Get the current id $itemid = JRequest::getInt('id'); // Perform the query $query = "SELECT i.*, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams FROM #__k2_items as i LEFT JOIN #__k2_categories c ON c.id = i.catid WHERE i.published = 1 "; $query .= " AND i.access IN(".implode(',', $user->getAuthorisedViewLevels()).") "; $query .= " AND i.id={$itemid}"; // Load the results $db->setQuery($query); $item = $db->loadObject(); // Load the model $model = K2Model::getInstance('Item', 'K2Model'); // Building the object // Build the object - tags $tags = $model->getItemTags($item->id); for ($i = 0; $i < sizeof($tags); $i++) { $tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name)); } $item->tags = $tags; // Build the object - extrafields $item->extra_fields = $model->getItemExtraFields($item->extra_fields, $item); } ?> <!-- Start the layout --> <?php if($option == 'com_k2' && $view == 'item'): ?> <!-- PASTE YOUR CODE HERE JOE --> <?php endif; ?> <!-- end -->
  • Joe Campbell
  • Joe Campbell's Avatar
09 Sep 2016 15:01
Replied by Joe Campbell on topic Custom K2 Content Module Assistance

Custom K2 Content Module Assistance

Category: English K2 Community

That's for the correction - "Copy & Paste"

Perhaps I did not property present my need.

I want to use a K2 Content Module override to display the title, specific tag(s), and specific extra field(s) of the current item being viewed.

The following sample K2 Content Module override code does not render the desired content for the current item being viewed.
<?php // no direct access defined('_JEXEC') or die; ?> <?php echo $item->title; ?> <?php echo $item->extraFields->bannerOne->value; ?> <?php echo $item->tags[0]->link; ?> <?php echo $item->tags[0]->link; ?>
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
09 Sep 2016 14:17
Replied by Krikor Boghossian on topic Custom K2 Content Module Assistance

Custom K2 Content Module Assistance

Category: English K2 Community

Cut and paste no.
Copy paste yes.

Actually the code seems correct, apart from the
$this->item->tags[0]->link;

where this should be used instead
$item->tags[0]->link;
  • Joe Campbell
  • Joe Campbell's Avatar
09 Sep 2016 06:14
Custom K2 Content Module Assistance was created by Joe Campbell

Custom K2 Content Module Assistance

Category: English K2 Community

I need assistance creating a K2 Content Module (override) that renders the current item title, tags and specific extra fields.

I saw that @MohamedAbdelaziz recommended BNR Content for K2 on this forum post:
www.joomlaworks.net/forum/k2-en/46416-solved-how-to-call-k2-viewed-item-s-title-creation-date#156871

I would prefer an override solution instead of using an additional extension.

I would like to render the following example via the K2 Content Override:

<?php echo $item->title; ?>
<?php echo $item->extraFields->bannerOne->value; ?>
<?php echo $this->item->tags[0]->link; ?>

Would you be able to assist me with cut & paste solution.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
07 Sep 2016 17:53
Replied by Krikor Boghossian on topic K2 Featured at tag.php

K2 Featured at tag.php

Category: English K2 Community

You 're welcome Gastón :)
  • Gastón Camaño
  • Gastón Camaño's Avatar
07 Sep 2016 17:02
Replied by Gastón Camaño on topic K2 Featured at tag.php

K2 Featured at tag.php

Category: English K2 Community

It works, i added " <?php if($item->featured): ?> <div class="feature-tag"><span>Test text</span></div> <?php endif; ?> " to the tag.php

Thanks for the help
  • Artonezero Limited
  • Artonezero Limited's Avatar
07 Sep 2016 15:18
Replied by Artonezero Limited on topic Cant render extrafield in category item view

Cant render extrafield in category item view

Category: English K2 Community

Yes latest i believe - 2.7.1 - i can try reinstalling?

No other extensions on the entire site. Just Joomla a basic custom template and K2 presently.

It's a staging / development site.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
07 Sep 2016 15:10
Replied by Krikor Boghossian on topic K2 Featured at tag.php

K2 Featured at tag.php

Category: English K2 Community

Hello Gaston,

While the featured flag is not available in the tag.php template, the flag ($item->featured) is still present and functioning.

You can use the same if/else check for $item->featured and echo a custom class.
  • Gastón Camaño
  • Gastón Camaño's Avatar
05 Sep 2016 22:24
K2 Featured at tag.php was created by Gastón Camaño

K2 Featured at tag.php

Category: English K2 Community

Hi to everyone, i need to show the featured icon (or something, it doesn't matter what, i'll change it later), at the k2 tag menu item result. I did a print_r($item) in the tag.php file at the k2's template that i'm using, but it doesn't show anything about the featured option. So i'm out of ideas.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
31 Aug 2016 13:01
Replied by Krikor Boghossian on topic Get tag ID in mod_k2_tools/tags.php

Get tag ID in mod_k2_tools/tags.php

Category: English K2 Community

Hello,

The id is not part of the object. Unfortunately in order to get the tag's id you will not 'hack' the module's helper.php file.
  • Carlos
  • Carlos's Avatar
30 Aug 2016 21:26
Get tag ID in mod_k2_tools/tags.php was created by Carlos

Get tag ID in mod_k2_tools/tags.php

Category: English K2 Community

Hello.

How can I display the tag ID in mod_k2_tools/tags.php?

I tried <?php echo $tag->id; ?> but didn't work

I need to have something like

<a class="MyTag<?php echo $tag->id; ?>"><?php echo $tag->tag; ?></a>

Thanks!
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
30 Aug 2016 15:29
Replied by Krikor Boghossian on topic Missing keywords in the meta tags from my rss feed

Missing keywords in the meta tags from my rss feed

Category: English K2 Community

Hello Norman,

By default Joomla! does not add metadata to its feeds.
A similar request exists here but it involves hacking the core www.joomlaworks.net/forum/k2-en/44723-modify-k2-rss-feed-output-add-extra-fields
  • Joe Campbell
  • Joe Campbell's Avatar
25 Aug 2016 19:07
Replied by Joe Campbell on topic All Tags If Condition

All Tags If Condition

Category: English K2 Community

Thanks @Krikor - it works, with one small change

<?php foreach ($this->item->tags as $tag): ?>
<?php if($tag->name == 'K2 Tips'): ?>
// Do something
<?php endif; ?>
<?php endforeach; ?>
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
25 Aug 2016 18:54 - 25 Aug 2016 19:09
Replied by Krikor Boghossian on topic All Tags If Condition

All Tags If Condition

Category: English K2 Community

This code checks only the first tag of that item.
In order to check the entire array of tags (all of the item's tags), you need a foreach statement like the one which prints them.
<?php foreach ($this->item->tags as $tag): ?> <?php if($tag->name == 'K2 Tips'): ?> // Do something <?php endif; ?> <?php endif; ?> <?php endiforeach; ?>
  • Joe Campbell
  • Joe Campbell's Avatar
25 Aug 2016 14:41
All Tags If Condition was created by Joe Campbell

All Tags If Condition

Category: English K2 Community

I know how to target a tag based on its position:
<?php if($this->item->tags[0]->name == 'K2 Tips'): ?>

Is it possible to target all the tags of an item?
  • Thomas Hultgren
  • Thomas Hultgren's Avatar
23 Aug 2016 17:07
[SOLVED] Hyphen in my i-frame was created by Thomas Hultgren

[SOLVED] Hyphen in my i-frame

Category: English K2 Community

Hi,

I got a recent problem. I use iframes in K2 extrafields and it have worked perfect until now. I'll have tried to delete the hyphen in the iframe tag but after saving it comes back again? below is the iframe tag as it shows in the extrafields.

<i-frame src="player.vimeo.com/video/164408327" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>
<p><a href="vimeo.com/164408327">Efter vågen from vimeo.com/teaterpero">Teater Pero on vimeo.com">Vimeo.


<i-frame src="player.vimeo.com/video/152949349" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>

vimeo.com/152949349">Efter vågen - intervju under repetetitionsarbetet from vimeo.com/teaterpero">Teater Pero on vimeo.com">Vimeo.



Regards Thomas
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
18 Aug 2016 14:42
Replied by Krikor Boghossian on topic K2 category introtext view, iframe Youtube video not showing

K2 category introtext view, iframe Youtube video not showing

Category: English K2 Community

If you are using a word limit, then all HTML tags are being stripped.
I would suggest using the media tab and showing the item's video in the category view.
  • Joe Campbell
  • Joe Campbell's Avatar
18 Aug 2016 12:55
Replied by Joe Campbell on topic [SOLVED] tag.php display tags and attachments

[SOLVED] tag.php display tags and attachments

Category: English K2 Community

Has this limitation been resolved with the latest version of K2?

If not, can this be executed with a plugin or does it require a hack?
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
18 Aug 2016 12:53
Replied by Krikor Boghossian on topic Tags and extra fields stopped working after upgrade

Tags and extra fields stopped working after upgrade

Category: English K2 Community

The notices can be hidden by deactivating error reporting (which should be done in production sites). The upcoming version will take care of notices as well.

Now, from what I can see you are using K2Store which generating the JS issues which cause the tags and extrafields to fail.

You should c/p our conversation to the K2 devs regarding these issues.
k2storejqui.js:16 Uncaught TypeError: this.element.uniqueId is not a function(…) k2storejqui.js:16 Uncaught TypeError: Cannot read property 'element' of undefined(…)
  • Kelsey Brookes
  • Kelsey Brookes's Avatar
18 Aug 2016 07:56
Showing off - my latest K2 driven development was created by Kelsey Brookes

Showing off - my latest K2 driven development

Category: English K2 Community

Hi there,

About the project
I don't do this very often, but I'm pretty proud of this one. I'm a partner in a brand agency in Sydney Australia and we recently undertook the rebrand of a real estate business that felt they'd outgrown their previous look and feel. We've now launched and are in the final stages of roll out.

About the site
It's a custom-built integration with MyDesktop, which is the main property portal feed in Australia. Agencies upload their properties and have them pushed out to all the major portals and to their own site.

We made heavy use of template overrides and extra fields. There's a lot of logic being driven by extraFields that decides what should be shown on any given property. It uses tags to show which agents (if any) are assigned to properties. ExtraFields also drive the customised Google Maps instance. There's also custom modules for auctions, open for inspections and other elements.

We also used the excellent UALayout plugin in combination with standard Bootstrap responsive techniques in overrides to determine what should be shown for mobiles, tablets and desktop.

Livesite: www.grea.com.au
Displaying 1121 - 1140 out of 6582 results.

Powered by Kunena Forum