Different routes same pages FlowRouter

Hi,
when trying to render same pages on two different routes the fotos (jpg , png) saved in public folder are not shown, is it something that prevents this and is not supported in Blaze meteor? I am using the below code:

 FlowRouter.route('/experiment/approachOne', {
	action: function() {
		 BlazeLayout.render('experiment', {main: "experiment"});
		

	 } 
 });
 FlowRouter.route('/experiment', {
	action: function() {
		 BlazeLayout.render('experiment', {main: "experiment"});
		

	 } 
 });

when only the one route is on the fotos are shown properly though.

Are you using relative URLs for your images? the browser will use the URL to determine the path to the image, so if you’re using relative resource URLs with two different levels of URL, it won’t work.

It also seems odd that you’re rendering the experiment layout with the experiment template inside it (seems like this should cause recursion problems)

Failing that, we probably need to see the code for the experiment template and the footer where the images are referenced, as well as the output of the page on both URLs

1 Like

Hi,
given that meteor read from public folder the images for example in footer are like below in experiment.html

<template name="_footer">
        <div class="navbar-light bg-light border-top border-primary" style="margin-top:10px">
                <nav class="d-flex align-items-end justify-content-end navbar-light bg-light border-bottom border-primary p-2">
                    <div>
                        <img src="logo-EU.jpg" alt="EU Logo" width="120" height="60">
                    </div>
                </nav>
        </div>
</template>

in the two attached images you can see how the image is displayed in /experiment and how it is dispayed in /experiment/approachOne.
I could see that in the case that it is displayed it searches in different path from the one that it is not dispalyed (red marked boxes)
I use the same html and js, I have not created new ones for the approachOne

img-ok