diff --git a/modules/ding_webtrekk/ding_webtrekk.js b/modules/ding_webtrekk/ding_webtrekk.js index 47caa45006..c3959c413f 100644 --- a/modules/ding_webtrekk/ding_webtrekk.js +++ b/modules/ding_webtrekk/ding_webtrekk.js @@ -111,6 +111,9 @@ // on the panel pane. There are no panel hooks where we can get the title // and easily change the content tree to add event and URL-parameters to // elements (content is already rendered when hook is run). + // Note that 'once' and 'context' is left out intentionally in the outer + // most selector. This is because items in the carousel are lazy loaded + // and we want to make sure the selector applies when new items is added. $('.ding-carousel').each(function() { var key = 'u_navigatedby'; // We need a title to send as value in the 'u_navigatedby' parameter, so diff --git a/modules/ding_webtrekk/ding_webtrekk.module b/modules/ding_webtrekk/ding_webtrekk.module index 39a9cb1444..53cb896553 100644 --- a/modules/ding_webtrekk/ding_webtrekk.module +++ b/modules/ding_webtrekk/ding_webtrekk.module @@ -51,10 +51,10 @@ function ding_webtrekk_page_alter(&$page) { 'option: {} };' . $tag_integration_logic, 'type' => 'inline', - // Use the JS_LIBRARY group to add script at the top of head. Use -21 for - // weight to ensure it's added below the Page parameters which has -22. - // The weights are set above -20 to get it above core jQuery library, - // which is added with the weight -20. + // We want the webtrekk loader as high as possible in the HTML-head, as + // recommended in the implementation guidelines. We therefore use the + // JS_LIBRARY group and choose a weight lower than the weights in + // system_library(). // See: ding_webtrekk_preprocess_html(). // See: system_library(). 'group' => JS_LIBRARY, @@ -194,7 +194,7 @@ function ding_webtrekk_ding_entity_view($entity, $view_mode) { 'p_mat_indexno' => $entity->getClassification(), 'p_mat_lang' => $entity->getLanguage(), 'p_mat_source' => $entity->getAc_source(), - 'p_mat_category' => implode(';', $entity->reply->getGenre()), + 'p_mat_category' => implode(';', $entity->getTingObject()->getGenre()), ]; ding_webtrekk_add_page_parameters($params); }