Read More links passing wrong ItemID in blog section

For Joomla! 1.0 Coding related discussions.
Locked
rmd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 233
Joined: Sat Feb 18, 2006 3:31 pm

Read More links passing wrong ItemID in blog section

Post by rmd » Thu Jul 27, 2006 1:13 pm

I have been having trouble with what I thought was assigning a template to a content item. Closer examination shows that the Read More links on the blog section page are not passing the correct ItemID parameter in the URL. Does anyone know how to fix this or where I should look for the code that generates that link? I hate to mess with the core code, but this is the last little niggling issue before the site can go live.

I am using version 1.0.10, upgraded a little over a week ago from 1.0.9.

Any suggestions would be much appreciated. Thanks in advance!

User avatar
ratlaw
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Wed Aug 17, 2005 10:22 pm
Contact:

Re: Read More links passing wrong ItemID in blog section

Post by ratlaw » Wed Aug 02, 2006 12:01 pm

Hi,

Do have a URL that we could look at?

If not can you tell us if the Itemid is just missing or changed to a completely different Itemid?
Are you using the Content Component to create the menu link or just creating your own link?
Ric
My site search.yahoo.com
Search Monkey gallery.search.yahoo.com

rmd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 233
Joined: Sat Feb 18, 2006 3:31 pm

Re: Read More links passing wrong ItemID in blog section

Post by rmd » Wed Aug 02, 2006 2:17 pm

I can send you a link via PM, if you would like. Currently, the read more links are disabled and I have added manual links. So, when you are ready to take a look, let me know and I will turn them back on for you.

The itemid is there...it is completely different from what it should be. It is retaining the same itemid as the blog section itself. For example, the link to the "about" blog section looks like this: index.php?option=com_content&task=blogsection&id=4&Itemid=28. When you click on the automated "read more" links, the content item link looks like this: index.php?option=com_content&task=view&id=18&Itemid=28 when it should be index.php?option=com_content&task=view&id=18&Itemid=59.

Does that help?

User avatar
ratlaw
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Wed Aug 17, 2005 10:22 pm
Contact:

Re: Read More links passing wrong ItemID in blog section

Post by ratlaw » Wed Aug 02, 2006 2:35 pm

I think that explains it,

The Itemid is actually used to identify the current 'Menu Link'. So the when you click on a 'Menu Link', 'about' in your case, the Itemid is set and (hopfully) wont change until a different Menu Link is clicked. This is why it is carried through when you click on 'read more'. So in answer to your question is working as coded but not how you expected.

What are you using it for, or trying to do with it?
Ric
My site search.yahoo.com
Search Monkey gallery.search.yahoo.com

rmd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 233
Joined: Sat Feb 18, 2006 3:31 pm

Re: Read More links passing wrong ItemID in blog section

Post by rmd » Wed Aug 02, 2006 2:49 pm

I am assigning different templates to the section page and article pages. When clicking from the section page, it is not switching to the assigned template because of this itemid issue. Change the itemid and the template changes as expected.

User avatar
ratlaw
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Wed Aug 17, 2005 10:22 pm
Contact:

Re: Read More links passing wrong ItemID in blog section

Post by ratlaw » Wed Aug 02, 2006 3:06 pm

As far as I can tell the only option without changing code will be to have each one of your sections as a menu link. Once you are inside a  module/component the Itemid will always be that of the last 'Menu Item' clicked.

Hope you work it out.
Ric
My site search.yahoo.com
Search Monkey gallery.search.yahoo.com

rmd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 233
Joined: Sat Feb 18, 2006 3:31 pm

Re: Read More links passing wrong ItemID in blog section

Post by rmd » Wed Aug 02, 2006 3:14 pm

I have each section as a menu item. And have even created each article as a menu item on an unpublished menu. In the past, this has worked. I guess my only option at this point are the manual links.  :(

What kind of code changes would it require? If it would not be too extensive, I am willing to make some modifications.

Thanks so much for your help!

User avatar
ratlaw
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Wed Aug 17, 2005 10:22 pm
Contact:

Re: Read More links passing wrong ItemID in blog section

Post by ratlaw » Wed Aug 02, 2006 3:28 pm

Off the top of my head I would say you could do it with a mambot.

It would have to check the id of the content to see if the Itemid needs to change. You would have to keep a store of which content or section uses which Itemid. Then change the Itemid as needed something like below:

//$myIds = array('content_id'=>'Itemid' );
$myIds = array( 18 => 59 );

if( isset( $_REQUEST['view'] ) && isset( $_REQUEST['id'] ) && isset( $myIds[$_REQUEST['id']] )  )
    $_REQUEST['Itemid'] = $myIds['content_id'];

This is untested but in the right area
Ric
My site search.yahoo.com
Search Monkey gallery.search.yahoo.com

rmd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 233
Joined: Sat Feb 18, 2006 3:31 pm

Re: Read More links passing wrong ItemID in blog section

Post by rmd » Wed Aug 02, 2006 3:33 pm

Thanks for that!

LazyLeopard
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Jul 05, 2006 1:42 pm

Re: Read More links passing wrong ItemID in blog section

Post by LazyLeopard » Wed Aug 16, 2006 3:49 pm

ratlaw wrote: The Itemid is actually used to identify the current 'Menu Link'. So the when you click on a 'Menu Link', 'about' in your case, the Itemid is set and (hopfully) wont change until a different Menu Link is clicked. This is why it is carried through when you click on 'read more'. So in answer to your question is working as coded but not how you expected.
Hmmm... If you have a main menu and a sub-menu and you've arrived at the page via the sub-menu, the menu link passed on via "read more" is, illogically, the Id of the main menu item, not the Id of sub-menu item by which you actually reached it???

Consider:

You go to a main menu link which takes you to:

Code: Select all

/index.php?option=com_content&task=section&id=3&Itemid=4
This presents a sub-menu, and you select an item from that sub-menu which takes you here:

Code: Select all

/index.php?option=com_content&task=blogcategory&id=12&Itemid=20
You scroll down a way, and one of those blog entries has a "Read more..." which you follow. It takes you here:

Code: Select all

/index.php?option=com_content&task=view&id=92&Itemid=4
which, incidentally, highlights the top menu option as active, not the sub-menu through which it was reached.

Surely the logical place for it to take you is here:

Code: Select all

/index.php?option=com_content&task=view&id=92&Itemid=20
*confused*

(Using 1.0.10)
Last edited by LazyLeopard on Fri Aug 18, 2006 4:50 pm, edited 1 time in total.

LazyLeopard
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Jul 05, 2006 1:42 pm

Re: Read More links passing wrong ItemID in blog section

Post by LazyLeopard » Fri Aug 18, 2006 4:45 pm

...and just to make things weirder... If I replace that first menu link with this one:

Code: Select all

/index.php?option=com_content&task=blogcategory&id=20&Itemid=31
(so it's now a blogcategory when before it was a section) then the same sub-menu link still takes me to:

Code: Select all

/index.php?option=com_content&task=blogcategory&id=12&Itemid=20
(exactly the same as before) and the "Read more..." link then takes me to:

Code: Select all

/index.php?option=com_content&task=view&id=92&Itemid=20
which is the place I expected to be in the previous example. Seems to me one of these behaviours is buggy.
Last edited by LazyLeopard on Fri Aug 18, 2006 4:49 pm, edited 1 time in total.

rmd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 233
Joined: Sat Feb 18, 2006 3:31 pm

Re: Read More links passing wrong ItemID in blog section

Post by rmd » Fri Aug 18, 2006 4:50 pm

that is odd...hopefully, this won't be an issue in 1.5? I've not looked to see what the plans are, but I would think this menu issue would be among them.

Asphyx
Joomla! Hero
Joomla! Hero
Posts: 2454
Joined: Sun Aug 28, 2005 5:03 pm

Re: Read More links passing wrong ItemID in blog section

Post by Asphyx » Fri Aug 18, 2006 5:25 pm

part of the problem I think is the menu display parameters override item display parameters. If I'm not mistaken it creates a new item id for each menu item that is different than the individual content item id.

This is one of the legacy issues I do hope 1.5 and it's eventual overhaul of the output rendering system will make go away.

Menu's should have five output settings...
default - Uses whatever settings are already set in the item it is pointing to. set to a section it uses section parameters, set it to cat it uses Cat parameters etc...
Section - Uses Section display parameters
Category - Uses Category display parameters
Item - Uses individual Item Parameters
Custom - Allow you to set your own. which is usefull for components who don't have display parameters of their own that are set in Joomla

That should allow you to assign a template to sections,cats and items and you can choose if the menu settings override or simply use what is already set!

This would require some change to the way Sections and Cats are defined but it shouldn't be too hard to do that...

Of course with the new framework this entire thought might not be needed as the flexability on display will move to a more of a TAG system as opposed to the current parameter system we have now!

sorry if I took this a little off topic...

AmyStephen

Re: Read More links passing wrong ItemID in blog section

Post by AmyStephen » Sat Aug 19, 2006 12:17 am

LazyLeopard --

There are a number of bugs related to ItemID for v. 1.0.10. Please try:

[KNOWN ISSUE] Wrong itemid on Frontpage

Robin is watching that thread. I believe the devs are going to start on v 1.0.11 to try to fix some of these item id issues. So, if the hacks listed here do not work, you might want to add your problem to the list.

++++

Other ItemID issues for 1.0.10 (although I do not believe it fits your description - please check in case, though.)

Known issues/things to look out for in Joomla 1.0.10,

1.0.10 upgrade: Read more returns "you are not authorized" error

Good luck.
Amy

++++

Briefly on Mike's "comments" (which, he is right, have nothing to do with the v 1.0.10 bugs :P ):

- The ItemID data model will not change in v. 1.5 and is not anticipated to change until v. 2.0.

- The value for the ItemID parameter (menu item) will only accidentally be the same value as the id (content item/article) parameter. These are two different data entities and have nothing to do with one another.

- Even in v 2.0 there will be a menu item key value, possibly it will continue to be dubbed ItemID. But, it will not be the "backbone" of the navigation system. Hopefully, a "page id" value of SOME sort will rise up and take its proper place, instead. The data model problem is that a lower, more precise data entity is missing in the data model. Hence, application problems can easily result after code changes. v. 1.0.10 made huge performance gains in the query area -- and was not very well tested given pressure from security problems that rushed a release.

- I truly think (and hope) you are misunderstanding the tag issue, as well! Tags should not replace primary menus. Think "keyword/search" when you think tag.

- If you are interested in "the talk" on 2.0 data model, track Diri and MMX.

LazyLeopard
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Jul 05, 2006 1:42 pm

Re: Read More links passing wrong ItemID in blog section

Post by LazyLeopard » Tue Aug 22, 2006 11:11 pm

The [KNOWN ISSUE] Wrong itemid on Frontpage patch does seem to have fixed the strangeness I was seeing.

Thanks. :)


Locked

Return to “Joomla! 1.0 Coding”