Index: openacs-4/packages/acs-templating/tcl/head-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/head-procs.tcl,v diff -u -r1.45.2.14 -r1.45.2.15 --- openacs-4/packages/acs-templating/tcl/head-procs.tcl 6 Feb 2020 04:57:51 -0000 1.45.2.14 +++ openacs-4/packages/acs-templating/tcl/head-procs.tcl 6 Feb 2020 18:17:43 -0000 1.45.2.15 @@ -309,6 +309,22 @@ return [info exists ::template::head::included($resource)] } +ad_proc -private template::head::included_in { + resource +} { + + Return the containiner resource, containing the provided resource + + @author Gustaf Neumann + @creation-date 2020-02-01 + + @param resource uri resource + @see ::template::head::includes +} { + set key ::template::head::included($resource) + return [expr {[info exists $key] ? [set $key] : ""}] +} + ad_proc -private template::head::flush_included { resource } { @@ -771,8 +787,12 @@ # foreach name [array names links] { lassign [split $name ,] rel href - if {[::template::head::included_p $href]} { - template::head::flush_link -href $href -rel $rel + set container [::template::head::included_in $href] + if {$container ne ""} { + set container [template::head::resolve_urn $container] + if {[array names links *,$container] ne ""} { + template::head::flush_link -href $href -rel $rel + } } } @@ -841,8 +861,13 @@ if {[array exists scripts]} { foreach name [array names scripts] { - if {[::template::head::included_p $name]} { - continue + + set container [::template::head::included_in $name] + if {$container ne ""} { + set container [template::head::resolve_urn $container] + if {[array names scripts $container] ne ""} { + continue + } } foreach {type src charset defer async content order crossorigin integrity} $scripts($name) {