cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
This question about Using an extension: Asked

How can I Include only a part of a random topic?

Hi,

I would like to create something that you may know from Wikipedia-Portals, which show only the first paragraph of an article followed by a button "read more". I know several options to do that, but I need to combine all of them, which seems complicated so I ask for assistance.

Topic of the day

When I use the "topic of the day" option, it works fine, but the summary variable removes all formatting, which I do not want. I want to display the article as it is, not without formatting.

using randomtopic plugin

When I use the INCLUDE with RANDOMTOPIC, I get what I want, but then I get the entire topic, which is too long. How can I limit this? Maybe using something like the "Summary 100" option would be great.

Next, this plugin searches ALL the pages, and I want to exclude some (see below)

I am using the following to create a link to a Random topic (for instance GetLiveSupport)
%CALC{$SET(webtopic, $LISTRAND(%SEARCH{ "[0-9A-Z]" web="En" excludetopic="Web*,Category*,*Template,*Form" scope="topic" type="regex" casesensitive="on" nosearch="on" nototal="on" separator=", " format="$web.$topic" noheader="on" }%))$SET(pos, $FIND(., $GET(webtopic)))$SET(web, $REPLACE($GET(webtopic), $GET(pos), 100))$SET(topic, $REPLACE($GET(webtopic), 1, $GET(pos)))}%
%CALC{$NOP(%)SEARCH{ \"^$GET(topic)$\" web=\"$GET(web)\" scope="topic" regex="on" nosearch=\"on\" noheader=\"on\" nototal=\"on\" limit=\"1\" format=\"[[%SCRIPTURL{view}%/$web/$topic][Random Article]]\"}$NOP(%)}%

I don't know how or if I could use that to include a random page.

search parameters in topicform

I want to limit the results to one specific category I have set in the TopicForm; I know this works with something like this
%IF{"$'FORMFIELD{Category}'='foo'" then="[[...]]" else="<nop>"}%

So you se, I know the basics, but have no idea how to combine them.

-- LieVen - 12 May 2016

 

QuestionForm edit

Subject Using an extension
Extension
Version Foswiki 1.1.9
Status Asked
Related Topics
Topic revision: r1 - 12 May 2016, LieVen - This page was cached on 26 Apr 2018 - 02:13.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License