Module Listpages Tags

By ErichSteinboeckErichSteinboeck

Description

In post Using attributes of the page itself from Feb '09 a question appeared regarding listing pages with any of the tags of the current page.

Not sure if the below idea comes even near to what was requested, but here you go …

In action

This page is tagged with: hidden listpages redirect tag tags. To see pages tagged with the same tags, click on one of the listed tags.

This is the Redirect module that redirects the browser directly to the "http://snippets.wikidot.com/code:module-listpages-tags/noredirect/true/tags/(none)" page.

Code

This makes use of the redirect concept discussed in post Default ListPages values with URL attributes from Jan '09).

Two problems have shown up:

  • When trying to hide the [[module Redirect ...]] code inside a [[collapsible show=" " hide=" "]] block, a left-over “-” shows. So instead, this code hides [[module Redirect ...]] inside a [[div style="display:none"]]
  • Surprisingly enough it seems that Wikidot removes “display:none” from a [[div style="..."]] specification; as a workaround this code uses [[div style="display : none"]] (note the inserted spaces)
[[module ListPages category="code" tag="_code:module-listpages-tags" tagTarget="code:module-listpages-tags/noredirect/true" limit="1"]]
This page is tagged with: %%tags%%.  To see pages tagged with the same tags, click on one of the listed tags.
[[/module]]

[[module ListPages category="*" separate="no" tags="@URL" tagTarget="code:module-listpages-tags/noredirect/true" limit="30" perPage="30"]]
%%linked_title%%: %%tags%%
[[/module]]

[!-- This redirect appends ...tags/(none) to the URL to avoid displaying untagged pages until the user has clicked a tag --]
[[div style="display : none"]]
[[module Redirect destination="http://snippets.wikidot.com/code:module-listpages-tags/noredirect/true/tags/(none)"]]
[[/div]]

Rate this solution

If you think this solution is useful — rate it up! Or dump it otherwise.

rating: +3+x
Not entirely true
James KanjoJames Kanjo 1235252643|%e %b %Y, %H:%M %Z|agohover

When trying to hide the [[module Redirect …]] code inside a [[collapsible show=" " hide=" "]] block, a left-over “-” shows.

This is not entirely true… the apparent "-" is actually a space, underlined. If you change your CSS theme to have links without underlines (i.e. different colour link rather than underlined link), then the collapsible block will be completely invisible.

When you hover over that "invisible space", however, depending on your CSS for hovering over links, it may reveal itself through highlighting or underlining. But the width of a space is incredible small! It's almost impossible to find!


λ James Kanjo | blog | photos | contact

unfold Not entirely true by James KanjoJames Kanjo, 1235252643|%e %b %Y, %H:%M %Z|agohover
Have to try this
Steven HeynderickxSteven Heynderickx 1247571018|%e %b %Y, %H:%M %Z|agohover

Sorry lost this out of my sight. I will have to try this tags="=" thing again… will come back on it.

unfold Have to try this by Steven HeynderickxSteven Heynderickx, 1247571018|%e %b %Y, %H:%M %Z|agohover
morningbirdmorningbird 1254437119|%e %b %Y, %H:%M %Z|agohover

great. Fabulous. How do you get rid of it. Or edit it?

unfold by morningbirdmorningbird, 1254437119|%e %b %Y, %H:%M %Z|agohover
Add a new comment
page_revision: 5, last_edited: 1235250172|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License