The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Sep 17, 2005 5:03 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Sun Aug 21, 2005 2:57 pm
Posts: 1369
Location: Colorado, USA
I'm trying to correct an issue with Table-Content Category pages.  The links displayed for the content items on Table-Content Category include the Itemid of the Table-Content Category instead of the Itemid of the content item.

I believe that the file that needs to be changed is  /mambots/search/categories.searchbot.php and my best guess as to how the Itemid is currently being assigned is highlighted in red below. 

I've tried a couple of things, but since I haven't the foggiest what I'm doing all I keep doing is breaking my site.

If anyone can tell me if I'm at least mucking around in the right spot I'd be grateful, and if there are any suggestions for getting the Itemid to point at the item rather than the Table-Content Category I'd be ecstatic.

    $query = "SELECT a.name AS title,"
        . "\n a.description AS text,"
        . "\n '' AS created,"
        . "\n '2' AS browsernav,"
        . "\n s.id AS secid, a.id AS catid,"
      . "\n m.id AS menuid, m.type AS menutype"
        . "\n FROM #__categories AS a"
        . "\n INNER JOIN #__sections AS s ON s.id = a.section"
        . "\n LEFT JOIN #__menu AS m ON m.componentid = a.id"
        . "\n WHERE ( a.name LIKE '%$text%'"
        . "\n OR a.title LIKE '%$text%'"
        . "\n OR a.description LIKE '%$text%' )"
        . "\n AND a.published = '1'"
        . "\n AND a.access <= '$my->gid'"
        . "\n AND ( m.type = 'content_section' OR m.type = 'content_blog_section'"
        . "\n OR m.type = 'content_category' OR m.type = 'content_blog_category')"
        . "\n ORDER BY $order"
        ;
        $database->setQuery( $query );
        $rows = $database->loadObjectList();

        $count = count( $rows );
        for ( $i = 0; $i < $count; $i++ ) {
                if ( $rows[$i]->menutype == 'content_category' ) {
                        $rows[$i]->href = 'index.php?option=com_content&task=category§ionid='. $rows[$i]->secid .'&id='. $rows[$i]->catid .'&Itemid
='. $rows[$i]->menuid;

                        $rows[$i]->section      = 'Category List';
                }

Thanks in advance for any suggestions.

_________________
¡Pura Vida!
Ray,
joomla in testing at Costa Rica Travel: http://costaricamap.net
http://costa-rica-guide.com


Top
 Profile  
 
PostPosted: Fri Oct 28, 2005 8:59 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Sun Aug 21, 2005 2:57 pm
Posts: 1369
Location: Colorado, USA
I've learned a bunch of php in my spare time in the past month, but I'm still not making any headway on this issue.  It looks like it should be working, but every linked title generated by the last two lines has the Itemid of the category instead of the linked title...

Any suggestions would be appreciated.

_________________
¡Pura Vida!
Ray,
joomla in testing at Costa Rica Travel: http://costaricamap.net
http://costa-rica-guide.com


Top
 Profile  
 
PostPosted: Fri Nov 04, 2005 1:49 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Fri Aug 26, 2005 11:09 am
Posts: 198
I may well have misunderstood your problem (because I'm not quite sure where the searchbot comes into it) but if you publish a Table - Content Section menu link to the section in which your items reside (not necessarily in a visible menu), your problem should go away because the itemid will always be picked up from that and will thus be consistent across all display listings (blogs, category lists, the lot).

The downside is that you will discover that this can cause other problems with your pathway and main menu highlighting, depending on how your menu structure is set up.


Top
 Profile  
 
PostPosted: Fri Nov 04, 2005 2:02 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Sun Aug 21, 2005 2:57 pm
Posts: 1369
Location: Colorado, USA
kper wrote:
I may well have misunderstood your problem (because I'm not quite sure where the searchbot comes into it) but if you publish a Table - Content Section menu link to the section in which your items reside (not necessarily in a visible menu), your problem should go away because the itemid will always be picked up from that and will thus be consistent across all display listings (blogs, category lists, the lot).

The downside is that you will discover that this can cause other problems with your pathway and main menu highlighting, depending on how your menu structure is set up.


The problem is that when I do this the Itemid in the linked title URL is that of the Table-Content Section or the Table-Content Category not the Itemid of the Content Item. So if you click on the linked title URL you are sent to a page that displays the Content Item, but with the Itemid of the Table-Content Section or the Table-Content Category leading to exactly the " problems with your pathway and main menu highlighting" that you mention.

The searchbot came in because I thought that was the code being used to generate the linked titles in a Table-Content Category
[url=http://forum.joomla.org/index.php/topic,16412.msg102109.html#msg102109]
Here is a more comprehensive statement of the problem and what I'm trying to do to solve it[/url].

_________________
¡Pura Vida!
Ray,
joomla in testing at Costa Rica Travel: http://costaricamap.net
http://costa-rica-guide.com


Top
 Profile  
 
PostPosted: Fri Nov 04, 2005 3:21 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Fri Aug 26, 2005 11:09 am
Posts: 198
Yes, I see. Sorry.

In fact, all publishing a Table - Content Section link helps to do, now that I look at it more closely, is to normalize the ItemIDs shown in blog listings.

You are correct that ItemIDs in Table - Content Category listings are different, and also that if you create an individual menu item for a content item then it receives yet another ItemID.

Using SEFAdvance helps to solve the problem because it needs to identify and use a single ItemID in order to function, and has an effective method of doing that, but there is no perfect solution to this. It is a problem which goes right to the core of the system and explains why a major overhall is in the pipeline (don't get too excited - it's a long pipeline - think trans-Siberian - although the devs are going at a cracking pace, so Vladivostok might just creap up on us like a fog in the Sea of Okhotsk before we know it!)

All you can do really is juggle blog listings and menu items around until things, whilst not perfect, make sense to your site visitors.

Remember, they will not have a clue about all this back-end stuff and will not notice the problems you agonize over, provided you are clever with your site architecture and menu structure. Look around the Joomla.org site and see if you notice the problems as an ordinary visitor. It all works fine, looks nice and makes sense, because it has been designed to play to Joomla!'s strengths (particularly with the menu setup and the use of blog items without read-more links). They don't try to force it to do stuff it is in reality unhappy with (yet appears designed to do). Though it is annoying to realize that, I know.

Just don't expect it to automatically and tidily do all the stuff it seems to be designed to do, and all will be well! By the time you have finished, the back end is going to be a bit of a jumble that only you understand (and then only after reading your notes), whatever happens. Joomla is fantastic and can do a lot - just not as neatly as you thought!

You can get the same effect as a Table - Content Category in a Category Blog by adjusting the parameters (though you will have to hack a little to remove the More... line), so why not replace those for starters. They will pick up the ItemID of the Table - Content Section.

Then either use parameters to remove the links to categories from the Table - Content Section listings (and rely only on your category blog menu links), or do a little hacking to make them into categoryblog links instead.
See http://forum.joomla.org/index.php/topic ... l#msg97461 for a little insight, though it doesn't solve this precise problem.

Don't forget about Static Content Items. Very useful for the pathway because it simply reflects their menu hierarchy.

For menu links to content items which are already shown in a section or category listing, use a manually typed URL menu item and copy the URL from the one in the listing. Delete everything before index.php eg. your URL might be
Code:
index.php?option=com_content&task=view&id=42&Itemid=174
Do not rely on Joomla! to make the link for you, or you will get yet another ItemID (which can actually be useful if you want to show the same item with different modules).

Of course, the problem with URL menu links is that you can forget active menu item highlighting. But then that feature and the pathway only ever work nicely for certain types of site, and it doesn't look like yours is going to be one of them...

Look forward to hearing how you get on. Don't give up. Be creative!  :)
And please do document anything useful you discover, especially about ItemID workarounds.


Last edited by kper on Fri Nov 04, 2005 3:33 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Nov 04, 2005 3:49 am 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Sun Aug 21, 2005 2:57 pm
Posts: 1369
Location: Colorado, USA
Thanks kper,
That's by far the most comprehensive explanation I've gotten so far.  I'd already spent a few hours working your other post and got some understand from that as well. 

I guess I just looked at those filter textboxes and sort pulldowns and said wow that's perfect.  It's just taken a while to accept what you're saying about not everything works quite the way it looks like it will.

I think it will be easiest for my needs to use menus as suggested by mcsmom on this other threadfor the things that they work well for, then write a custom component to do my filtering and sorting on content groups that are too big and unwieldy to apply menus to.

Thanks for all the help.

_________________
¡Pura Vida!
Ray,
joomla in testing at Costa Rica Travel: http://costaricamap.net
http://costa-rica-guide.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 



Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group