Developer forum

Forum » Templates » News:Search.Dropdown.Year does not work correctly?

News:Search.Dropdown.Year does not work correctly?


Reply
At one of our customers the 'News:Search.Dropdown.Year' and ''News:Search.Dropdown.Month'' do not work correctly.

They depend on the DW script newsfunctions.js, in which is referred to html elements "NewsParagraphCustomYear" and "NewsParagraphCustomMonth".

However, the DW-tag "News:Search.Dropdown.Year" results in element "NewsParagraphCustomYear1" and "News:Search.Dropdown.Month" results in element "NewsParagraphCustomMonth1" (Notice the added '1')

Therefore, the scripts fails to find the value and the searchfilter fails.

How come?

version 19.1.0.2


Replies

 
Reply
Hi

The number added to the element is the paragraph ID which has been added to distinguish the search between multiple instances of the news list on a page. Have you tried the default javascript and news template to see if it works?
 
Reply

Thank you for replying.

What should be the default script?
I found the following scripts in several DW instances and I don't think that script can distinguish between ID's :

  var yearDoc = document.getElementById('NewsParagraphCustomYear');
  var monthDoc = document.getElementById('NewsParagraphCustomMonth');

Maybe I'm overlooking something. Please advise.

Kind regards,
Ton

 

You must be logged in to post in the forum