Uwazi: Add parameter to embedded lists to select number of items to render

Created on 11 Jul 2017  路  8Comments  路  Source: huridocs/uwazi

Our current embedded lists arbitrarily render 6 elements by default.

We should add a custom parameter to define how many elements the list will render.

Sprint

Most helpful comment

Lets not make it arbitrary just yet to avoid logic to 'figure out' which parenthesis is first for now. If it is really necessary, we can add a further issue to improve on the system.

So, the Pull Request is ready to merge. For the person doing the QA, the way to test this is to add a second parenthesis (with no spaces) with the label limit and a number appended (again, with no spaces) to the list markdown escape code.

Example:

{list}(https://localhost:3000/en/)(limit:9)

It still needs to be in a single line, and with no spaces.

All 8 comments

@txau @konzz @daneryl
How do we want to accomplish this? Our custom markup needs to be intuitive within its already difficult syntax.

Options include:

  • {list=12}(a...very...long...url) This one is simple, but the value tells me nothing unless I know what it is.
  • {list}({limit: 12, URL: a...very...long...url}) This has the advantage of being more verbosy, but creating it (specially with long urls) may be difficult for the user to know when they have correctly matched the parenthesis and brackets.
  • Physically set the limit within the URL. This is even more complex as some queries do not include the limit, so you would have to add a value into the "Q" property which may be harder.

Any other ideas? Implementing this is not really hard, but finding the right solution may require some brainstorming.

Rafa.

I like the second option for no particular reason.

I'm in for the second option too.

The other option is to add a second paranthesis:

  • {list}(very..long...url)(limit:12)

@RafaPolit I like the last one, as an optional parameter and with support for more params in the future.

That last option you presented looks cleaner, lets go for that one. Also the order of the params could be arbitrary so {list}(limit: 12)(very..long...url) could work as well.

Lets not make it arbitrary just yet to avoid logic to 'figure out' which parenthesis is first for now. If it is really necessary, we can add a further issue to improve on the system.

So, the Pull Request is ready to merge. For the person doing the QA, the way to test this is to add a second parenthesis (with no spaces) with the label limit and a number appended (again, with no spaces) to the list markdown escape code.

Example:

{list}(https://localhost:3000/en/)(limit:9)

It still needs to be in a single line, and with no spaces.

@kjantin I guess we need to add this to the docs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RafaPolit picture RafaPolit  路  3Comments

danicatalan picture danicatalan  路  5Comments

RafaPolit picture RafaPolit  路  7Comments

danicatalan picture danicatalan  路  7Comments

fnocetti picture fnocetti  路  4Comments