Posts

Showing posts with the label Joomla

Joomla: How to add module position within the module or component layout template?

In your site template, you can use something like this to load modules in certain positions: <jdoc:include name="position-0" type="modules" /> You can't use the above markup within the module or component layout template (we are talking about the php files inside /tmpl subdirectory of your module or component's view). But there is a workaround. Method 1: This is a straight Joomla code. You can use the following code to load modules within the module or component layout templates: <?php $document = &JFactory::getDocument(); $renderer = $document->loadRenderer('modules'); $position = 'position-0'; $options = array('style' => 'raw'); echo $renderer->render($position, $options, null); ?> This will load the modules that are assigned in "position-0" position. Method 2: There is another method using an extension if you don't want to write all those lines of code. You...

URL for all the featured items in K2

Create a menu item of type "K2 » Itemlist / Category". In Parameters (Basic), select one or more categories whose featured items you want to display. On the " Featured items " dropdown, select "Show only featured items". Save the new menu item. Note the ItemId for this new menu item. Your link will be something like this: index.php?option=com_k2&view=itemlist&layout=category&Itemid=

Creating an item without a category in K2

You can create an item without a category by combining K2 and Joomla features. For all the items that need to have categories, use K2's categories. Use Joomla articles for creating all the uncategorized articles. By doing this, you can display all the category-related items by using K2's mod_k2_tools. This will also prevent K2 from showing all the uncategorised articles, which are created by using Joomla's native article feature. For displaying uncategorised articles at module position, you can then create a new menu and have it display at a particular module location.