can't seem to get alternative menu item working

Everything to do with Joomla! 2.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
lyndonr
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Tue Oct 16, 2007 2:33 am

can't seem to get alternative menu item working

Post by lyndonr » Tue Nov 15, 2011 3:00 am

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!

stefwilliams
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 29, 2009 8:20 am

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

Post by stefwilliams » Mon Jan 16, 2012 11:53 am

Did you ever get the answer to this? I have the same problem.

lyndonr
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Tue Oct 16, 2007 2:33 am

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

Post by lyndonr » Mon Jan 16, 2012 3:51 pm

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

stefwilliams
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 29, 2009 8:20 am

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

Post by stefwilliams » Mon Jan 16, 2012 4:10 pm

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.

lyndonr
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Tue Oct 16, 2007 2:33 am

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

Post by lyndonr » Mon Jan 16, 2012 4:21 pm

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.

stefwilliams
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 29, 2009 8:20 am

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

Post by stefwilliams » Mon Jan 16, 2012 4:33 pm

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

stefwilliams
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 29, 2009 8:20 am

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

Post by stefwilliams » Tue Jan 17, 2012 11:18 am

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 :)


Locked

Return to “Templates for Joomla! 2.5”