开发者

How to edit a static page to become dynamic

开发者 https://www.devze.com 2023-01-15 16:34 出处:网络
I\'m developing a site you can check it from here: www.wikima4.com I want to have the multilingual integrate in the site. There is already a link at the upper right corner, for English, German and Fre

I'm developing a site you can check it from here: www.wikima4.com

I want to have the multilingual integrate in the site. There is already a link at the upper right corner, for English, German and French.

My problem is if I click this one, the 3rd column is not changing it seems it is static. Any idea how can i have it change as well? I added a code below but when I check the localhost site, that column is created on the left. You can check the picture here: http://www.freeimagehosting.net/uploads/b828dee5e3.png

     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      {{head}}
      <body class="home">
      {{skip-links}}
     <div class="page_margins">
     <div class="page">
     {{header}}
     {{main-nav}}

    <!-- begin: main content area #main -->
    <div id="main">

    <!-- begin: #col2 second float column -->
    <div id="col2">
        <div id="col2_content" class="clearfix">
            {{mesaforte-tour-button}}
            {{news-box}}
            {{events-box}}
            {{articles-box}}
            {{success-box}}
            {{newsletter-box}}             
        </div>
    </div>
     <div id="col2">
        <div id="col2_content" class="clearfix">
             {{mesaforte-tour-button}}
             {{news-box}}
          </div>
      </div>  
    

    
    
    <!-- end: #col2 -->
    
 <!-- {{mainde-nav}}
  <div id="mainde">-->
     
    
  
  

    <!-- begin: #col3 static column -->
    <div id="col3">
        <div id="col3_content" class="clearfix">
            <div id="home">
                <div id="wikima4-home">
                    <p class="float_left"><a href="[~4~]">wikima4</a></p>
                </div>
                <div id="mesaforte-home">
                    <p class="float_right"><a href="[~5~]">mesaforte</a></p>
                </div>
            </div>
            {{teaser-box}}
    </div>
    
   
        <!-- IE column clearing -->
        <div id="ie_clearing">&nbsp;</div>
    </div>                
    <!-- end: #col3 -->
</div>
<!-- end: #main -->

   {{footer}}
   </div>
   </div>
  <!-- full skiplink functionality in webkit browsers -->
  <script src="assets/templates/wikima4/yaml/core/js/webkit-focusfix.js"    type="text/javascript"></script&开发者_StackOverflow社区gt;
     </body>
     </html>


you should really not write your own "template engine" as php is a tempalte engine itsself.

simply change your code to not replacing strings in html but use php tags to put your dynamic data into the html code.

<?php include('/file/which/somehow/sets/my/variables.php') ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title></title>
  </head>
  <body>
    <?php echo $head ?>
    <?php echo $skip_links ?>
    <div class="page_margins page">
      <?php echo $header ?> <?php echo $main_nav ?> <!-- begin: main content area #main -->
      <div id="main">
        <!-- begin: #col2 second float column -->
        <div id="col2">
          <div id="col2_content" class="clearfix">
            <?php echo $mesaforte_tour_button ?> <?php echo $news_box ?> <?php echo $events_box ?> <?php echo $articles_box ?> <?php echo $success_box ?>
            <?php echo $newsletter_box ?>
          </div>
        </div>
        <div id="col2">
          <div id="col2_content" class="clearfix">
            <?php echo $mesaforte_tour_button ?> <?php echo $news_box ?>
          </div>
        </div><!-- end: #col2 -->
        <!-- <?php echo $mainde_nav ?>
    <div id="mainde">-->
        <!-- begin: #col3 static column -->
        <div id="col3">
          <div id="col3_content" class="clearfix">
            <div id="home">
              <div id="wikima4-home">
                <p class="float_left">
                  <a href="[~4~]">wikima4</a>
                </p>
              </div>
              <div id="mesaforte-home">
                <p class="float_right">
                  <a href="[~5~]">mesaforte</a>
                </p>
              </div>
            </div><?php echo $teaser_box ?>
          </div><!-- IE column clearing -->
          <div id="ie_clearing">
            &nbsp;
          </div>
        </div><!-- end: #col3 -->
      </div><!-- end: #main -->
      <?php echo $footer ?>
    </div><!-- full skiplink functionality in webkit browsers -->
    <script src="assets/templates/wikima4/yaml/core/js/webkit-focusfix.js" type="text/javascript">
</script>
  </body>
</html>


Which technology you use? if asp.net there have Resource files, for setting and getting data. if you use database, you can get from db text to output in your website.

Also you can use XML file, and then get data by jQuery or javascript.


Modx tutorial on making multilingual sites....perhaps it can help add some context: http://wiki.modxcms.com/index.php/Make_Multi_Lingual_Site

0

精彩评论

暂无评论...
验证码 换一张
取 消