Display article content within menu module in Joomla - joomla

I am new to Joomla and have been asked to convert a non-Joomla site to use Joomla.
The site has a structure similar to an accordion menu, where the page content appears under the link to the page, like this:
Clicking on Article 1 Link:
╔════════════════╦══════════════════════╗
║ Article 1 Link ║ ║
║ ║ Content of article 1 ║
║ Article 2 Link ║ ║
║ Article 3 Link ║ ║
║ Article 4 Link ║ ║
║ Article 5 Link ║ ║
╚════════════════╩══════════════════════╝
Clicking on Article 3 Link:
╔════════════════╦══════════════════════╗
║ Article 1 Link ║ ║
║ Article 2 Link ║ ║
║ Article 3 Link ║ ║
║ ║ Content of article 3 ║
║ Article 4 Link ║ ║
║ Article 5 Link ║ ║
╚════════════════╩══════════════════════╝
Is it possible to do this in Joomla 2.5? I am struggling to understand how, since you can have a menu module, but how would you display article content within that module?
The article content will ideally be within the same <li> of the menu item, so in html view:
<ul>
<li>Link 1</li>
<li class="current">Link 2
<div>
<!-- ARTICLE CONTENT FOR Link 2 -->
</div>
</li>
<li>Link 3</li>
</ul>

There is an example in components/com_contact/contact/tmpl/default.php that begins around line 50 (give or take) that shows how to use the built in JHtml accordion (called Sliders in Joomla). You could use that code as an example if you want to build a new module from a copy of mod_menu.
First, though, I'd recommend trying out a few extensions since there are a number of Accordion Menus available on JED. If nothing else, you'll get ideas on how best to implement. http://extensions.joomla.org/extensions/structure-a-navigation/menu-systems/accordion-menus

I added a mod_menu override by copying the mod_menu file to MYTEMPLATE/html/mod_menu/CUSTOMMENUNAME.php
I then added in this to the for loop:
if ($item->id == $active_id) {
Which allowed me to see which page was currently being viewed. The with the great help of rcarey over on The Joomla! Forum, I added this to the top of the mod_menu file:
require_once JPATH_SITE.'/components/com_content/helpers/route.php';
JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_content/models', 'ContentModel');
// Get an instance of the model for getting an article
$model = JModelLegacy::getInstance('Article', 'ContentModel', array('ignore_request' => true));
// Set application parameters in model
$app = JFactory::getApplication();
$appParams = $app->getParams();
$model->setState('params', $appParams);
Then within the mod_menu loop, all I had to do was:
$article = $model->getItem($item->id)
Now I can use $article within the loop in mod_menu.

Related

How can I add pagination to a Magento 2 blog's meta titles?

I have a blog built on the Magento 2 CMS and while pagination does exist, all of the sub-pages share the same meta title ("Blog - Vaper Empire® Australia"). For example, the blog index and page 2 both share this exact same meta title. My aim is to make each page's meta title unique by adding the page number to the meta title - how can I accomplish this?

Why sitemap generator not generating link of more than 2 pagination pages content in blog section

Sitemap generator is only fetching links of posts from 2 pages only and my blogs have total 16 posts out of which it fetches only 10

Magento custom option

I am working with magento 1.8.1 and I have problems in the resolution of personalized options for customized products.
My product calculates the price based on several options. The first is for quantity of items ordered and type of color, size ... well this is calculated.
But the problem is that if you want to customize an article, an option is available to select, but this has a fixed precione, and this should change with respect to the number of items ordered.
example:
5 jerseys € 25 + € 5 Customization
10 jerseys € 45 + € 5 Customization
and this is the problem.

creating a menu-oriented with different levels in Joomla

I'm trying to create a menu-oriented module with the following menu :
Menu Shops :
Shops (category blog)
shop 1 (article)
shop 2 (article)
shop 3 (article)
shop 4 (article)
shop 5 (article)
I'd like to only show the 5 sub-menus shop 1 -> shop 5 in my module. When I create the module (Module Manager/Module Menu), I choose 'shops' as base item and '2' as start level. Unfortunately, it doesn't show anything.
But when I choose '1' as start level and '2' as end level, it only shows Shops.
I'm using joomla 3
Any ideas ?
Joomla menu modules cache is not working properly in these situations, just disable the cache of the module.

How to divide post on many pages in joomla cms

How to break article for many little pages?
with navigation at page footer?
for example:
pages: 1 | 2 | 3 | 4
There's a Pagebreak button at the bottom of the article manager that you can use to do this. You'll have to fiddle with the layout to get the navigation on the footer.
http://docs.joomla.org/Splitting_a_long_Article_into_multiple_linked_pages

Resources