Welcome, Guest. Please login or register.
Did you miss your activation email?
Feb. 09, 2010, 01:40:55 AM
52582 Posts in 11676 Topics by 7483 Members
Latest Member: RomPhi915
News: Class documentation is handy to learn about component properties, events and methods.
 
The PRADO Community » Prado v3.x » Component Repository » Csitemap « previous next »
Pages: [1] Print
Author Topic: Csitemap  (Read 4847 times)
tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 83
Offline Offline

Posts: 1026



View Profile
« on: Jul. 10, 2007, 03:21:46 PM »

Hello everybody,

I've just committed to the component repository my first version of "CSitemap"

Well, what's this ? Smiley
Well, it's a set of modules and controls that permit to navigate easily in your site with a sitemap.xml files.
At the beginning, I just wanted a Bread Crumb component, as requested by p_e_t_e_r here
But, when I was writing this component, I saw other usages for sitemap.xml, and that's why I wrote this.

What is included in this release :
Quote from: README FILE
CSitemap is a set of Prado component to use the power of sitemap.xml files.

Main module : CSitemapManager
=============================
This module must be added to the global module section of you application.xml in order all provided component to work.
This module is responsible to parse the xml file, and make it available to other components.

Url Manager : CSitemapUrlManager
================================
This module is an extension of TUrlManager, providing short url using sitemap file. See doc in CSitemapUrlManager.php files for more info.


Web Control : CSitemapPath
==========================
This control can be placed anywhere in you template. It will display the current path of the requested page.


WebControl : CSitemapDropdownMenu
=================================
This control is an extension of the excellent LCssDropDownMenu written by schmunk
It displays a navigation drop down menu, based on information in the sitemap file.
You need the schmunk component somewhere in your application. It's not included here, except for the demo


See the demo folder as as example on how to use these components.
It's the blog tutorial demo, with a dropdown menu for navigation, and the bread crumb on top of the page.

Still differents things to implement (see TODO file), but it's working.

I'd love to read your comments, criticism (constructive Wink) about this.

Have fun.

Cheers,

Tof.

PS: Attached is a ZIP of the current version, for those who don't have svn...

Logged
p_e_t_e_r
Junior Member
**

Karma: 0
Offline Offline

Posts: 6


View Profile
« Reply #1 on: Jul. 10, 2007, 06:49:26 PM »

wow, great, cant wait to try it out !

greets Smiley
Logged
aztech
Platinum Member
****

Karma: 34
Offline Offline

Posts: 694



View Profile WWW
« Reply #2 on: Jul. 11, 2007, 08:12:19 AM »

How can I support urls with params? I mean I've forum, some subforums in it and there some topic. My CSiteMap for each topic should look like:
Forum -> SubForum -> MyTopic.
What I must to write in sitemap.xml?
update
I found in code as todo: "TODO: Make a CSitemapRegexpNode class, to handle regular expression in url and get parameters"
Anyway carma++ for that great component
P.S. When do you want to add this Regexp functionality?
« Last Edit: Jul. 11, 2007, 08:17:22 AM by aztech » Logged

tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 83
Offline Offline

Posts: 1026



View Profile
« Reply #3 on: Jul. 11, 2007, 08:41:37 AM »

Hi aztech,

Hmmm... For now, you can only have "static" navigation. I don't see how we can make this dynamic, as we don't know how many child board you can have.

What you can do, is in onInit of your forum page, add dynamic CSitemapPathNode to the Controls[] of CSitemapPath :

Template :
Code:
<com:CSitemapPath id="breadcrumb"/>

Class:
Code:
<?php
public function onInit ($param)
{
    
/* Repeat this for each subnodes */
    
$this->breadcrumb->getControls()->add(prado::createComponent('CSitemapPathNodeSeparator'));
    
$dynamicNode=prado::createComponent('CSitemapPathNode');
    
$dynamicNode->setTitle ("TheTitleYouComputeFromYourParameters");
    
$dynamicNode->setUrl($this->Service->constructUrl(....);
    
$this->breadcrumb->getControls()->add($dynamicNode)
}
?>


Your sitemap.xml will contains only the main board of your forum.

In the future, perhaps we can override the CSitemapManager Module, to allow creating dynamic nodes from a database, instead of a static xml file...
Logged
aztech
Platinum Member
****

Karma: 34
Offline Offline

Posts: 694



View Profile WWW
« Reply #4 on: Jul. 11, 2007, 09:00:10 AM »

This is good idea. I'll check it and I'll tell you how it works. Thanks for quick answer.
Logged

aztech
Platinum Member
****

Karma: 34
Offline Offline

Posts: 694



View Profile WWW
« Reply #5 on: Jan. 21, 2008, 01:44:23 AM »

What about this TODO: Make a CSitemapRegexpNode class, to handle regular expression in url and get parameters?
Do you have plans to extend this component?
Logged

tof06
PRADO v3.x Developer
Platinum Member
*****

Karma: 83
Offline Offline

Posts: 1026



View Profile
« Reply #6 on: Jan. 21, 2008, 06:14:52 PM »

Hi Aztech,

Sorry, but I didn't have time to update this component for now...
I'll try to think about it... I will need this functionality soon.
So, stay tuned... And if you want to help me, please do ! Smiley
 
Logged
aztech
Platinum Member
****

Karma: 34
Offline Offline

Posts: 694



View Profile WWW
« Reply #7 on: Jan. 21, 2008, 06:54:15 PM »

I'm still using this "dynamic" solution which you suggested, but it is more and more heavy in my application Sad and with every added page is harder to manage.
Logged

tiro
Newbie
*

Karma: 0
Offline Offline

Posts: 4


View Profile
« Reply #8 on: May. 07, 2008, 03:12:14 PM »

Please help.
How should I do to use two menu?

Thank you.
Logged

I am not good at English.
boydzethuong
Junior Member
**

Karma: 0
Offline Offline

Posts: 11


View Profile
« Reply #9 on: Dec. 01, 2009, 07:33:11 AM »

tof06: Thank you so much for this component. I am still waiting for CSitemapRegExpNode from you or someone else...
Logged
Pages: [1] Print 
« previous next »
Jump to: