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

Petko Yotov 5ko at 5ko.fr
Tue May 17 13:59:50 CDT 2016


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.



More information about the pmwiki-users mailing list