Keyword

Link from K2 Content Module to a Page

  • Stefan
  • Stefan's Avatar Topic Author
  • Offline
  • New Member
More
10 years 6 months ago - 10 years 6 months ago #126155 by Stefan
hi everyone, i started using K2 a few days ago and managed to find out most things on my own by some trial and error, reading a few tuts and (mostly) looking how things have been configured in the template i bought.

however i´m stuck at one thing, i set up the template page to illustrate you my question:

www.planetpinky.com/drama/index.php

on the front page, there are 8 girls below the slideshow - if you click on one of the pictures, you see the pic full size + text (item is displayed completely).

I´m looking for a possibility to link to a page in the menu, i.e.:

click on "Marie, 23, LA" -> www.planetpinky.com/drama/index.php/services is shown.

Basically, i want to link from an item (and the item-picture) to a menu-item with the K2 Content Module.

can that be done?

sorry for possibly flaws in my posting, english is not my first language

thx,

ilcuero

.

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

More
10 years 6 months ago - 10 years 6 months ago #126156 by Lefteris
Replied by Lefteris on topic Re: Link from K2 Content Module to a Page
Hi. If you create a menu link for the item K2 will detect it automatically. Now if what you mean is to link to a different page then you need to write some code:
<?php 
$application = JFactory::getApplication();
$menu = $application->getMenu();
// Example to get menu item with id 7
$menuItem = $menu->getItem(7);
$link = JRoute::_($menuItem->link.'&Itemid='.$menuItem->id);
?>

Note that this code generates the link for menu item 7. However if there is some loginc behind the relationship between K2 items and menu links then probably there is a better way to do this.

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