Forum:Beta test: changes in Item Template
From Fallen London Wiki
Forums: Index > Feedback and Suggestions > Beta test: changes in Item Template
Beta test: changes in Item Template[edit]
Over at staging:Template:Item, I have done a few major tweaks to the buying/selling part of Template:Item.
I invite you to take a look.
The set of changes can be seen here: staging:Special:Diff/514244/514415, but to summarize:
- a new helper template staging:Template:Transaction is introduced; it removes a major chunk of duplicated code in the Item template and makes it easier to keep the presentation of the different markets consistent
- the items now display not only the information on which shop sells the item, but also which "market" the shop belongs to (e.g. Bazaar, Upper River Exchange, Rat Market etc)
- the buy/sell prizes are now stored in SMW for all items (edited to add: staging:Property:Bought for and staging:Property:Sells for)
- items purchased for Memory of a Tale or other items will no longer display the default symbol (proof of concept: A Brick from the Very Walls of Hell vs staging:A Brick from the Very Walls of Hell).
This required some small changes:
- printout of the echo price on items bought/sold for items, like Cave-Aged Code of Honour, lodgings keys, etc is no longer supported; the old price was ambigious anyway, since it was not clear if this was the buy or sell price.
- items bought/sold for items will require use of a new parameter "Buy Currency"/"Sell Surrency". Equivalents in the familiar pattern exist for the other markets (e.g. Upper Buy Currency). Existing item pages of this kind will have to be updated to the new syntax; I will do this via bot when merging the templates from staging.
- the order within the sentence about "it can be bought/sold" has been changed slightly to account for the unification of style between the Bazaar and other markets.
- minor syntax changes to make the template code more readable
Test cases:
- cannot be sold or bought: Dilmun Club Lapel Badge, staging:Dilmun Club Lapel Badge
- can be bought, but not sold: Key to a Handsome Townhouse, staging:Key to a Handsome Townhouse (apparently, there are no Echo items for which this is the case)
- can be sold, but not bought: Unprovenanced Artefact, staging:Unprovenanced Artefact
- can be bought/sold with currency which is not default for the market: Drop of Prisoner's Honey,staging:Drop of Prisoner's Honey
- can be bought/sold in several markets: Tinned Ham, staging:Tinned Ham
- sells for items: Admiral-in-a-Box, staging:Admiral-in-a-Box
Now, as these have been fairly extensive changes done over the span of several days, it is very possible there were some edge cases introduced. If you find anything, let me know - otherwise I will probably merge stuff over within the next few days.
-- RagCall (talk) 21:06, 20 February 2022 (UTC)
- Definitely some well-deserved clean-up, I'm happy to see it happen. I'm impressed you've been able to aggregate the rather large variety of oddities and edge-cases around this. This systematic approach will be a boon if (when) more markets get added, which I suspect will be sooner rather than later.
I took a look at "improper assignments" for Sells for and Bought for. The former all seem to be "pays in items" situations awaiting the syntax switch. The latter are all L&F items--is this the same issue, or is there a different systemic issue going on with Mr Chimes?
Minor bug: Needs some gratuitous defensive noembeds. See the properties set on staging:A curious tactic.
- PSGarak (talk) 03:20, 21 February 2022 (UTC)- Ah, thanks. The improper assignments were all due to the syntax change and are now all taken care of. Note for myself, I usedreplaced by
\|Buying\/Selling = (.*?)\s*\(\{\{(IL|Unlock)\|([^|]+)\|([0-9 ]+)\s*x\}\}\)\s*\/-
and|Buying/Selling = $4/-\n|Buy Currency = $3
replaced by\|Buying\/Selling = -\/(.*?)\s*\(*\{\{(IL|Unlock)\|([^|]+)\|([0-9 ]+)\s*x\}\}\)*\s*
(This required slight manual adjustments, but given that only ~30 articles are affected, I will do that by hand).|Buying/Selling = -/$4\n|Sell Currency = $3\n
Damn, always forget about the noembeds. This is exactly the stuff I am looking for. Added. -- RagCall (talk) 08:27, 21 February 2022 (UTC)
- Ah, thanks. The improper assignments were all due to the syntax change and are now all taken care of. Note for myself, I used