In aspdotnetstorefront, how can I add a different banner to each category without making different skins? - aspdotnetstorefront

My goal is to add different banners to the bottom of each category, right below the list of products.
This could be accomplished in the following ways, but I'm not sure how to do it in aspdotnetstorefront:
Add custom CSS per category
Add custom HTML per category
I'm trying to avoid adding content using Javascript, but will do as a last resort. That would be easy, but could cause maintenance issues.

I think your best bet is to add the summary to the XMLPackage you are using for your category pages. Adding the following line will allow you to add the banners to the Summary field (editable via admin):
<xsl:value-of select="aspdnsf:GetMLValue($CurrentEntityNode/Summary)" />
This snippet assumes that the parameter CurrrentEntityNode has been declared:
<xsl:param name="CurrentEntityNode" select="/root/EntityHelpers/*[name()=/root/Runtime/EntityName]//Entity[EntityID = $CurrentEntityID]" />

Related

Can I iterate form-lists in Moqui?

Is there a way to do the following in Moqui?
Say I have a list of parent categories (or classifications etc.)... Taking Request categories:
<entity-find entity-name="mantle.request.RequestCategory" list="parentCategoryList">
<econdition field-name="parentCategoryId" operator="is-null" />
</entity-find>
And I want to use 'parentCategoryList' to produce a sub-list for EACH parent category, to display separate form-lists on screen:
Something like:
<iterate list="parentCategoryList" entry="thisCategory" >
<entity-find entity-name="mantle.request.RequestCategory" list="categoryList">
<econdition field-name="parentCategoryId" from="thisCategory.requestCategoryId" />
</entity-find>
<!-- I include the following only to give an idea of what I am trying to do.
It is incorrect and incomplete -->
<script>listOfLists.add(categoryList)</script>
</iterate>
Then use that 'listOfLists' to iterate a form-list, supplying the form-list 'name' and 'list' sequentially for each list in the list. (I know you can't use iterate outside of actions, and you can't use forms inside of actions.)
I may well be thinking about this in the wrong way.
You can iterate within the screen.widgets element, just use section-iterate. There are limitations to how much you can nest these (the current template macros for XML Screens/Forms only support so much), but you can do quite a bit. There are example of this in SimpleScreens, like the OrderDetail.xml screen iterating over order parts.

Automated alternatives to creating hierarchical categories in mediaWiki manually?

I want to start a mediaWiki based site, but rather than manually adding categories and subcategories I want to add them in an automated fashion, where I provide something like an xml file and the bot/script/algorithm/... goes through the list and creates the categories and subcategories with their pages automatically.
There are no pages yet, but I want to start with a clean set of categories, helping users to sort the pages.
I found the pywikipediabot, but I can't figure out how to use it for my purposes - it seems to only work for categories of existing pages. Would you use pywikipediabot for creating hierarchies of new categories and if yes how? Can an xml file be used as a template?
I found a solution to my initial problem of creating categories in bulk, however I don't mark the question as closed, if you know a better solution - please post.
MediaWiki has an import functionality. With your admin account go to
http://yourMediaWiki/index.php/Special:Import
This allows you to choose to import an xml file, which has to follow a certain structure: see here
For a category with the name "Test Category" and the text "Category Testing", you have to create a 'page' element like this:
<page>
<title>Category:Test Category</title> <!-- Name of the category, don't forget to prefix with 'Categroy:' -->
<ns>14</ns> <!-- 14 is the namespace of categories -->
<id>n</id> <!-- identifier for category -->
<revision>
<id>16</id> <!-- number of revision -->
<timestamp>2013-02-10T22:07:46Z</timestamp> <!-- Creation date & time -->
<contributor>
<username>admin</username> <!-- Name of user who created the category -->
<id>1</id> <!-- ID of the user -->
</contributor>
<comment></comment> <!-- Comment about the category. Can be left blank -->
<sha1></sha1> <!-- sha1 hash can be left blank -->
<text xml:space="preserve" bytes="1">Category Testing</text> <!-- It seems it doesn't matter what you write into the bytes attribute. -->
</revision>
</page>
If you want to create hierarchies of categories just add the parent category tags into the text element. Say the category should be part of the 'Parent Category' category then the text element should look like this:
<text xml:space="preserve" bytes="1">Category Testing [[Category:Parent Category]]</text>
If you are able to get pywikibot up and running, then you can use the its Category class. Main entry point on Github search for class Category(Page).
Categories in Mediawiki are basically standard pages but in Namespace 14. To include any page in a Category - including a page which is a category - in the wikitext of the page you include [[Category:<The-Category>]]
So you can do something like this
>>> import pywikibot as pwb
#Your site will be different than this
>>> testwiki = pwb.Site('en','test')
>>> catA = pwb.Category(testwiki, 'testCatA')
>>> catA.namespace()
14
>>> catA._text = u'[[Category:testCatB]]'
>>> catA.save()
Page [[test:Category:TestCatA]] saved
Now you have a page Category:TestCatA which is a subcategory of Category:TestCatB.

Shopify: Is it possible to find a product by sku number?

The data that I'm getting only contains the SKU numbers. I am trying to figure out how I can link these SKU numbers to the product variants in Shopify without the actual product id number.
Example data:
<Inventory ItemNumber="100B3001-B-01">
<ItemStatus Status="Avail" Quantity="0" />
</Inventory>
<Inventory ItemNumber="100B3001-B-02">
<ItemStatus Status="Avail" Quantity="0" />
</Inventory>
<Inventory ItemNumber="100B3001-B-03">
<ItemStatus Status="Avail" Quantity="-1" />
<ItemStatus Status="Alloc" Quantity="1" />
</Inventory>
<Inventory ItemNumber="100B3001-B-04">
<ItemStatus Status="Avail" Quantity="-1" />
<ItemStatus Status="Alloc" Quantity="1" />
</Inventory>
Here's a delightful, condescending discussion from Shopify employees in 2011 asking why you can't just store the Shopify ID everywhere. The "stock-keeping unit" is a universal systems integration point and, in every system I've seen, each SKU uniquely maps to a product because words have meaning, but apparently not at Shopify.
Three years later, you seem to have two options.
One is to create a Fulfillment Service and provide a URL where Shopify will call you asking for stock levels on a SKU; this is probably the simplest solution, provided you have a Web server sitting somewhere where you can expose such a callback.
The second is to periodically page through all of the Products and store a mapping of the Shopify ID to a SKU somewhere, consulting your map when you need to do an update. Because most of our integrations are cron jobs and I'd like to keep them that way, I periodically ask for the products that have changed since the last run, and then update my mapping.
As David Lazar points out in his comment, the ability to find a product based on its SKU is not currently supported in the Shopify API.
EDIT: This is an unreliable option that I once used as a last resort. I wouldn't recommend using this but I will leave it here in case as someone may find it helpful.
You can use this API endpoint:
/admin/products/search.json?query=sku:abc123
I have only used it in the browser though, and I can't find any documentation for it. And it may stop working at any time.
You can use
*.myshopify.com/search?view=json&q=sku:SKUID
Graph query on Shopify works for me:

Determining Last page position in xsl-fo

Can we somehow determine the position of the last-page in XSL-FO?
If I want to place my footer only on the last page, then how it could be done? As Input data varies and is not static. So any number of pages can come depending on the data.
Hope, it's not too late. But anyway, for all interested people:
Create a page master
<fo:simple-page-master master-name="my-last-page">...</fo:simple-page-master>
and put your footer as a "region-after" into that master.
Add this to your repeatable-page-master-alternatives
<fo:conditional-page-master-reference page-position="last" master-reference="my-last-page"/>
This is how you could define the last page. I don`t know your structure but you can add this in a block and reference with your footer.
<fo:block id="LASTPAGE"></fo:block>

Accessing 'Modified By' field in a reusable workflow

I'm creating a reusable workflow in SharePoint designer 2010. I've created a custom content type with all the necessary fields that I'll be used in the workflow. But I'm not able to get the Modified By field (Editor) inside the workflow.
<FieldRef ID="{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}" ReadOnly="TRUE" Name="Editor" DisplayName="Last Updated By" FromBaseType="TRUE" Required="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Aggregation="" Node="" />
I really doubt whether the ID is matching with the inbuilt editor field. How can I cross-verify this? Any ideas?
Not sure but do you really need to include it explicitly? Editor is part of base content type : Item, and down the hierarchy all other content types should be inheriting it without the need to explicitly include it.
Regards,
Nitin Rastogi