You are here: Foswiki>Tasks Web>Item9073 (02 Dec 2010, MattAdams)Edit Attach

Item9073: Wiki words from included topics behave strangely

pencil
Priority: Normal
Current State: No Action Required
Released In: 1.0.0
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: MattAdams
Waiting For:
Last Change By: MattAdams
I am using %INCLUDE% to bring parts of other web WebHome topics into the Main web. The topics that are being included are using either %STARTSECTION{type="include"}% or %STARTINCLUDE% (both with the appropriate closing vars) to define which parts of the topic to include. Unfortunately it appears that some of the wiki words from the included topics are "broken" and don't point to the source web (it appears that Foswiki expects these to exist in the web into which the copy was included) while others point properly to the source web from which the topic was included.

None of the webs share the same topic names with the exception of the default topics (e.g., WebHome).

Here is the Main web raw text:


<---+!! Welcome to the <nop>%USERSWEB% web

This is the home page for the corporate wiki of Radical Dynamic Inc./Radical Dynamique Inc. This wiki contains information, documents and resources applicable to the business, services and products offered by Radical Dynamic.

---

%INCLUDE{"Corporate.WebHome"}%

----

%INCLUDE{"Finance.WebHome"}%

----

%INCLUDE{"Projects.WebHome"}%

----

%INCLUDE{"Research.WebHome"}%

Here is an example of Corporate:


---+!! %MAKETEXT{"Welcome to the [_1] web" args="<nop>%WEB%"}%

_%SITEMAPWHAT%_

---++ Vision Statement

---++ %MAKETEXT{"Available Information"}%

%STARTINCLUDE%

BusinessPlan

   * ImportantBusinessNumbers, CorporationsCanadaNotices
   * ReportingRequirements
   * BusinessResources
   * TodoList, ScratchPad, EventLog

   * RadicalDynamicIncorporation, ShareRegister
   * CorporateByLaws
   * DocumentTemplates

%STOPINCLUDE%

And below is a copy of the rendered HTML as seen on Main:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"><head>
<title> WebHome &lt; Main &lt; Foswiki</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
<link rel="icon" href="/foswiki/pub/System/ProjectLogos/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/foswiki/pub/System/ProjectLogos/favicon.ico" type="image/x-icon" />
<link rel="alternate" href="http://marvin/foswiki/bin/edit/Main/WebHome?t=1274980152" type="application/x-wiki" title="edit WebHome" />
<meta name="WEBTOPIC" content="WebHome" />
<meta name="WEB" content="Main" />
<meta name="SCRIPTURLPATH" content="/foswiki/bin" />
<meta name="SCRIPTSUFFIX" content="" />
<meta name="TEXT_JUMP" content="Jump" />
<meta name="TEXT_SEARCH" content="Search" />
<meta name="TEXT_NUM_TOPICS" content="Number of topics:" />
<meta name="TEXT_MODIFY_SEARCH" content="Modify search" />
<meta name="robots" content="noindex" /><link rel="alternate" type="application/rss+xml" title="RSS Feed" href="/foswiki/bin/view/Main/WebRss" />

<base href="http://marvin/foswiki/bin/view/Main/WebHome"></base>

<!--BEHAVIOURCONTRIB--><script type="text/javascript" src="/foswiki/pub/System/BehaviourContrib/behaviour.compressed.js"></script>
<script type="text/javascript" src="/foswiki/pub/System/JavascriptFiles/foswikilib.js"></script>
<script type="text/javascript" src="/foswiki/pub/System/JavascriptFiles/foswikiWindow.js"></script>
<script type="text/javascript" src="/foswiki/pub/System/JavascriptFiles/foswikiEvent.js"></script>
<script type="text/javascript" src="/foswiki/pub/System/JavascriptFiles/foswikiHTML.js"></script>
<script type="text/javascript" src="/foswiki/pub/System/JavascriptFiles/foswikiCSS.js"></script>
<script type="text/javascript" src="/foswiki/pub/System/JavascriptFiles/foswikiForm.js"></script>
<script type="text/javascript" src="/foswiki/pub/System/PatternSkin/pattern.js"></script><style type="text/css" media="all">
@import url('/foswiki/pub/System/SkinTemplates/base.css');

</style>
<style type="text/css" media="all">
@import url('/foswiki/pub/System/PatternSkin/layout.css');
@import url('/foswiki/pub/System/PatternSkin/style.css');
@import url('/foswiki/pub/System/PatternSkin/colors.css');
</style>
<style type="text/css" media="all">
@import url('/foswiki/pub/System/PatternSkin/column_left.css');
@import url('/foswiki/pub/System/PatternSkin/theme_foswiki_noframe.css');
</style><style type="text/css" media="all">
   /* Styles that are set using variables */
   .patternBookView .foswikiTopRow,
   .patternWebIndicator a img,
   .patternWebIndicator a:hover img {
      background-color:#FFEFA6;
   }
   

.patternBookView {
   border-color:#FFEFA6;
}
.patternPreviewPage #patternMain {
   /* uncomment to set the preview image */
   /*background-image:url("/foswiki/pub/System/PreviewBackground/preview2bg.gif");*/
}
</style>
<style type="text/css" media="all">
   @import url("/foswiki/pub/System/PatternSkin/print.css");
</style>
<!--[if IE]><style type="text/css" media="screen">
pre {
   height:1%;
   overflow-x:auto;
}
</style>
<![endif]-->

<script type="text/javascript" src="/foswiki/pub/System/JavascriptFiles/foswikiStyles.js"></script>
</head><body class="patternViewPage patternPrintPage">
<a name="PageTop"></a><div class="foswikiPage"><div id="patternScreen">
<div id="patternPageShadow">
<div id="patternPage">
<div id="patternOuter">

<div id="patternFloatWrap">
<div id="patternMain">
<div id="patternMainContents">
<div class="patternContent"><div class="foswikiTopic"> <h1><a name="Welcome_to_the_Main_web"></a>  Welcome to the Main web </h1>
<p />
This is the home page for the corporate wiki of Radical Dynamic Inc./Radical Dynamique Inc. This wiki contains information, documents and resources applicable to the business, services and products offered by Radical Dynamic.
<p />
<hr />
<p />
<p />
<p />
<a href="/foswiki/bin/view/Corporate/BusinessPlan">BusinessPlan</a>

<p /> <ul>
<li> <span class="foswikiNewLink">ImportantBusinessNumbers<a href="/foswiki/bin/edit/Main/ImportantBusinessNumbers?topicparent=Main.WebHome" rel="nofollow" title="Create this topic">?</a></span>, <a href="/foswiki/bin/view/Corporate/CorporationsCanadaNotices">CorporationsCanadaNotices</a>
</li> <li> <a href="/foswiki/bin/view/Corporate/ReportingRequirements">ReportingRequirements</a>
</li> <li> <a href="/foswiki/bin/view/Corporate/BusinessResources">BusinessResources</a>
</li> <li> <span class="foswikiNewLink">TodoList<a href="/foswiki/bin/edit/Main/TodoList?topicparent=Main.WebHome" rel="nofollow" title="Create this topic">?</a></span>, <span class="foswikiNewLink">ScratchPad<a href="/foswiki/bin/edit/Main/ScratchPad?topicparent=Main.WebHome" rel="nofollow" title="Create this topic">?</a></span>, <a href="/foswiki/bin/view/Corporate/EventLog">EventLog</a>

</li></ul> 
<p /> <ul>
<li> <span class="foswikiNewLink">RadicalDynamicIncorporation<a href="/foswiki/bin/edit/Main/RadicalDynamicIncorporation?topicparent=Main.WebHome" rel="nofollow" title="Create this topic">?</a></span>, <a href="/foswiki/bin/view/Corporate/ShareRegister">ShareRegister</a>
</li> <li> <a href="/foswiki/bin/view/Corporate/CorporateByLaws">CorporateByLaws</a>
</li> <li> <a href="/foswiki/bin/view/Corporate/DocumentTemplates">DocumentTemplates</a>

</li></ul> 
<p />
<p />
<p />

<hr />

OTHER CONTENT REMOVED FROM EXAMPLE

<p /></div><!-- /foswikiTopic-->
<p />
<p />
</div><!-- /patternContent-->
<hr />
This topic: Main<span class='foswikiSeparator'>&nbsp;&gt;&nbsp;</span>WebHome <br /> 
Topic revision: r5 - 27 May 2010 - 16:51:27 - <a href="/foswiki/bin/view/Main/MattAdams">MattAdams</a>

</div><!-- /patternMainContents-->
</div><!-- /patternMain-->
</div><!-- /patternFloatWrap-->
<div class="clear">&nbsp;</div>
</div><!-- /patternOuter--><div id="patternBottomBar"><div id="patternBottomBarContents"><div id="patternWebBottomBar"><!-- <span class="foswikiRight"> <a href="http://foswiki.org/"><img src="/foswiki/pub/System/ProjectLogos/foswiki-badge.gif" alt="This site is powered by Foswiki" title="This site is powered by Foswiki" border="0" /></a></span> --> Copyright &copy; by Radical Dynamic Inc. <!-- <br /> Ideas, requests, problems regarding Foswiki? <a href='mailto:matt@marvin.902northland.adams.home?subject=Foswiki%20Feedback%20on%20Main.WebHome'>Send feedback</a> --></div><!--/patternWebBottomBar--></div><!-- /patternBottomBarContents--></div><!-- /patternBottomBar-->
</div><!-- /patternPage-->
</div><!-- /patternPageShadow-->
</div><!-- /patternScreen-->
</div><!-- /foswikiPage--></body></html>
-- MattAdams - 27 May 2010

I don't see anything wrong, but I guess you were expecting the links in the included page to be rewritten relative to the web they are included from. That doesn't happen. INCLUDE is a textual process, and all INCLUDE statements are resolved before the linking rules are applied, so in this case all wikiwords will be relative to the including topic.

Or am I missing something?

-- CrawfordCurrie - 08 Sep 2010

There is nothing to fix here. If Matt needs wikiwords from included topics to point to the original topic he needs to use the fully qualified link with Webname.TopicName

If we "fixed" this a lot of the included topics from System web would suddenly not point to the current web. And I can think of several included topics in our installations where we put small application sniplets in a common web that would not work either.

I will no action this

-- KennethLavrsen - 17 Nov 2010

You guys are right; there is nothing wrong here. Thanks.

-- MattAdams - 02 Dec 2010
 

ItemTemplate edit

Summary Wiki words from included topics behave strangely
ReportedBy MattAdams
Codebase 1.0.9
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn 1.0.0
Topic revision: r4 - 02 Dec 2010, MattAdams
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy