MleCMS module for 2.0

General project discussion. NOT for help questions.
Locked
User avatar
Eric Pesser
Forum Members
Forum Members
Posts: 27
Joined: Mon Oct 13, 2008 8:59 am
Location: Stavelot / Belgium

MleCMS module for 2.0

Post by Eric Pesser »

Hi Guys,

I'm looking to CMSMS 2.0 upgrades and for that, I need MleCMS as most of my sites are Mle.

This modules doesn't seem to be 2.0 compatible, and some friends of me told me they can't contact the author anymore.

It's just impossible for me to change the implementation or the module name. It must work on 2.0.

So... Who's volunteer to help for compatibility? (not for adding features at this moment)

In a few weeks I'll begin the compatibility work so if interested, please let me know.

Eric
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: MleCMS module for 2.0

Post by Rolf »

Module has had a SVN commit three/four months ago...
http://viewsvn.cmsmadesimple.org/log.ph ... 2F&isdir=1&
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
Eric Pesser
Forum Members
Forum Members
Posts: 27
Joined: Mon Oct 13, 2008 8:59 am
Location: Stavelot / Belgium

Re: MleCMS module for 2.0

Post by Eric Pesser »

Hi Rolf, this means "not active" for 4 month ;).

Seems not more reachable, but me and many other guys needs MleCMS to be working before migrating on 2.0...
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: MleCMS module for 2.0

Post by calguy1000 »

FYI: It' s still not strictly necessary to replace ContentManager for MLE purposes.

Converting the MLECms Module (forking it to a different name, and getting rid of the cruft), and making it work in 2.0 should not be more than a few hours work for an experienced programmer.

Making it 'drop in' compatible may be tricky, but shouldn't take that long.

If you wanted to go with a new module, I would just create one that introduced one or more new content types, but worked within ContentManager. Just like FEU does with it's 'protected page' stuff.

And it's even possible to do a simple, single-page, multi-lang solution without the need for a third party module.

#justsaying
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Eric Pesser
Forum Members
Forum Members
Posts: 27
Joined: Mon Oct 13, 2008 8:59 am
Location: Stavelot / Belgium

Re: MleCMS module for 2.0

Post by Eric Pesser »

Hi Calguy,

So you suggest to do it with a content type. But I think we'll need one more content metadata : content language.

I don't want to duplicate ContentManager only to get this field added. If so, we have to duplicate all modules to make them MLE and not MLE. I really can't imagine this.

My main idea is to have 1 content/blob/news... id. And the locale as second id of a compound key. Then you can easily switch between languages on the same content, but in another language (if defined).
And so you can customize all metadata, url, and so on.

My Real Estate module works like this.

Maybe I'm dreamin'.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: MleCMS module for 2.0

Post by calguy1000 »

With CMSMS content types you can have as many 'properties' as you want.. or you can store stuff in different tables in your module, if you want. so that isn't an issue.

Modules on the other hand are a completely separate issue. They each maintain their own database tables, indexes, queries, and classes. if you want a truly multi-language News module, Blog, ListIt, Products module, etc, etc, etc. then you will need to fork each and every one of these.

The advantage of wordpress is that it stores ALL of it's content (page, blog articles, products, whatever) in the same content tables. Essentially, everything is a blog article (cuz that's how wordpress started). This makes it relatively easy to make a multi-language version of 'any' plugin.

This is also it's biggest disadvantage as it makes it difficult to specialize the database for a particular data type and do efficient querying. Hence the almost absolute requirement to use cache plugins etc. Also, the effected tables tend to get absolutely huge in any site where content is updated regularly which also effects performance.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: MleCMS module for 2.0

Post by calguy1000 »

Here's a sample page template that provides for multi-language in one content page. It uses a couple of UDT's to manipulate the URL to add the language stuff, and uses a ?lang= GET variable to determine the language.

This page template does not handle multi-language menus, (would be simple enough with a new Navigator/MenuManager template). but it does have extra content blocks that are not translatable... either for code, or for text.

If you had a multi-lang content type then you could override the various methods for the title/description, etc. to change them for different languages, etc. and override the show() method to return different content depending upon the language... How you store the data is entirely up to you, but I would just use prefixed or suffixed content properties. like 'fr::blockname' or something like that.

Also keep in mind that there can only be one default content block. which is currently hardcoded to 'content_en'. (don't think about the _en standing for english, it may have been, or it may not have been). And sometimes you don't want to have different content blocks for different languages. i.e: if the content block is a dropdown, or a boolean choice, or is going to store code instead of content.

Code: Select all

{strip}
{process_pagedata}
{cgjs_require jsurl="https://code.jquery.com/jquery-1.11.3.min.js"}
{cgjs_require jsurl="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"}
{cgjs_require jsurl="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"}
{cgjs_require cssurl="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"}
{$sel_lang='en'}{* default language *}
{if isset($smarty.get.lang)}
  {* language we want is in the URL *}
  {$sel_lang=$smarty.get.lang}
{/if}
{$sel_lang=$sel_lang scope=global}{* so that sel_lang will be available in all new templates *}
{* set the locale and cmsms language so that lang strings will be translated *}
{cms_set_language lang=$sel_lang}
{* our different language content blocks... note that the default content block is assigned to 'content_out' *}
{content block='English' assign='content_en' tab='English'}
{content block='French' assign='content_fr' tab='French'}
{content assign='content_out' tab='Default'}{* default content block *}
{* here we pick what content to display *}
{if empty(trim(strip_tags($content_out)))}
   {if $sel_lang == 'fr'}
      {$content_out=$content_fr}
   {else}
      {$content_out=$content_en}
   {/if}
{/if}
{/strip}<!DOCTYPE html>
<__html lang="{$sel_lang}">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {CGSmartImage action=responsive}
   {*
    {JQueryTools action=require lib='ui,fancybox'}
    {JQueryTools action=placemarker}
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
    <__script__ src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></__script>
    *}
    {* cghm_render *}
    {metadata}
    {cms_stylesheet}
    {cgjs_render no_js=1}
    {cms_selflink dir="start" rellink=1}
    {cms_selflink dir="prev" rellink=1}
    {cms_selflink dir="next" rellink=1}
    {get_current_url assign='my_url'}
    {if $sel_lang == 'en'}
      <link rel="alternate" hreflang="fr" href="{langify_url lang=fr in=$my_url}" />
    {else}
      <link rel="alternate" hreflang="en" href="{langify_url lang=en in=$my_url}" />
    {/if}
  </head>
  </__body>{strip}{content block='hints' tab='Advanced' wysiwyg='false' label='Use this block for cge_module_hint calls'}
{nocache}{content block='about' tab='About' label='About this page' assign='about_page'}{/nocache}
  <div id="page_wrap" class="container-fluid">
    {* navigation *}
    <nav class='navbar navbar-inverse' role='navigation'>
      <div class='navbar-inner nav-collapse' style="height: auto;">
        {$horizontal_nav=1}
        {menu template='bootstrap // bootstrap2' number_of_levels=1 loadprops=0}
        {$horizontal_nav=0}
        <div class="navbar-form pull-right">
          {Search}
        </div>
      </div>
    </nav>
 
    <div class="row">
      <div class="col-md-3">
        <div class="well">
           <ul>
             {cms_selflink href=$page_alias assign=this_url}
             <li><a href="{$this_url}?lang=en">English</a></li>           
             <li><a href="{langify_url url=$this_url lang=fr}">French</a></li>
           </ul>
        </div>
        {menu template="bootstrap // bootstrap2" assign="tmp" start_level=2}
        {if $tmp != ''}<div class="well">{$tmp}</div>{/if}
 
        {News number=3 assign='tmp'}
        {$tmp2=$tmp|strip_tags}
        {if $tmp2 != ''}
        <div class="well">{$tmp}</div>
        {/if}
      </div>
 
      <div class="col-md-9">
        <header>
          <div class="row">
            <div class="span10"><h1>{title}</h1></div>
            {nocache}{if $about_page != ''}
            <div class="span2 text-right">
              <img src="{uploads_url}/help.png" id="about_page" alt="About this page" title="About this page"/>
            </div>
            {/if}{/nocache}
          </div>
        </header>
            <h4>sel_lang is {$sel_lang}</h4>
            {cgsi_convert}{$content_out}{/cgsi_convert}
      </div>
    </div>
 
    <footer>
      <p class="pull-right"><a href="#top">Back to top</a></p>
      <p>© Copyright {$smarty.now|date_format:'%Y'} <a href='{root_url}' title='{sitename}'>{sitename}</a></p>
    </footer>
 
{* container *}
{nocache}{if $about_page != ''}
{cgjs_add}
$(document).ready(function(){
  $('.dropdown-toggle').dropdown();
  $('#about_page').live('click',function(){
    $('#about_this_page').dialog();
  });
});
{/cgjs_add}
 
  </div>
  <div title="About this page" id="about_this_page" style="display: none;">{$about_page nocache}</div>
  {/strip}
{/if}{/nocache}
 
{cgjs_render no_css=1}
<__body>
</__html>
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Eric Pesser
Forum Members
Forum Members
Posts: 27
Joined: Mon Oct 13, 2008 8:59 am
Location: Stavelot / Belgium

Re: MleCMS module for 2.0

Post by Eric Pesser »

Thanks, I'll look at all these information.
Locked

Return to “General Discussion”