0

Can I use relative path in nested include page?

asked 2013-01-14 06:06:48 +0800

anthonylau gravatar image anthonylau
17 2

I have 3 zul.

/index.zul
/base/page.zul
/base/menu.zul

index.zul

<zk>
	<include src="base/page.zul" />
</zk>

page.zul

<zk>
	<include src="/base/menu.zul" />
</zk>

I want to use path <include src="menu.zul" /> but it cause page not found. Is there any way to achieve?

Thanks,
Anthony

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-01-24 04:36:37 +0800

rdgrimes gravatar image rdgrimes
735 7

updated 2013-01-24 04:41:21 +0800

The reason this is not possible is because an include is not a call or redirect to another zul. You are actually copying the page.zul contents into the index.zul markup. When you use an include, you are treating the included page as a fragment to be inserted, and not as a separate page to which you are passing control. Since the contents of page.zul is being copied/inserted into index.zul, you never actually navigate away from index.zul and therefore you never actually leave the root directory, which is why page.zul cannot find menu.zul in the same directory. Your relative path must alway reflect the understanding that index.zul never loses control and everything must be seen from its perspective.

Ron

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2013-01-14 06:06:48 +0800

Seen: 47 times

Last updated: Jan 24 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More