[pmwiki-users] pagelist backlinks from hidden page text variable links

Profound Darkness pro_d77 at hotmail.com
Thu May 19 08:08:37 CDT 2016


Wow!  I completely forgot about reading in the docs that pagelist picked links up inside 'if false' blocks.  Also missed the bit of logic that 'if false' blocks with non-hidden page text variables achieves the hiding aspect, same as hidden page text variables.
Since I have several pages to update in order to use the new template, the 'if false' block is less work on the conversion process and negligible additional work on new pages.  Just what I was looking for.
I did have a bit of a hickup involving multi line page text variables since stock PmWiki needs delimiters on both sides, ie hidden page text variables which have both open and closing delimiters.  I happened on <<< (myvar) angle brackets >>> (HansB) on http://www.pmwiki.org/wiki/PmWiki/PageTextVariables-Talk and that worked well inside the 'if false' block as the links showed up in the pagelist.
Everything is working great.  Thanks!
> You may be able to use the other type of variables and hide the block of 
> text in a conditional:
> 
> (:if false:)
> localptv:[[group/name]]
> 
> (:ifend:)
> (:include template#GenericPageTemplate:)
> 
> When saving a page, PmWiki processes the wikitext to index the links and 
> store them for faster pagelists. Only it disables the Include, Redirect 
> and Conditional markups. So in the above case, the (:include:) line will 
> be ignored, but so the (:if:) ones and the links will be indexed.
> 
> BTW, above you could use >>comment<< ... >><< instead of a conditional 
> but "comment" blocks of text appear in the HTML source and are hidden 
> via styles (CSS). In your case it will work but in other cases, if the 
> hidden content is sensitive, a "comment" block should not be used.
> 
> Alternatively, you can instruct PmWiki to "break" your PageTextVatiable 
> definitions by adding something like this in config.php:
> 
>    $SaveAttrPatterns['/\\(:(localptv1|ptv2|ptv3):/i'] = ':$1:';
> 
> This will cause PmWiki to strip the first "(" parenthesis before 
> processing the wikitext, so the text of your variables, and any links in 
> them, will be indexed.
> 
> Petko
> 
> On 2016-05-16 09:21, Profound Darkness wrote:
> > I'm wondering if there is a way to get PmWiki pagelist to find links
> > in hidden page text variables which are not explicitly used in the
> > page.  A bit of a long question, sorry.
> > (Simplified) Example:
> > I have a 'generic page' where I collect information in hidden page
> > text variables similar to this:  (:Title generic page:)
> > (:localptv:[[group/name]]:)  (:include template#GenericPageTemplate:)
> > Then there is the 'template page' which handles the rendering of that
> > information via the include above, the excerpt looks like this:
> > [[#GenericPageTemplate]]  some text... {*$:localptv}
> > [[#GenericPageTemplateEnd]]
> > Now when I try on some 'other page' to get a pagelist like this:
> > (:pagelist link=group.name:)
> > I do not see 'generic page' come up in the list.
> > To try and piece this apart some and figure out what is going on, as a
> > test I altered 'generic page' to look like this:  (:Title generic
> > page:)  (:localptv:[[group/name]]:)  (:include
> > template#GenericPageTemplate:)  >>comment<<  {$:localptv}  >><<
> > Now the pagelist shows 'generic page' in the list.  However I'd like
> > to just type in the information on 'generic page' and move on.  I
> > thought maybe if all page text variables were listed in a comment
> > (example concept below) things might work out but I'm not aware of
> > such a feature in PmWiki.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20160519/186fcfb9/attachment.html>


More information about the pmwiki-users mailing list