010 - Create a Joomla! 1.5 module listing all of the items in a given category

Google's Highly Open Participation Program tries to get young students into Open Source and Joomla! specifically. Everyone is welcome, there are not limits. You can be a coder, documenter, tester, translator to help out. Jump in and start helping!
User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by fealebenpae » Sun Dec 09, 2007 1:30 pm

Weeeeell, my first implementation was using unordered lists, but the code output was not to my liking. I tried that again, but the result was again unsatisfactory. As a compromise, I modified the category spans to be list items, and left the section spans as they are, in order to escape the double indentation my previous implementation wielded. Please let me know if I should commit these changes to the package.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by AmyStephen » Sun Dec 09, 2007 3:15 pm

I think unordered lists since that builds consistency with menu items, etc.

Thanks!
Amy :)

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by fealebenpae » Sun Dec 09, 2007 5:42 pm

I'm attaching screenshots of the different setups I'm trying.
  • section names are s and category names are s
  • both section and category names are s
  • both section and category names are s (the whole is colored green, the section names are white and the category names are yellow)
I've tested this in both Firefox and Safari.
Here is the HTML code:

Code: Select all

<div class="ghop-categories">
<ul style="border: 1px black solid; background: green;">
<li style="background: white; border: 1px black dotted;">About Joomla!</li><ul>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=25&Itemid=37&layout=blog">The Project</a></li>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=29&Itemid=37&layout=blog">The CMS</a></li>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=30&Itemid=37&layout=blog">The Community</a></li>
</ul>	
<li style="background: white; border: 1px black dotted;">News</li><ul>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=1&Itemid=50&layout=blog">Latest</a></li>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=3&layout=blog">Newsflash</a></li>
</ul>	
<li style="background: white; border: 1px black dotted;">FAQs</li><ul>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=31&Itemid=46&layout=blog">General</a></li>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=28&Itemid=44&layout=blog">Current Users</a></li>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=27&Itemid=44&layout=blog">New to Joomla!</a></li>
<li style="background: yellow;"><a href="/joomla/index.php?option=com_content&view=category&id=32&Itemid=47&layout=blog">Languages</a></li>
</ul>	
</ul>
</div>
The style attributes are just a quick hack. If anyone can help me align the items properly, I'd greatly appreciate it.

EDIT: I'm also attaching the module's tmpl/default.php in case I erred there. This is getting vexing.
You do not have the required permissions to view the files attached to this post.
Last edited by fealebenpae on Sun Dec 09, 2007 6:38 pm, edited 1 time in total.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by fealebenpae » Tue Dec 11, 2007 10:47 pm

I've hit another problem here, a much more severe one.

I use the following code to generate the URL:

Code: Select all

$content_route = ContentHelperRoute::getCategoryRoute($cat_row->id, $sec_row->id);
if($params->get('layout')=='table') $lists[$i]->category[$n]->link = JRoute::_(str_replace('&layout=blog','',$content_route));
else {
if(stristr($content_route, '&layout=blog')) $lists[$i]->category[$n]->link = JROUTE::_($content_route);
else $lists[$i]->category[$n]->link = JROUTE::_($content_route.'&layout=blog');
}
This works ok for normal URLs, but if I enable SEF... Blog and Table layouts no longer work. At all. It should work - I'm passing everything through JRoute. Should I leave it as it is and wait for a fix in the SEF code or what? I looked through the API and the source code of the latest SVN, but it availed me nothing.

I hope someone can provide a hint. Thanks.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by AmyStephen » Tue Dec 11, 2007 10:56 pm

Make certain you have an up-to-date J! v 1.5 - nightlies can be downloaded from the Developer link, above - look for download.

This weekend, there were LOTS of fixes to URLs.

HTH,
Amy :)

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by fealebenpae » Tue Dec 11, 2007 11:05 pm

Thanks for the quick response, Amy.

I'm sorry to say that I just tested this on the latest SVN (circa ~5 minutes ago :D ) and the result is the same. Joomla 1.0 preserves such options in its SEF URLs (for instance - /layout,blog/) while J! 1.5 seems not to. I think I'll just leave it as it is and go back to the lists thing.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by ianmac » Tue Dec 11, 2007 11:50 pm

Okay...  this is a bug.

Posted on:
http://forum.joomla.org/index.php/topic,242558.0.html

As a workaround you could do a replace to switch the & for a ?, but this should be fixed hopefully soon, so shouldn't be needed.

Ian

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by fealebenpae » Wed Dec 12, 2007 2:15 am

Thanks, Ian.

While that worked for the blog layout, content that is linked to via the menu and is set to be displayed in a blog layout (e.g. the news categories in the example content) won't display in a table layout, even after I've attached ?layout=default. I even remove the layout=blog part from the content route before it is passed to JRoute. I'll look into the issue in a few days. But then again I want to leave it as it is in the hopes that it will work once the URL issues are resolved, be done with the lists thing and this time really submit the module for a final review as I hope to be able to work on another task after I've completed this one to the community's and mine satisfaction.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by ianmac » Wed Dec 12, 2007 3:40 am

Hey!

There are a couple of things here that we need to work out on our end to get this all straightened out.  You, on your part, have done an excellent job and we commend you on your efforts.

If you can submit your completed code that you have at this point, with the second option - the ul and ul without the green and yellow styling (this styling is done in the template CSS), then we will sign off on the great work you have done and mark you as complete here and on google.

Ian

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by ianmac » Wed Dec 12, 2007 3:45 am

oh and one more thing:
If you can add Helper onto the end of your helper class name that would be fantastic so we can keep it consistent with the rest of the modules.

Ian

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by fealebenpae » Wed Dec 12, 2007 5:39 pm

All done, folks.

I tested this on a vanilla svn install and it worked marvelously, even the lists thing, save for the sef thing, of course. I wouldn't have been able to do this without the support and feedback from this wonderful community, so thanks to everyone who helped :)

I uploaded the final version to joomlacode.
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by AmyStephen » Wed Dec 12, 2007 5:45 pm

Thanks very much for your excellent work ethic, sharing your intelligence and interacting so nicely with the community. I closed the Google task and will mark this thread as solved. You are free to select another task, if you want. I hope you do! There are some very cool development tasks available.

Again, thank you for your contributions to the Joomla! community and for participating in the GHOP contest. You've been a pleasure to work with,

Amy :)

User avatar
fealebenpae
Joomla! Intern
Joomla! Intern
Posts: 54
Joined: Fri Nov 30, 2007 8:33 pm
Location: Vidin, Bulgaria

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by fealebenpae » Wed Dec 12, 2007 5:59 pm

On the contrary, the pleasure is all mine :-D

Now, I be moving on to the pirate speak task, arr me timbers!  :laugh:
And it came to pass that in that time the Great God Om spake unto Brutha, the Chosen One: "Psst!"

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by ianmac » Wed Dec 12, 2007 7:42 pm

Hey!

Can you just make sure you submit your final code to google as well?

Thanks,
Ian

AmyStephen
Joomla! Champion
Joomla! Champion
Posts: 7018
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: 010 - Create a Joomla! 1.5 module listing all of the items in a given catego

Post by AmyStephen » Wed Dec 12, 2007 7:44 pm

Yes, he already did so before I closed the Google task. Now, he's on to Pirate talk - oh wait - he decided to implement the entire Text Filter Suite for Wordpress.  8)

We are good, thanks, Ian.

Amy :)


Locked

Return to “Google's Highly Open Participation Contest”