Changing the default order of products on category view - magento2

I want to change the default category sorting from whatever it is by default to NEWSEST FIRST. Seems like there is no way to set this in the backend, so how can I achieve this?

Well, I think there are two ways.
Create your own sort option in a module using a plugin. Something like this: https://magento.stackexchange.com/questions/96095/magento-2-how-to-add-custom-sort-by-option. Look at Luca S's answer. I think this person has a general idea of how to do it.
Use Position option but modified:
http://magento2x.com/magento-sort-newest-products-solution/.
I dont like how they both override stuff, but hopefully this will give you a starting point. Good Luck.

Related

Sails.js Can I add sort functionality to default find action without overriding it?

I was just curious to know if it's by any means possible to add a sort functionality to the default find action of a model without overriding the same in the controller ?
We do have beforeCreate and afterCreate features in the models which is quite useful in many cases. Similarly beforeFetch or something like that, if exists can be really useful when we want some pre/post processing on the result set while doing a get request.
An example of this would be: localhost:1337/user?sort=id desc

How to clear an ILayer?

I can clear all the layers using mapControl.ClearLayers(), but I only want to clear one layer (a sublayer of a basemap, like cities). I'm new at this, thanks in advance.
edit: i am using C#
I'm unsure of which API you are using, but I know C# well. When you add layers you usually attach a name to the property. You can either choose it by the name, or the index.
mapControl.Layers[1].Clear();
mapControl.Layers["My Layer"].Clear();

Filter/Sort the classes in problems view based on author in eclipse

I need to filter or sort the warnings in problems,Tasks view based on the author names given in the class.[#author userName]. Is there any way i could configure it. If not can some one give direction to extend the view and add my own either filter or sorting.
Thanks in advance
There doesnt seem to be a way to do this by default, but extending the problems view to add this information seems feasible. See this for example: http://www.pushing-pixels.org/?p=881

How can I create or associate a super column to a column in Perl using Net::Cassandra?

How can I create or associate a super column to a column in Perl using Net::Cassandra?
I just chatted with the module author and he doesn't understand the question. Then he guessed you want batch_insert which can take a supercolumn.
If that doesn't help, perhaps you step back, try to explain what you want to achieve and rephrase the question.
Best way, IMHO, is to submit a request to add information about super columns into documentation into Net::Cassandra bug tracker.
batch_insert is one way like daxim says; another way is to just use normal insert but specify super_column in the ColumnPath as well as the column_family.
It looks like Net::Cassandra stays pretty close to the thrift api, so this should be useful: http://wiki.apache.org/cassandra/API

ASTNodes And Views

I would like to know if there is a function that when i give it an ASTNode object (the ASTNode can be a class, method or a field in a CompilationUnit) as an argument it can show this object in a view (Tree view or Table view). If there isn't any such function, is there another way or workaround of doing it?
Thanks for your help.
You may be able to use the ASTView plugin
It's not clear if you are referring to Java or just something else. I'm assuming you need a Java tool. I'm not sure what exactly you expect to see in the "view".
Do check out nWire. It may be what you are looking for. Given any component in your code (like Class, field, etc.) it can show all possible associations to other components.