We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38705
    • 101 Posts
    Hi,
    Currently i'm developing a site where we want to use articles for the content publishing,
    i was wondering if it is possible to use TV-output in my url:

    i.e.: article with title "This is it" has a TV which returns "category_a"

    now i want my url to be something like /articles/category_a/this-is-it.html

    Tried to incorperate this TV call in the "Articles URL Format" setting for articles like this "[[*myTV]]/%alias.%ext" but this doesn't work.

    Does anyone has an idea how to solve this? Or am I overlooking something??

    Cheers, Michiel
      Addict since 2012....
      • 36506
      • 8 Posts
      After 9 months, I think you already solved this issue, but I will write my way to solve this.

      In your article.class.php (core/components/articles/model/articles/article.class.php) add a new line after line 276.
      $furlTemplate = str_replace('%mycategory', $this->get('tv4'), $furlTemplate);


      and replace line 272
      $furlTemplate = $this->xpdo->getOption('articleUriTemplate',$settings,'%Y/%m/%d/%alias/');

      with this
      $furlTemplate = $this->xpdo->getOption('articleUriTemplate',$settings,'%mycategory/%Y/%m/%d/%alias/');

      (maybe you dont need to change this)

      Note: Change 'tv4' with id of your tv (tv1 or tv3...)

      I hope that my post understandable

      P.S. It was tested with modx 2.2.8 and articles 1.6.5
      With, 2.2.9 i have some problems, but later it was fixed...how i don't know laugh [ed. note: neehad last edited this post 13 years ago.]