Plots2: Idea: powertag pages for activity (`activity:foo`) can use the "value" of their key:value pair

Created on 21 Aug 2019  路  8Comments  路  Source: publiclab/plots2

Please describe the desired behavior.

This is a feature idea for convention for powertag pages for Activity:foo to

  1. have their lead cards default to the "value" of their key:value pair
  2. have their lead images be pulled from the "value" wiki page of their key:value pair

For instance, view https://publiclab.org/tag/activity:microscope to see that the lead card could have a link back to /microscope, and the lead image be pulled from /microscope.

Screen Shot 2019-08-21 at 3 32 48 PM

Additional context (optional)

Thank you for reading!

feature fto-candidate

All 8 comments

We currently have this card pull from a page that's redirected to, which is a similar situation. So, we can look at these lines of code:

https://github.com/publiclab/plots2/blob/8715803d0336c45e854bf0d12375547a3f458624/app/controllers/tag_controller.rb#L76-L82

We can add a condition which detects if it's a key:value powertag, like:

elsif tagname = params[:id].match(':') && node = Node.where(slug: tagname)&.first
    @wiki = node # skip powertag prefix to find wiki page

...I think? This might take some reworking, but it's worth a try!


This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself!

Thanks to anyone who might be able to reformat this as a first-timers-only issue 馃挌

Hi @ebarry @jywarren, I am trying to reformat this to be a fto need some clarity though...The link we are editing is it Add a wiki page button in the screenshot about and from the example should it link to /tag/microscope? Thanks

Hi, I am Jigyasa, and I am an Outreachy 2020 applicant. Is this issue open and can I work on this?

Hello! I would like to work with this one.

Hi @Karska-dev we would love your help. Go ahead

Hi @ebarry @jywarren, I am trying to reformat this to be a fto need some clarity though...The link we are editing is it Add a wiki page button in the screenshot about and from the example should it link to /tag/microscope? Thanks

So, if I get it right. This card:

Screen Shot 2020-10-14 at 6 31 19 PM

should look exactly like this one:

Screen Shot 2020-10-14 at 6 31 28 PM

Please, correct me where I am wrong!

HI @Karska-dev ,
Thanks for working on this one!

This situation is where there's a power tag in the form key:value where value already has a dedicated wiki page.

In your example, you are showing the tag page for the powertag activity:translation. There is a page publiclab.org/wiki/translation, so the activity:translation card should:

  1. pull the preview text from publiclab.org/wiki/translation, same as publiclab.org/tag/translation does.
  2. display a "Learn more" button that links to /wiki/translation instead of "Add a description" button that leads to an editor for creating a new wiki page.
  3. pull the lead image from /wiki/translation same as /tag/translation does
  4. Remain labelled on the card as activity:translation
Was this page helpful?
0 / 5 - 0 ratings

Related issues

keshavsethi picture keshavsethi  路  3Comments

jywarren picture jywarren  路  3Comments

bronwen9 picture bronwen9  路  3Comments

keshavsethi picture keshavsethi  路  3Comments

first-timers[bot] picture first-timers[bot]  路  3Comments