Movable Type: Specify one category to display in entry - movabletype

I want to specify one <CategoryLabel> in <MTEntryCategories> in archive template.
For example my categories are like this (x is selected category in entry):
Fruit
--Apple
--Grape
Drinks
--Coffee
-x-Beer
--Juice
Vacation
--France
-x-UK
In this case I want to display the label under "Drinks" in a entry (sample code)
<MTSubCategories category="Drinks">
<MTEntryCategories>
<h1><$MTcategory_label$><h1>
</MTEntryCategories>
</MTSubCategories>
I know there are various plugin that do this but I couldn't find one that supports MT5.
If anyone know if there is a way to do this without the plugins, greatly appreciated!

If I'm understanding your question correctly, you would like to do display the category for the entry that is a sub-category of Drinks in an h1.
If that is the case, here is what I would do in MT4 (without a plugin):
<mt:entrycategories>
<mt:ifisdescendant parent="Drinks">
<h1><mt:categorylabel></h1>
</mt:ifisdescendant>
</mt:entrycategories>
This will step through each of the categories for the entry and, if the category is a sub-category of Drinks, it will output the label in an h1.

Related

Create Order from Input Itm/Qty Looked up against Bill of Materials

Not sure the best way to ask this so please feel free to ask for more information!
I have our Bill of Materials in a spreadsheet, column A is the "parent" item, column B has the "components"
I want to create a spreadsheet where i can type
Parent - Qty
Parent - Qty
Parent - Qty
etc
and then in turn make a list of components i need to order.
i have the lookup part done to find the components that go with each parent once the parent is entered, but I cannot for the life of me figure out how to take all of the components, get them in a list, remove duplicates, and then look back at the quantity to see how many of each component I need to order.
Attaching a screenshot of where i am right now for reference...
NOTES:
+ never more than 5 components per item
+ each component only goes into the parent once (qty per is 1)
+ components can be on multiple parents
Help!
Screenshot:

Magento 2 - How show product price in dropdown choose an option

I want to show the product difference price in the dropdown list for configurable product (choose an option) same as in magento 1.X Thanks to all!
This is a known issue in Magento 2
The JavaScript array which is used for the picklist is generated in the method getJsonConfig() in the Class
app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php
There you see two arrays added to $config: attributes and optionPrices.
attributes seems to contain the labels that are used for the dropdown.
optionPrices contains the prices which are used to refresh the price after a customer selects a different option (with a different price associated).
This will make it very difficult to show the price difference in the dropdown as the price difference values would need to be calculated in the JavaScript.
One solution that is relatively easy to implement would be something like this, but this will show the final price of each option, not the price difference:
Create a Magento 2 plugin module that is triggered after the getJsonConfig is executed: afterGetJsonConfig()
Then use the output of the getJsonConfig in afterGetJsonConfig(): $config, this array contains attributes and priceOptions array, amongst others.
First jsondecode $config
Then walk through the attributes array to determine the available options
For each option, find the matching price in priceOptions array.
Update each option label in the attributes array by concatenating the price (correctly formatted) to the existing label.
jsonencode $config
return $config

Sharepoint Lookup

I have been absolutely stymied by Sharepoint lookups and the complete lack of information anywhere that relates to my problem so one last stab at seeing if anyone has a clue if not I am going to find another job which doesnt involve the use of this very good but highly complicated system.
My problem is that I want to add a column in list 1 that looks up a column in list 2, all very easy you may think and the nice videos on you tube make it seem very easy. So imagine the frustration when I create the column choose the appropriate list from "get information from" drop down and then go to the "in this column" drop down to find the fields i want are missing. I have tried this many ways and could not resolve it. So I decided to start again and set up a brand new list 2 which contains just 4 columns each created manually one column is "just single line of text" called Financial year the other three are a "number" and called Population, Dwellings and Non Domestic. Now having done that I would expect to see thos 4 columns (Financial year, Population, Dwellings and Non Domestic) all appear in the "in this column" drop down when setting up the lookup. But no of course not bloody Sharepoint will only show: Title, Financial year, ID , Content Type, version, and Title (linked to item) none of which I am the slightest bit interested in. I want to look up Population, or Dwellings or Non Domestic. Why is this so easy to do in Excel but in Sharepoint it seems as if Bill Gates has decided he's in charge of what people lookup!! in a word its crap.
I should have added that the same happens whatever list I select to look up from.

Menu extracting

I am interesting in extracting and structuring information about restaurant menus. What is needed is to extract the items from the menu in form category / name / price
For instance, we have the following website. Here we have a drinks sections, and there a number of items. For that website I'd like to be able to extract
Drink / Cappuccino / € 1,50
SANDWICHES / filled sandwich, pistolet (round roll) or emperor roll / € 1,30
etc ...
Of course it shouldn't be limited only to this website.
The only way I can see to handle that is applying a bunch of regexps, but I don't believe listing all possible dish names is feasible.
I know that the topic might be too broad for a question, but anyway any suggestions or references to relevant articles or books will be much appreciated.
This seems quite possible. You many not be able to list all possible dishes but you can list all possible categories.
Assuming that in every menu, dish names follows category name and it is followed by the price, you can identify dish names.
The algorithm will look like this:
foreach(category: category_list):
foreach(word:document):
if(category == word):
dish = Read next(if data is structures with table read next row or col)
price = Read next and check it format to see if its Currency or a price
The point is you will need to analyse different websites to understand how the information is structured and prepare your algorithm to deal with all possible structures.

iReport: How can i display this layout?

Let say I used this query Select customerName From tbCustomer.
How can I display the result in this layout:
CUSTOMER : customerA, customerB, customerC
NOT
CUSTOMER
-customerA
-customerB
-customerC
Normally this is done using columns and horizontal filling. That's the simplest solution. It should be easy for you to figure out how to do this if you know to define how many columns are in the report and set the "Print order" to Horizontal.
That would not have the commas that you show in your example, but it would be quite similar.
If you really want exactly what you have shown, then you could create a variable that appends each customer name to it as it iterates. In your simple example you would display this value in the Summary band (or Title or other band... but not the detail band).

Resources