Recent Changes - Search:

PmWiki

pmwiki.org

IncludeOtherPages-Talk

Is basepage supposed to apply to the source of attachments in the included text as well?

(In my wiki, page links can be adjusted but attachments remain inaccessible from another group even when setting basepage to the original page location.) --Henning October 15, 2010, at 09:45 AM

???

Are there any solutions to specify the amount of words to be included instead of lines?

My favorable solution would be to have something like (:include PageName#anchor words=30:), which would mean: include 30 words after the anchor #anchor. Is there any implementation of this?

Is it possible to include pages, or lines from pages, without turning them into a block?

eg I am looking for something like the PageList wrap parameter

Is it possible to create a default for a variable?

Displaying Error Messages

Include failure by default does not display error messages. You can test for errors because "Multiple pages may be specified, but only the first available is included".

You can create a default error message by using 2 pagenames to be included. The first page is the page to include, and the second page displays if the first include fails. You can specify any page as an error page.

In this example I use PageTextVariables so I only have to define the pagename once for each page to be included, and Parameter References to display the pagename on the error page.

In page Site.IncludeFailed put:

%red%'''ERROR: An include failed!'''%% PageName='{$$IncludePage}'

In the page doing the including define the pagenames to be included:

(:P1:badpagename:)
(:P2:MembersList:)

Then include the pages:

(:include {$:P1} IncludePage={$:P1} Site.IncludeFailed:)
(:include {$:P2} IncludePage={$:P2} Site.IncludeFailed:)

Error output looks like this:

(:P1:badpagename:)
(:include {$:P1} IncludePage={$:P1} Site.IncludeFailed:)

Error: An include failed PageName='badpagename'

GNUZoo 11/28/2009

I moved this section to the talk page, because it suggests to use very complicated markups for a simple error message. I'm not sure if anyone will type all this just to display a missing pagename from the template, when it is so easy to re-edit your page and to fix the include link, when it is needed. Now, while I'm sure it is not required to be in the core documentation, I see no problem for it to be here on the talk page. On every wiki installation there is a direct link to this page. --Petko November 29, 2009, at 05:28 PM

Please note also that the core feature is outlined in the main page, so users will find it. (They will, if they read the documentation.) --Petko November 29, 2009, at 05:31 PM

Petko, I cannot believe you or anyone who is using wiki includes would consider this complicated. Do you ever write programs that read a file and not check to see if the file exists? This will make sure that if someone does an include it will work. Someone's include might fail and all they get is missing content that they would not notice in the output. This makes it much more robust. If you really don't care that content you write is accurate, don't use this. I have a higher standard.

Sometimes people don't notice some details. In an ideal world everyone would read everything and follow it exactly. And then we would not need bold text, or color. A detail like this needs more emphasis to be noticed by the average user.

It can be simplified even further:

(:include badpagename IncludePage=badpagename Site.IncludeFailed:)

Error: An include failed PageName='badpagename'

GNUZoo 11/29/2009

It scales bad, if you have more pages: (:include somegroup.badpagename1 somegroup3.badpagename2 somegroup4.badpagename3 IncludePage="somegroup.badpagename1 somegroup3.badpagename2 somegroup4.badpagename3" Site.IncludeFailed:)

It's also funny that you suggest authors to create and use PageTextVariables, or even write the pagenames twice (a second time in the IncludePage= parameter), when it would be enough to write them once, but correctly. If you type your pagename correctly, your page will be included, if it is not included, check your text, period. An average user wanting to include a page, will notice if the page is not included -- you obviously have lower standards about your average users if you underestimate them like that.

If you really believe it is highly valuable and useful, please feel free to create and support a cookbook recipe. --Petko December 01, 2009, at 12:31 AM


Is there a way to say e.g. the included page should have only 50% width, in order to place a picture next to it? (Was trying to do something with tables, but didnt work - included page and figure are shown on top of each other and not next to each other...)

Like with other text and pictures, you can use the lfloat or rfloat WikiStyles to place elements one next to another.

%lfloat% http://pmichaud.com/img/misc/pc.jpg %%
(:include PmWiki para=3..3:)

PmWiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website, using basic editing rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors.

>>rfloat frame width=50pct<<
http://pmichaud.com/img/misc/pc.jpg
>><<
(:include PmWiki para=3..3:)

PmWiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website, using basic editing rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors.

See also Images.

Or use advanced tables, if the included text doesn't contain such tables.

(:table border=0:)
(:cellnr width=50%:)
(:include PmWiki para=3..3:)
(:cell width=50%:)
http://pmichaud.com/img/misc/pc.jpg
(:tableend:)

PmWiki pages look and act like normal web pages, except they have an "Edit" link that makes it easy to modify existing pages and add new pages into the website, using basic editing rules. You do not need to know or use any HTML or CSS. Page editing can be left open to the public or restricted to small groups of authors.


This is a talk page for improving PmWiki.IncludeOtherPages.

Edit - History - Print - Recent Changes - Search
Page last modified on October 14, 2014, at 04:26 PM