0

Im stuck with a problem and hope you can help me out. I am using tt_news and I need to retrieve the ID of the category directly in the LATEST view. ###NEWS_CATEGORY### gives me the name of the category, but I need the corresponding ID. Is this possible?

Thank you

Richard A. Schäfer
  • 1,029
  • 1
  • 12
  • 18

2 Answers2

1

I helped myself and used generic markers if anyone needs it:

plugin.tt_news.genericmarkers {
  catid = RECORDS
  catid {
    tables = tt_news_cat
    source.data = register:newsCategoryUid

    conf.tt_news_cat  = TEXT
    conf.tt_news_cat.field = uid
  }
}
Richard A. Schäfer
  • 1,029
  • 1
  • 12
  • 18
0

It should be enough to pass the register like this:

plugin.tt_news.genericmarkers {
    CATID = TEXT
    CATID {
        value = {register:newsCategoryUid}
        insertData = 1
    }
}
Goran.it
  • 5,991
  • 2
  • 23
  • 25
  • What should I do if I need all selected categories' uid? The system allows me to select more than one category, so I'd like to have all category uids displayed. – Andreas Feb 01 '17 at 15:27
  • If you need all uids, then the only way is to use CONTENT and fetch from the DB all related categories based on news uid. Or to create a tt_news extension (there are hooks and examples how this is done). – Goran.it Feb 01 '17 at 17:38