Sep 08, 2008, 11:07 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Donate to MODx: Donations
Pages: [1] 2 3 ... 5   Go Down
  Print  
Author Topic: My multi-content solution is ready to be tested... who wants to test?  (Read 22713 times)
0 Members and 1 Guest are viewing this topic.
madmage
Full Member
***
Posts: 150


« on: Dec 26, 2005, 07:23 AM »

A small demo you can find in http://www.mindreamz.net/modx091/ but I would like the MODx-gurus to look at my code to know if I used the right functions in the right places (going into the core code to find out which function to use is not a great thing, maybe sometimes I used a deprecated function or something like this)

The goal was to provide a multi-language-content site, in which the user can choose a preferred language and browse the site reading pages in that language if they are available, and been redirected to a "default language page" if not.

My solution is the following:
1) there is a $_SESSION variable that stores the preferred language choice of the user;
2) I modified the *_site_content table adding two fields:
 - contentLang, that stores something like "en", "it", "fr", ...
 - refId, the id of the page in the default language which this one is a translation
3) I added a snippet to show the language flags for the user choice
4) I added a plug-in that redirects to the right-language page
5) I modified the DropMenu to show only the chosen language entries
6) I modified the manager in these ways:
 - in the document tree, each page has next to it its current translations (you can click on them and go to the translation, without the need to have a different tree for each language and to have not every page translated)
 - while vieweing a document, you can also see in which language is the content and you have a button that duplicates the page to begin to translate it
 - in the settings page you have to write which languages your site is in and the default language

The only thing that is to be implemented is a plug-in that rebuilds the tree accordingly after the insertion of a new translation (it is needed and you can easily figure out why)

Now, then, how can I show my solution? I can give to someone the access to my manager, in order to see my modifies. Or... what else?
Logged
Djamoer
Testers
*
Posts: 1,492

No one can limit a man other than the man himself.


WWW
« Reply #1 on: Dec 26, 2005, 08:21 AM »

That's so cool. I saw it already, and it's nice!

Hope I can have the right to access the demo version of it, if you wouldn;t mind. FYI, I'm not a core developer for MODx and I'm not a PHP or programmer guru, hope it doesn't bother you.

Great job in implementing that, that looks awesome. Hope it can be implemented later as the core system, by the time all the core developer agree to that, and willing to make an aoverhaul backend for MODx.

Btw madmage, you know the backend already, so do you think its going to be hard in implementing sub site capability of MODx?

Sincerely,
Logged

madmage
Full Member
***
Posts: 150


« Reply #2 on: Dec 26, 2005, 02:54 PM »

Isn't it already implemented? I read a message in which someone develop a snippet to do this... Am I missing something?
Logged
Djamoer
Testers
*
Posts: 1,492

No one can limit a man other than the man himself.


WWW
« Reply #3 on: Dec 26, 2005, 03:35 PM »

yeah, it's being implemented, but it won't work the way you want it with alias path. Let's assume that you have a folders for subsites, and each folder will have its own alias, lets call it subsite1, subsite2, and etc. Then for each subsite will have this alias being appended as alias. So the address will look like this, http://www.domain.com/subsite1/home.htm.

I just want the ability to remove the subsite1 path for each domain, without the need to use it. Do you have any thought of this?

Thanks
Logged

davidm
Marketing & Design Team
*
Posts: 6,592


The best way to predict the future is to invent it


WWW
« Reply #4 on: Dec 26, 2005, 04:49 PM »

I very much like the underlying logic, if this can be made into a snippet we could have real multilingual content for MODx which would be yet another strong point for us Grin

Very nice, can't wait to have our coding team look into this and help you turn this into a proof of concept solution for multi-lingual content... thanks !
Logged

blog.nodeo.net : Pour un web libre, moderne et ouvert! :: | ! Nouveau ! Les forums modxcms.fr : Participez à l'élaboration du site MODx francophone ! ! Nouveau ! :.

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.45 - PHP 5.2.5 | Debian 4.0 (Etch)

Réalisations sous MODx : nodeo.net | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | sworld.com | soleil.info
 et 3 autres en cours de réalisation Smiley
madmage
Full Member
***
Posts: 150


« Reply #5 on: Dec 27, 2005, 06:55 AM »

mod_rewrite?

RewriteRule ^([^\/]*)\/(.*)$ http://www.yourwebsite.com/$2 [L]

or I haven't understood your problem?
Logged
madmage
Full Member
***
Posts: 150


« Reply #6 on: Dec 27, 2005, 06:56 AM »

I very much like the underlying logic, if this can be made into a snippet we could have real multilingual content for MODx which would be yet another strong point for us Grin

Very nice, can't wait to have our coding team look into this and help you turn this into a proof of concept solution for multi-lingual content... thanks !

I hope to succeed in having a contact with some core coder... it seems hard in these days... Smiley
Logged
madmage
Full Member
***
Posts: 150


« Reply #7 on: Dec 27, 2005, 06:59 AM »

mod_rewrite?

RewriteRule ^([^\/])*\/(.*)$ http://www.yourwebsite.com/$2 [L]

or I haven't understood your problem?

this is better (remember that it have to be in the modx installation root directory):

RewriteRule ^[^\/]*\/(.*)$ /$1 [L]
Logged
davidm
Marketing & Design Team
*
Posts: 6,592


The best way to predict the future is to invent it


WWW
« Reply #8 on: Dec 27, 2005, 07:21 AM »

I hope to succeed in having a contact with some core coder... it seems hard in these days... Smiley

Yeah well it's only normal given the holidays. I've no doubt they'll get in touch pretty soon, few ideas are lost around here, that's one of the strength of this community Smiley

Thanks for the login/pass for the demo : VERY NICE ! The way you integrated this into the backend is simply great and I wish to see it as one of the bundled plugin. Plus I wouldn't mind having this kind of marketing ammo Smiley Few CMS have this implemented, often it's a workaround or a hack to implement multilanguage.

Really impressive work !
« Last Edit: Dec 27, 2005, 07:34 AM by davidm » Logged

blog.nodeo.net : Pour un web libre, moderne et ouvert! :: | ! Nouveau ! Les forums modxcms.fr : Participez à l'élaboration du site MODx francophone ! ! Nouveau ! :.

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.45 - PHP 5.2.5 | Debian 4.0 (Etch)

Réalisations sous MODx : nodeo.net | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | sworld.com | soleil.info
 et 3 autres en cours de réalisation Smiley
xwisdom
Foundation
*
Posts: 1,732



« Reply #9 on: Dec 27, 2005, 07:57 AM »

I hope to succeed in having a contact with some core coder... it seems hard in these days... Smiley

Well it's the holiday season so you know...

Very nice work on the multi-language content implementation Smiley

We will certainly look into what you have done and see how it can be added to the new core.

PS. where possible it 's best to use plugins to handle your changes. There are events that you can use to overwrite most of the core.

Many thanks and happy holidays!

 
Logged

xWisdom
www.xwisdomhtml.com
The fear of the Lord is the beginning of wisdom:
MODx Co-Founder - Create and do more with less.
madmage
Full Member
***
Posts: 150


« Reply #10 on: Dec 27, 2005, 09:36 AM »

Well it's the holiday season so you know...

Yeah, I know... Just joking... ;-)

Quote
Very nice work on the multi-language content implementation Smiley

We will certainly look into what you have done and see how it can be added to the new core.

PS. where possible it 's best to use plugins to handle your changes. There are events that you can use to overwrite most of the core.

This is the reason for my looking for core coders... and questions about plug-in events

Quote
Many thanks and happy holidays!

Yeah, to you too...
Logged
rthrash
Foundation
*
Posts: 9,106



WWW
« Reply #11 on: Dec 27, 2005, 10:34 AM »

I've poked through it a bit and created a test page in the repository. Looks like a really great start!

The biggest thing that immediately popped out was how it handles the menus... that's going to take some thought... but regardless, quite impressive. Do you have a full changelog/modification procedure that you went through in order to get this implmented?
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
Djamoer
Testers
*
Posts: 1,492

No one can limit a man other than the man himself.


WWW
« Reply #12 on: Dec 27, 2005, 12:55 PM »

It's great to have someone who able to contribute something on the core code.

Hope this can be the start of MODx to support multi lingual content by default. Hopefully this can be added into the new release or provided as a patch to the current release.

Thanks for the reat work you've done there, especially by hacking into the core code, but still keeping it in minimum changes, and make it integrated with MODx manager so well.

Sincerely,
Logged

madmage
Full Member
***
Posts: 150


« Reply #13 on: Dec 27, 2005, 02:46 PM »

I've poked through it a bit and created a test page in the repository. Looks like a really great start!

The biggest thing that immediately popped out was how it handles the menus... that's going to take some thought...

what do you mean for "menus"? which menus?

Quote
but regardless, quite impressive. Do you have a full changelog/modification procedure that you went through in order to get this implmented?

Yes, of course! :-D

2 field to be added to site_content table
1 snippet to be added
1 plug-in to be added
1 snippet to be modified (DropMenu)
about 80 lines to be added in four manager php files

it's all tagged in my code, so I can easily find them

I have still to implement the tree rebuild plug-in (necessary when adding or deleting a translation that has children); and use $_lang[] for messages/captions in manager

for the first topic: which plug-in event do I have to use (OnDocFormSave and OnDocFormDelete are the right choices? can I access the $modx->documentObject['id'] in those events?)

for the second: do I have to put translations my caption/messages in manager/includes/lang ? at the end?

note: ah, well, there is an error in the italian.php.inc file, line 730: salvataggiog. -> salvataggio. (without the last "g")... and some other translation errors... who do I have to contact?
« Last Edit: Dec 27, 2005, 03:11 PM by madmage » Logged
davidm
Marketing & Design Team
*
Posts: 6,592


The best way to predict the future is to invent it


WWW
« Reply #14 on: Jan 03, 2006, 07:02 AM »

what do you mean for "menus"? which menus?

I think Ryan was talking about the menu tree, and you already are working on it, it seems :

I have still to implement the tree rebuild plug-in (necessary when adding or deleting a translation that has children); and use $_lang[] for messages/captions in manager

Anyway, like wendy I must say this is a much expected feature that we will all be glad to have Grin
Logged

blog.nodeo.net : Pour un web libre, moderne et ouvert! :: | ! Nouveau ! Les forums modxcms.fr : Participez à l'élaboration du site MODx francophone ! ! Nouveau ! :.

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.45 - PHP 5.2.5 | Debian 4.0 (Etch)

Réalisations sous MODx : nodeo.net | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | sworld.com | soleil.info
 et 3 autres en cours de réalisation Smiley
Pages: [1] 2 3 ... 5   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!