[TYPO3-english] News filter some PIDs by category

Jill E. Peterson jillande at gmail.com
Thu Nov 21 00:15:42 CET 2013


Greetings,

How can I render a selected list of news articles using the news plugin (or
any arbitrary record by its plugin in general)?

The 'select' below successfully retrieves a list of news articles (I
confirm by seeing the list generated by the 'renderObj' shown), however I
can't figure out what renderObj magic is needed to render the selected list
using the news plugin so that the links will go to the appropriate page(s)
as already defined by news configurations. If I naïvely do renderObj <
plugin.tx_news I see only articles created by the department and not from
the global news team (just showing the plugin as usual, without regard for
the 'select') once for each result from the select.

tmp.allDeptNews = CONTENT
tmp.allDeptNews {
   table = tx_news_domain_model_news
   select {
     selectFields = title,uid
     join = tx_news_domain_model_news_category_mm ON
tx_news_domain_model_news.uid=tx_news_domain_model_news_category_mm
.uid_local
     where = pid='###localNews###' OR (pid='###mainNews###' AND uid_foreign=
'###mainCategory###')
     max = 5
     orderBy = datetime DESC
     markers {
       localNews.data = {$admin.config.newspid}
       mainNews.data = {$admin.config.globalnewspid}
       mainCategory.data = {$admin.config.globalnewscat}
     }
   }

  # test selected list
  renderObj = TEXT
  renderObj {
    field = title
    wrap = <li>|</li>
  }
  wrap = <h4>News</h4><ol>|</ol>
}


Background:
I want to insert a list of articles from news where some news are from one
PID without any category restriction and some are from another PID where
the news must be restricted by category. I have about 200 individual
departments publishing their own news articles for their own department
page, each in their own custom workspace. The "global" news team
categorizes some of the news articles they create for each department in
their own custom workspace. The departments should be able to see articles
they author in the FE inline with ones the "global" news team has created
and categorized for their department. The newest N articles created in
either repository should display (not M newest from "global" team, then
M newest from department team).

The categories in the "global" news repository are configured with single
view page defined under the "global" news page namespace so an article
won't be available at more than one URL just because it's linked from
multiple places (i.e. once for each the global news page and the department
that may also show it in their list). I don't want to let the departments
categorize their own stories using the category from the global news
repository because it would make news they create available under the
global news URL. I have configured news so that only categories in the
current page are shown, so that each department will see only the
categories they have created. They can create their own categories and I
don't want the global news authors to be bombarded by hundreds of
categories they don't care about (or worse, to have to choose between
duplicates of the same name--one they should use and others that other
departments have created) when they categorize articles.

If I would achieve the desired effect manually, I would have the
departments create "External News" articles linking to each article under
the global news page. The department-authored articles would appear under
the department's URL and the articles from the global news repository would
be links to the original article. Of course, an automated solution is
needed.

Currently 4.5.30 TYPO3 CMS and news 2.2.1 but will migrate to 6.2 when it
is available so if a solution will work in only one or the other, it is
relevant to me.

Many thanks.

Jill


More information about the TYPO3-english mailing list