Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paris Bogdan 4 posts 20 karma points
    Jul 02, 2009 @ 15:47
    Paris Bogdan
    0

    how to implement a new render control (through .net external dll) but passing only the alias of control

    Hi,

    I would like to implement a big localization extension to the umbraco cms for my company.

    I am using DataTypes to define the controls that will edit the content in multiple languages but since i am storeing data in other tables, i need a way to find out based on the control's alias, where i can take the data, which document/template it belongs to at runtime and what values to get from cmsPropertyData.

    Example to explain my problem:

    I have 2 contents, default.aspx(NodeId = 1048) and ceva.aspx(NodeId=1054). Each of the has the DocType named "MasterDocType" (node ID = 1045).

    Now, in cmsContent table, i see there are 2 lines:

    pk    nodeId    contentType
    1    1048    1045
    2    1054    1045

     

    So far so good.

    But, now comes the problem:

    For my display control, i pass the "field" (aka Alias) of the property. Now, this alias points to cmsPropertyType. Through the alias, i am able to determine the cmsPropertyType. But now comes the real problem

    I need to be able to determine where my control is rendered (if rendered on default.aspx, i will have a different version of data (cmsPropertyData) then when rendered in ceva.aspx (cmsPropertyData).

    Both contents have separate versioning and data in them so i need to be able to determine how to get the proper data from cmsPropertyData. I don't know how this is possible at the moment. i tried digging the umbraco source code but to no luck.

     

    If anyone can help, i would really appreciate it.

  • Nico Lubbers 151 posts 175 karma points
    Jul 03, 2009 @ 00:21
    Nico Lubbers
    0

    Hi Paris,

    Can you explain a bit more why you want to extend umbraco? Umbraco has multilanguage / multisite possibilities so I think that the solution you are trying to find is already possible in umbraco without extending, but ofcourse I do not know what exacly you are missing in umbraco...

    Multilanguage sites are possible with two different approaches:

    1) one to one multilanguage website: can be used if the website of language X is exacly the same as language Y, (only in different language)
    http://umbraco.org/documentation/books/multilingual-11-sites

    2) Two (or more) diffenent root-nodes, each holding the content for a different language

     

    Nico

  • Paris Bogdan 4 posts 20 karma points
    Jul 03, 2009 @ 12:28
    Paris Bogdan
    0

    Hi Nico,

    First of all, at the moment the only possibility I found to create multi-lingual content is to duplicate all controls for each language. Be it via method 1) or 2), it gets to the same thing: multiplied content.

    The 2nd solution is what is implemented right now in our company. But it is very hard to maintain as we support a lot of languages. Thus if we make one tiny modification on a site, we have to replicate it in a lot of different mini-sites/alternate language sites. All in all, it's not practical.

    What I am trying to accomplish here is to make 1 content design (documentType)+1 Template for each aspx page. And then via a cookie/query string name to determine the correct language and display the text in that language.

     

    To achieve this, I need to do the following:

    a) Build custom data types for all th commonly used controls: TextString, SimpleEditor, Links, Images, Flash Objects etc. - These controls will be used in the Umbraco admin interface to edit the content itself. This is th easy part.

    b) Build a custom Render control that will render the content from TextString, SimpleEditor, Links, Images etc using the correct culture (getting it via a cookie or querystring).

    Both a) and b) cannot be achieved with the current Umbraco architecture as far as I am aware.

     

    Thanks,

    Bogdan

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 03, 2009 @ 12:45
    Dirk De Grave
    0

    Hi Paris,

    It's still unclear what you're trying to do here... why do you need to duplicate 'controls' for each language?

     

    Do you have a more detailed example, some screenshots maybe so we're sure we're talking the same thing?

     

    Cheers,

  • Paris Bogdan 4 posts 20 karma points
    Jul 03, 2009 @ 13:05
    Paris Bogdan
    0

    Hi Dirk (I hope this is your name, mine is Bogdan not Paris (which is my Family Name)),

     

    if you look at http://umbraco.org/documentation/books/multilingual-11-sites/2)-add-language-tabs-to-document-types , this clearly illustrates that you create a "tab" for each language and then replicate all controls in the primary tab. Then through some more or less complicated xslt/macro processing, the appropriate tab is chosen and rendered.

    Now, we do not want this. At this moment we are supporting a little over 10 languages. We are supporting them via method 2 that Nico suggested, which is having a mini-site for each language. So far they wanted different design/content for each language for various reasons, but now it has gotten very complicated to update the content on multiple sites. So they now want a solution where they have 1 document type/template per page. You could say that this can be done via method 1) which i also linked but since we are supporting so many language, and the site is quite big, this would imply a lot of work. and it would make the interface clumsy and not so user friendly to the guys who actually edit the content.

    So, ask me, what i am trying to do: well, i am trying a design that looks like this:

    Example for TextString

    The design is composed of:

    - A radiobuttonList which contains all the UmbracoLanguages.

    - A textbox for editing various texts

    - Multiple hiddenFields for storing data of languages.

    Clicking on one of the languages will display in the textbox the current text in the current language and save the text you just edited in the appropriate hidden control.

    When saving, the data is saved in an xml structure that we built specifically for multi language resources.

     

    The editing of the content data is the easy and already implemented part. I got the hang of it so I know how/what to do. But the problem arrises when displaying data. I have chosen the solution to build a custom control in .Net for displaying the data from various controls i build. To ease the transition from the old Templates to the new ones, i chose something like: <bullguard:Item field="aliasOfControl" runat="server" /> . Now you would probably recognize the pattern as it's the same as <umbraco:Item>. So far so good. But on the control side (bullguard:Item), i need to be able to get the appropriate texts from the table cmsPropertyData (where it is stored) by using solely the ALIAS od the control. The problem I am facing is that I can determine the cmsPropertyType entry but further down the road until cmsDocument and then cmsPropertyData is a long way due to versioning and stuff (which I still want to be able to support).

    So how can i get the cmsPropertyData of a control using only the alias. If you could point me to some API or some DB calls i can use to determine which is the latest version of the .aspx file I am in and where the control resides, i would be happy happy happy.

     

    Thanks,

    Bogdan

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Jul 03, 2009 @ 15:03
    Jesper Ordrup
    0

    Hi Bogdan,

    Just to claify your setup: Will the 10 sites have the exact same content, sitestructure and all?

    Some clients think that the sites will be the same and asks for this. Then they get the tabbed version. And a few weeks later they regret that.

    In most cases you go with the 1 language = one site structure, marks the structure with a language (Manage hostnames) and use dictionary items for everything language specific. Also in custom usercontrols.

    In addition to that, your site might have som structured data - ex. products. As the products might be maintained centrally and shared by each website I would implement these elements in a seperate structure in the same installation (or in another) with a tab per language.

    Content
    -- DK (language sites)
    -- SE
    -- EN
    -- Shared Product Catalogue.

     

    Hope this helps

    Jesper

     

  • Paris Bogdan 4 posts 20 karma points
    Jul 03, 2009 @ 15:21
    Paris Bogdan
    0

    Hi jesper,

    My company has been using umbraco for a few years now and they went for separate content for each language with exactly the same thing you suggested. but it has gotten too big and too difficult to manage (they approached the different content/languge because they had some deals or something like this with different countries... but they want none of this this.)

    Umbraco is used currently for our main front pages, info pages & stuff. The more complicated stuff is built with different systems but integrated into umbraco master pages (the auxiliary site is displayed in an iframe in the main umbraco page).

    So far, the umbraco layout was different (in most cases) for each language. Now we are looking for a unified look. This is why I am building these extensions. So we can let go of the separate content and everyone can see the same site, but in their own language, since the English version is the most complete and up-to-date version of all. The other sites are updated later, but sometimes mistakes happen and some of the content in some language is not updated.

    For the content we will also have a separate system to update the resourcrces, send them to translation & stuff like that. So i just need to identify how to do it :). I have done something myself now, but it works only for 1 tier documents (root documents). Now i am in the progress of parsing the children of the current page.

    But some help on doing that would be appreciated.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies