Copied to clipboard

Flag this post as spam?

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


  • Sherry Ann Hernandez 320 posts 344 karma points
    Feb 06, 2011 @ 07:02
    Sherry Ann Hernandez
    0

    multilingual issue in navigation structure

    My site structure is like this

    But the current navigation style is like this

    My problem is the dropdown listing is a .NET usercontrol and I hardcode the node id just to get it displayed like this.

    This is my code

    for

     

     

    (int rowCtr = 1333; rowCtr <= 1338; rowCtr++)

    {

     

     

     

    DataRow row = dt.NewRow();

    row[col1] = GetPropertyFromAliasAndNodeID(

     

    "hotelName", rowCtr);

    row[col2] = GetPropertyFromAliasAndNodeID(

     

    "hotelLocation", rowCtr);

    row[col3] = umbraco.

     

    library.TruncateString(GetPropertyFromAliasAndNodeID("bodyLeftContent", rowCtr),120,"...").Replace("<p>","");

    row[col4] = GetMediaName(

     

    Convert.ToInt16(GetPropertyFromAliasAndNodeID("mapThumbnail", rowCtr)));

    row[col5] = GetPropertyFromAliasAndNodeID(

     

    "latitude", rowCtr);

    row[col6] = GetPropertyFromAliasAndNodeID(

     

    "longitude", rowCtr);

    row[col7] = getRatingImage(GetPropertyFromAliasAndNodeID(

     

    "hotelRating", rowCtr), row);

    row[col8] = GetPropertyFromAliasAndNodeID(

     

    "umbracoUrlAlias", rowCtr) + ".aspx";

    row[col9] =

     

    Convert.ToInt32(GetPropertyFromAliasAndNodeID("hotelSortOrder", rowCtr));

    row[col10] = umbraco.

     

    library.NiceUrl(ctr);

    row[col11] = rowCtr;

    row[col13] =

     

    "/hotelrating.aspx?id=" + rowCtr;

    dt.Rows.Add(row);

    ctr++;

    }

     

     My issue now is i'm having a problem setting up a site in multilingual. Even the top navigation (dine, plan) I hardcode the nodes to get it displayed like that. I structured it that way because I was thinking I can use a resource file to create 1:1 multilingual site.

    I'm really confused now how to solve this multilingual. Please help.

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Feb 06, 2011 @ 13:41
    Chris Houston
    0

    Hi,

    I think your biggest mistake was to create a user control that has hard coded values.

    You can pass values into your user control, so perhaps you re-factor your user control so that you pass in the currently node ID and from that you can determine which page you are on the site and hence render the correct data. I assume your are looking to create the additional languages as seperate nodes in their own language tree structure?

    Have you watched the free video that show you how to pass in macro parameters?

    Cheers,

    Chris

  • Sherry Ann Hernandez 320 posts 344 karma points
    Feb 06, 2011 @ 13:50
    Sherry Ann Hernandez
    0

    Sorry, didn't get this reply that's why I posted another question if I can use relations.

    But then in my xslt I also use hard coded values.

    Because I can't think of any other way to display all the rooms which is coming from different parent node. :(

  • Yannick Smits 321 posts 718 karma points
    Feb 06, 2011 @ 14:06
    Yannick Smits
    0

    To solve a similar problem I've used a dictionary item to store the reference to several "hard-coded" node-id's in multiple languages.

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Feb 06, 2011 @ 14:06
    Chris Houston
    0

    Hi Sherry,

    Can you confirm, when you are in the EN branch of your site you want to show the hotels in that section and if you are in say

    the FR section of your site you would then show just the hotels in the FR section?

    I am trying to understand what you are actually trying to achieve here? Maybe if you could try and give an example of which page

    your user is on, and which data you are then trying to access it would make it easier to help you.

    Cheers,

    Chris

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Feb 06, 2011 @ 14:08
    Chris Houston
    0

    At the moment, I cannot see why you would need to hard code any values, hence I need to understand a bit more about your site structure.

    Cheers,

    Chris

  • Craig Taylor 29 posts 69 karma points
    Feb 08, 2011 @ 20:19
    Craig Taylor
    0

    Sherry,

    Assuming your "hotel" nodes in English and French have the same document type, you can load the nodes this way.  Search for the node that has this document type using xpath and then display the child nodes.  This will avoid you having to hardcode individual node Ids.  You will still need to have a way to specify the document type id to search for, however.

    -Craig

Please Sign in or register to post replies

Write your reply to:

Draft