Page 1 of 1

can't seem to get alternative menu item working

Posted: Tue Nov 15, 2011 3:00 am
by lyndonr
hello all,
very psyched about alternative menu items, now if I could just make them work! starting off easy, just want to create an alternative item for a single article

copied both

/components/com_content/views/article/tmpl/default.php
/components/com_content/views/article/tmpl/default.xml

updated to

/templates/myTemplate/html/com_content/article/myItem.php
/templates/myTemplate/html/com_content/article/myItem.xml

uploaded. I can see the new menu item appears. when I choose it the internal URL gets build looks like this

Code: Select all

index.php?option=com_content&view=article&layout=myTemplate:myItem&id=1
so I know it's getting picked up at least partially, but it still uses the default.php layout. obviously, I've poured over http://docs.joomla.org/Layout_Overrides_in_Joomla_1.6. the only place I've deviated from the instructions is by editing the menu item title directly in myItem.xml. because I don't use any language overrides. updated it to this...

Code: Select all

<layout title="Single Article (Custom)" option="com_content_article_view_default_option">
	<help
		key = "JHELP_MENUS_MENU_ITEM_ARTICLE_SINGLE_ARTICLE"
	/>
	<message>
		<![CDATA[com_content_article_view_default_desc]]>
	</message>
</layout>
you don't have to use language overrides to use alternative layouts right? what am I missing?

thanks in advance!

Re: can't seem to get alternative menu item working

Posted: Mon Jan 16, 2012 11:53 am
by stefwilliams
Did you ever get the answer to this? I have the same problem.

Re: can't seem to get alternative menu item working

Posted: Mon Jan 16, 2012 3:51 pm
by lyndonr
yup. got both working. sorry, I should have posted that here...

here's the post where I worked through it. basically it works as published. I just needed to understand it better

http://forum.joomla.org/viewtopic.php?f=579&t=578662

Re: can't seem to get alternative menu item working

Posted: Mon Jan 16, 2012 4:10 pm
by stefwilliams
Hmm,
That's where I've been looking too - and I've been tracking my progress - or lack of - there...
I'm still a bit stuck. I can get the menu item to show up, but it only wants to use the default php files - either ones in the original directory, or ones in my html directory, but only files called default...
I can't figure out what I'm missing to get it to use my own files.

Re: can't seem to get alternative menu item working

Posted: Mon Jan 16, 2012 4:21 pm
by lyndonr
if it were me, I'd start with a fresh install. it's probably some customization you've done that's messing it up. just my 2 cents. good luck.

Re: can't seem to get alternative menu item working

Posted: Mon Jan 16, 2012 4:33 pm
by stefwilliams
I'd give that a go, but it already is pretty much a fresh install. Only installed last week, and haven't customised anything - except for my template and attempting to get over-rides to work (and the lang file mentioned in the other thread - but that's easily fixed)

I saw that you solved your problem by checking that no other menu items were linked. Other than checking through the actual menu items, there's no other place these can be linked is there? Something is definitely still inserting the 'default' values somewhere

Re: can't seem to get alternative menu item working

Posted: Tue Jan 17, 2012 11:18 am
by stefwilliams
Solved:
it's seemingly a bug in 'categories'
category works fine as documented, but not categories. Bit of a waste of a day yesterday then, but at least I learned something :)