多国语言幻灯片放映>>

问题描述 投票:2回答:3

我在Drupal 7Nexus 7.x-1.3 theme中有此幻灯片显示代码。

我的网站是多语言的,我需要为每种语言使用不同的图像,例如我想用[slide-image-1.jpg语言)的其他图像名称更改engr语言)。

我的代码:

 <?php if ($is_front): ?>
    <?php if (theme_get_setting('slideshow_display','nexus')): ?>
      <?php 
    $slide1_head = check_plain(theme_get_setting('slide1_head','nexus'));   $slide1_desc = check_markup(theme_get_setting('slide1_desc','nexus'), 'full_html'); $slide1_url = check_plain(theme_get_setting('slide1_url','nexus'));
    $slide2_head = check_plain(theme_get_setting('slide2_head','nexus'));   $slide2_desc = check_markup(theme_get_setting('slide2_desc','nexus'), 'full_html'); $slide2_url = check_plain(theme_get_setting('slide2_url','nexus'));
    $slide3_head = check_plain(theme_get_setting('slide3_head','nexus'));   $slide3_desc = check_markup(theme_get_setting('slide3_desc','nexus'), 'full_html'); $slide3_url = check_plain(theme_get_setting('slide3_url','nexus'));
  ?>

<div id="slidebox" class="flexslider">
<ul class="slides">
  <li>
    <img src="<?php print base_path() . drupal_get_path('theme', 'nexus') . '/images/slide-image-1.jpg'; ?>"/>
    <?php if($slide1_head || $slide1_desc) : ?>
      <div class="flex-caption">
        <h2><?php print $slide1_head; ?></h2><?php print $slide1_desc; ?>
        <a class="frmore" href="<?php print url($slide1_url); ?>"> <?php print t('CONTACT US'); ?> </a>
      </div>
    <?php endif; ?>
  </li>
  <li>
    <img src="<?php print base_path() . drupal_get_path('theme', 'nexus') . '/images/slide-image-2.jpg'; ?>"/>
    <?php if($slide2_head || $slide2_desc) : ?>
      <div class="flex-caption">
        <h2><?php print $slide2_head; ?></h2><?php print $slide2_desc; ?>
        <a class="frmore" href="<?php print url($slide2_url); ?>"> <?php print t('CONTACT US'); ?> </a>
      </div>
    <?php endif; ?>
  </li>
  <li>
    <img src="<?php print base_path() . drupal_get_path('theme', 'nexus') . '/images/slide-image-3.jpg'; ?>"/>
    <?php if($slide3_head || $slide3_desc) : ?>
      <div class="flex-caption">
        <h2><?php print $slide3_head; ?></h2><?php print $slide3_desc; ?>
        <a class="frmore" href="<?php print url($slide3_url); ?>"> <?php print t('CONTACT US'); ?> </a>
      </div>
    <?php endif; ?>
</li>
</ul><!-- /slides -->
<div class="doverlay"></div>
</div>
<?php endif; ?>
<?php endif; ?>

有什么解决方案吗?谢谢。

我有此代码用于我的Drupal 7,Nexus 7.x-1.3主题的幻灯片放映。我的网站是多语言的,我需要为每种语言使用不同的图像。我想更改slide-image-1.jpg(...

php html drupal drupal-7 multilingual
3个回答
1
投票

[Smartling有一个Drupal连接器可能会有所帮助。这是video,显示了连接器的工作方式。


0
投票
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<SCRIPT>
function english(){
$(#image).attr('src','http://link.to.your/english/image.png')
}
function greek(){
$(#image).attr('src','http://link.to.your/greek/image.png')
}
</SCRIPT>
<IMG id="image" src="http://link.to.your/greek/image.png">
<A HREF="#" onclick="english">Change to English</A><BR>
<A HREF="#" onclick="greek">Change to Greek</A>

0
投票

最后,我用php代码在page.tpl中修复了它。如果您的页面语言上有一个if / else,则可以设置图片路径。问候,HashKey

© www.soinside.com 2019 - 2024. All rights reserved.