joejac
Posts: 242
|
| Posted: 03/06/2009, 1:41 PM |
|
Hello,
I need to make a tree from a categories db table for a menu in the left side of the page.
If I click on a particular category I need to display the list of articles under the category, on the upper right side of the page. If I click on the name of each article, I need to display the record form for that article to modify it, under the bottom right side of same page.
So I would have 3 data areas in same page: The category tree, the article list and the maintenance forms, all in same page.
I am trying to see which would be the best designing approach:
1.- Header with the categories on the left and 2 iframes for top right and bottom right respectively? or
2.- to use Ajax to send "GET" or "POST" requests asynchronously to update the respective forms?
I appreciate a lot your advice and if possible links with documentation/tutorials in order to study/learn what you recommend is the best approach.
I use CCS4, PHP5, MySQL
Thanks a lot for you ideas and help
Best regards
joejac
|
 |
 |
damian
Posts: 838
|
| Posted: 03/06/2009, 7:27 PM |
|
another way would be to use panels and show/hide them pased on url parameters....
http://forums.yessoftware.com/posts.php?post_id=89009&s_keyword=panel
basically your tree links would go something like:
category link: page.php?cat=somecat
article link: page.php?cat=somecat&art=somearticle or page.php?art=somearticle
also your links would have preserve parameters none (or possibly preserve cat)
your page.php would look like:
menu tree on left
panel on right called catPanel containing category grid
panel on right called artPanel containing article grid
then in page before show you would add some custom code like this....
// Show catPanel only if page.php?cat=xxxx is true.
global $catvalue;
if (CCGetParam("cat", $catvalue) != '') {
$catPanel->Visible = true;
}
else {
$catPanel->Visible = false;
}
// Show artPanel only if page.php?art=xxxx is true.
global $catvalue;
if (CCGetParam("art", $artvalue) != '') {
$artPanel->Visible = true;
}
else {
$artPanel->Visible = false;
}
thats how i would do it anyway....
you can build your whole website and only have one "page" and you can show hid panels and include pages as required.
regards
damian
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
joejac
Posts: 242
|
| Posted: 03/06/2009, 8:30 PM |
|
Thanks a lot for Damian, for your detailed information, very interesting and useful.
I did not know it can be done showing/hiding panels.
But in this particular case I think it is necessary to show the 3 areas at the same time permanently, so I still wonder:
Which would be the best approach: iFrames or AJAX?
Best regards
joejac
|
 |
 |
damian
Posts: 838
|
| Posted: 03/06/2009, 11:11 PM |
|
you can still do that the way i have suggested. the limitation being the whole page is reloaded when you click a link - the advantage being that a search engine can crawl all links and accurately record the urls.
is it a public website? do you want search engines to crawl your site? if so iframes are definitely not the way to go. iframes are simple to use and are relatively quick as you only refresh the section that you change. in fact if you are looking at iframes for this why not just frames if that is the direction you choose.
im not sure how you could change the article from view to edit using ajax - maybe using tabs?
that will speed up page views etc but i think that you will again impair search engine links...? but taht could be my lack of ajax knowlege....
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
datadoit
|
| Posted: 03/07/2009, 6:03 AM |
|
I like how IBM does it:
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp
[Built using Eclipse tools - interesting. Probably could've saved a ton
of money using CCS! :) ]
Very clean and simple to understand. We've implemented a similar
technique in our internal help system, utilizing CCT's tree menu.
We use the old frameset model, rather than iframes, along with includes
here and there based on content and parameters.
AJAX would not totally be necessary in this scenario. It'd be nice if
you're not looking for a lot of screen redraws (sending parameters to
the parent window). However, you need not decide between iframes -or-
AJAX - use both!
|
|
|
 |
joejac
Posts: 242
|
| Posted: 03/07/2009, 8:05 AM |
|
Thanks a lot Damian and Datadoit, is very good to have the help from the pros.
I do not need the page to be indexed by the search engines because it is private. I like the idea of iframes because I need simplicity and easy to use. I am not sure of using the old frameset model, although IBM flagrant use it
Doing a deep search in these forums I found an interesting topic about a jQuery technique to replace iFrames described by Melvyn here: http://forums.yessoftware.com/posts.php?post_id=101946&s_keyword=iframe
I will study it and try it to see if it works with 2 iFrames replacement, and also if it allows to refresh content in a "cascading" way, I mean: categories to > article list to > article insert/update/delete.
Then if I need it, I will add AJAX. I want to avoid learning complicated things unless it is absolutely necessary.
Any additional ideas are very welcome.
Best regards
joejac
|
 |
 |
|