ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

modifying the comment_url_title_auto_path

December 21, 2010 9:09pm

Subscribe [1]
  • #1 / Dec 21, 2010 9:09pm

    ICCRS

    30 posts

    I’m almost finished building a multilingual website, but came across a problem when using comment_url_title_auto_path. It’s basically the same issue described in this archived forums post.

    If viewing my site in Spanish, it makes sense that a “Read more” link would direct to the corresponding entry in Spanish. But, when using comment_url_title_auto_path, the country code doesn’t tag along.

    I’m using the Alternative method so my urls look like this: site.com/countrycode/index.php/...

    In the archived forum post, it looked like the poster had got something to work by modifying mod.weblog.php, it looked like this:

    if ($key == "comment_url_title_auto_path")
    {
      $path = ($row['comment_url'] == '') ? $row['blog_url'] : $row['comment_url'];
      
      if(isset($global_vars["country_code"])) {
        $url_segments = split("/", $row['blog_url']);
        switch(true) {
          case count($url_segments) < 3:
            $path = "/" . $global_vars["country_code"] . '/' . $path;
          break;
    
          default:
            $url_segments[3] = $global_vars["country_code"].'/'.$url_segments[3];
            $path = implode("/", $url_segments);
          break;
    
        }
    
      } else {
    
       $path = ($row['comment_url'] == '') ? $row['blog_url'] : $row['comment_url'];
      }
      $tagdata = $TMPL->swap_var_single(
        $key,
        $path.$row['url_title'].'/',
        $tagdata
      );
    }

    I’m using the latest version of EE2, and I’m PHP illiterate. I was hoping to get some help here on how I could modify the correct file (I’m assuming it is mod.comment.php) for EE2.

  • #2 / Jan 03, 2011 7:41am

    ICCRS

    30 posts

    This is still a major issue and any pointers in the right direction would be much appreciated.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases