Home › Support › English Support › [Closed] missing content on translated pages
This topic contains 9 replies, has 2 voices, and was last updated by Sam W 10 months, 2 weeks ago. The support staff assigned to this topic is brooks.
| Author | Posts |
|---|---|
| Author | Posts |
| July 5, 2012 at 2:43 pm #66355 | |
|
Sam W |
I am making progress bringing multiple languages on select pages. I am translating the main <div> content but I am losing the sidebar <div> content in the translated pages. The <div>s are present but empty. They should contain menu and link content that I am not translating – it's generated in the template for the content page. sam |
| July 5, 2012 at 8:23 pm #66418 | |
|
brooks |
Dear Sam, |
| July 6, 2012 at 6:12 pm #66541 | |
|
Sam W |
—-non-translated code—- <div id="sidebarLeft"> <ul class="subnav subnavControls"> ——translated code —— |
| July 6, 2012 at 8:58 pm #66554 | |
|
brooks |
I get you Sam Please post here the php from the template that produced the code above. |
| July 6, 2012 at 9:44 pm #66557 | |
|
Sam W |
I didn't create the theme, but I think this is the section. It's basically a generated menu/submenu/subsubmenu. <?php if ($post->post_parent) { $children = wp_list_pages( if ($children) { ?> |
| July 9, 2012 at 8:29 am #66708 | |
|
brooks |
So far that code looks like it should work well with wpml, |
| July 9, 2012 at 2:59 pm #66777 | |
|
Sam W |
<?php ?> <?php $visitedurl=$_SERVER['REQUEST_URI']; ?> <?PHP $db = new DbConnection(); $userid=$_SESSION['uid']; ?> <!– sivanthi codings for phase 3 END –> <?php <script type="text/javascript"> <!– sivanthi codings for phase 3 START –> <?php $visitedurl=$_SERVER['REQUEST_URI']; ?> <?PHP $db = new DbConnection(); $userid=$_SESSION['uid']; } $query=mysql_query("select id,datasheet_url from datasheet_downloads where uid='".$userid."' and date(date)='".$date."'"); while($row=mysql_fetch_array($query)) } } ?> <!– sivanthi codings for phase 3 END –> <div id="sidebarLeft"> <?php get_sidebar('products'); ?> </div> <div id="main"> <?php while (have_posts()) : the_post(); ?> <?php if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs( "products" ); ?> <?php the_content('Read the rest of this entry »'); ?> <?php endwhile; ?> <?php else : ?> <h2 class="center">Not Found</h2> <?php endif; ?> <?php $pagekids = get_children( $post->ID ); $is_product = true; //echo "<script>console.log('start: is_product = $is_product, post id = " . $post->ID . ", pagekids length = " . count($pagekids) . "');</script>"; $first_ancestor = get_post( $ancestors[1] ); if ( $first_ancestor->post_name == "products" ) { if ( substr( $pagekid_post_name, 0, 1 ) != "_" && $pagekid_post_type != "attachment" ) { <?php if ($is_product) : ?> <div class="tabs"> <script type="text/javascript"> <?php endif; ?> </div><!– end main –> <div id="sidebarRight"> <?php if ( $datasheet_id && is_logged_in() ) : ?> <?php if ( $datasheet_url ) : ?> <?php if (( $datasheet_id ) == "4068") : ?> </div> <!– If M-PHY load 2nd datasheet Sam Beal Apr2012–> <?php if (( $datasheet_id ) == "4068") : ?> </div> <!– sivanthi modification for related items START –> <?php <?php if ( $secondary_content && $secondary_content != "" ) : ?> <!– sivanthi modification for related items END –> <!– If M-PHY insert two Sign In boxes SWB 4-12-12 –> <?php elseif ( $datasheet_id ) : ?> </div> </div> <?php if (( $datasheet_id ) =="4433") : ?> <div class="sidebarItem sidebarItemSignin"> </div> </div> <?php endif; ?> </div> <?php foreach( $ancestors as $id ) { if ( $ancestor_post_name == "general-connectivity" ) { //echo "<script>console.log('family = $family');</script>"; if ( $family != "" ) { <div class="sidebarItem sidebarItemProductBrief"> <?php // if there totalip urls are set as custom variables, add totalip sidebar <?php endif; ?> <?php if ( $meta["totalip_url_ip"][0] || $meta["totalip_url_phy"][0] || $meta["totalip_url_sw"][0] || $meta["totalip_url_vip"][0] || $meta["totalip_url_hdp"][0] ) : ?> <div class="sidebarItem"> <?php foreach( $pagekids as $kid ) { $t = $kid->post_title; <div class="sidebarItem"> <?php </div><!– end sidebarRight –> <?php get_footer(); ?> |
| July 10, 2012 at 6:57 am #66838 | |
|
brooks |
I looked through the code and it seemed ok, then I went back to revise the post and realized you mentioned that you had not translated the menus, that's why they are not appearing! If you want untranslated links appearing on the translated language, you could create them using a text widget otherwise wpml filters them from the output. |
| July 10, 2012 at 7:24 am #66840 | |
|
Sam W |
I have no idea how a "text widget" will help with generated menus. I do not want to translate individual product pages – the terminology is better left in English. That is the main flaw with simply using Google Translate across the entire site. Is there no way to instruct WPML to ignore menus or sidebars? |
| July 10, 2012 at 7:34 am #66841 | |
|
Sam W |
I just discovered "copy content from English". I tested one product and it populated in the menu. thx |
The topic ‘[Closed] missing content on translated pages’ is closed to new replies.