Sharepoint2013 list item filter - sharepoint-2013

My requirement is I have to submit records into a list/lib with attachments and that record can be tag to category field they can be multiple for a single item.
i.e. An item A can be tag to tag to category X or can be cat X,Y(multiple category can be)
My requirement it user can also filter these record in list/lib on the basis of category tagged.
i.e. if an item A is tagged with cat X,Y it should be show in both cat when we filter.
What approach i should i use in Sharepoint 2013?

you can use the taxonomy to achieve this behaviour. Generate Term sets and terms in it and use them to tag your List Item.
You didnt provide the details about how you are searching the data? by your code or the OOTB sharepoint search ?
Thanks

Related

How to filter django-taggit top tags

Suppose you have a database with User objects running behind a Djano app
and you want to use django-taggit to tag User objects so you can retrieve subgroups using some convenient filtering.
Additionally you have a Dashboard where you want to display interesting statistics about used tags to glean some information about the subgroups that exists within your Users.
How would you access and display information about the top X tags
used within the Django app?
How would you access only the top X tags of an already filtered
subgroup of the User object?
While there are already a number of posts on SO that describe similar problems most of these describe workarounds or contain scattered information.
In order to make this information easier to find I will post a simple rundown of how to achieve some basic stuff using features of django-taggit that are officially supported but are not present in the official documentation.
How would you access and display information about the top X tags
used within the Django app?
In order to access and display information about the top tags used within the Django app you can use the built in function most_common like so:
top_tags = User.tag.most_common()
This returns a queryset containing all of the tags placed on a User instance ordered from most used descending order.
So say we have 3 tags: ["vegetables", "fruits", "candy"] and 10 users have a fruits tag, 4 users have a vegetables tag and only 1 user has the candy tag the returned order would be: ["fruits", "vegetables", "candy"]
Accessing more information about the tags returned can be done like so:
for tag in top_tags:
print(tag.name) #the name of the tag
print(tag.num_times) # the number of User objects tagged
Additionally if you are only interested in the top 3 tags then you can
access them like this:
top_tags = User.tag.most_common()[:3]
Where you can replace 3 with X where X is the number of items you want returned.
How would you access only the top X tags of an already filtered
subgroup of the User object?
Since Jul 12, 2016 the most_common() function actually has some additional arguments that you can specify. First of all you can specify a min_count which filters out the top tags that fall below a certain threshold. As an illustration using the tags from the previous example:
top_tags = User.tag.most_common()[:3]
returns all three tags as specified earlier but using
top_tags = User.tag.most_common(min_count=2)[:3]
only returns ["fruits", "vegetables"] this is because only 1 User object was tagged with candy meaning that it falls below the min_count of 2
An additional argument that you can provide to most_common is extra_filters this enables you to provide an object containing additional filter values that you want to filter the tags by.
One usage example would be:
filtered_users = User.objects.filter(age=20, is_delete=False)
top_tags = User.tag.most_common(
min_count=1, extra_filters={
'user__in': filtered_users
}
)
Here we create a filtered queryset of User objects that we then provide to the extra_filters argument to limit the tag search to a specific subgroup

Using Sitecore query in Field 'source' not working properly

I am using a sitecore query in a source for a field Subsidiary:
/sitecore/content/Home/Organization/descendant::*[##templateid='{8BE84E6C-CAA3-4D03-9FD2-B95B89A7DDE0}']
Field Type is : Droplist
So in When I see the item which is based on the above template and I click on the field, I don't see any thing.
You can also see the images for more detail.
This is template where I am giving the above query in the source.
This is what I see on the item in the field Subsidiary
You need to prefix your xpath with query:
query:/sitecore/content/Home/Organization/descendant::*[##templateid='{8BE84E6C-CAA3-4D03-9FD2-B95B89A7DDE0}']
You can also use the shorthand for descendant:::
query:/sitecore/content/Home/Organization//*[##templateid='{8BE84E6C-CAA3-4D03-9FD2-B95B89A7DDE0}']

Get products according to chosen value

I am creating a shop with Opencart 1.5.6 & I'm new to opencart & php so please help me
I searched a lot but all of results are talking about adding a filter in SORT drop down list like manufacturer ..
but I don't want to sort,
I added a new custom field called COLOR to product and i want to create a new drop down list contains RED,BLUE,& BLACK options and it will get all the products with this chosen color.
I tried to create a drop down list like "Sort By:" one,
but i can't because i have no experience with PHP or Opencart.
PLEASE HELP ME !! and thanks in advance :)
As you said you are beginner so just go through step by step
In Opencart there is a feature called filter which exactly fulfills your requirement
**Step1 (Creating Filter)**
Admin panel>catalog>filter>Inset a new filter
->Filter Group Name "Color".
->click on add filter and add your colors "Red, Green, Blue...."
**Step2 (Adding Filter attribute to Product)**
Admin panel>catalog>products>edit product
->under the link tab there is a filter add the filter to product you want
eg if the product is red in color add "red"
->Do this to all product you wanted to be filtered.
**Step3 (Adding Filter Scope to category)**
Admin panel>catalog>categories>edit category
->under the data tab there is a filter add the filter you want to be displayed like "red, green etc.."
->Do this to all category you wanted filter to be displayed.
**Step4 (Enable Filter module or setting layout)**
Admin panel>Extensions>Modules
->Find Filter and click on install
->Now Edit the filter
->click on add module
->Set Layout to Category, Position to Content Top and Status to Enable
->Click on Save
Now you are done, In category you can see the filter feature in category,
If you still find difficulties you can follow the official documentation http://docs.opencart.com/display/opencart/Filters
Hope this helps.

Opencart: i need to search any product inside subcategories

I'm trying to create a menu with buttons that can filter products by main categories
This query url finds products inside a category:
/index.php?route=product/category&path=61
i can find only a part of products with a subcategory search.
/index.php?route=product/category&path=61_72_73
I need to NOT LINK products with their category parents, so is there a way to search with a subcategory filter?
I tried something like this:
/index.php?route=product/category&path=61&sub_category=true
But this doesn't work, it works only with textual searches like this one:
/index.php?route=product/search&search=chair&category_id=61&sub_category=true
ModelUse 'Advanced Product search for OpenCart'. You can search sub categories and any filters you add (including custom ones) with it.
http://www.opencart.com/index.php?route=extension/extension/info&token=460e88e8227b9d7e80466e026dbe1f64&extension_id=13605
I use it for a car dealer website with filters like year, make, model (and sub categories of those) etc and it works great for me.
Here's a demo link:
extension demo link
Try
index.php?route=product/search&search=%25&category_id=25&sub_category=true
25 is category id (which is not mandatory)
and search=searchterm is for a sting search in all sub categories
search=%25 means all products
search field name has changed at some of past version try this for 1.5.4.1
index.php?route=product/search&filter_name=%25&filter_category_id=20&filter_sub_category=true
and see here
http://demo.opencart.com/index.php?route=product/search&filter_name=a&filter_category_id=20&filter_sub_category=true

Sitecore - Validate a drop list value change event

I have a sitecore item, "category", which has a drop link which populate "product type" template list.
Each category can have a "product type".
(Products being created under a category node will be using the template selected in the drop down. e.g. Shoes category will have a Shoes template, Slippers category will also have a shoes template, Bags category will have a bags template).
Problem:
These categories should be able to mark related categories. Therefore I need to show a treelist kind of a control which only allows options to select categories with same "product type".
Under "Shoes" category, I need to have "Slippers".
How can I do this?
After selecting "Slippers" as the related item to "Shoes", if the user tries to change the "product type" drop link value in "slippers", how can I warn the user that this product type has already linked to another category?
(Validation on saving the category item.)
Hope this is a common issue with Related items in Sitecore, yet I could not find a solution for this.
Your first problem, "marking related categories" is not clear to me what you want to achieve with it.
But if I understand you correctly, you want to select a product-type-template in the Category-item to let the editor create products of the chosen producttype below the Category-item.
You can resolve this by using the item:saved event on the Category-item:
- first check if you are saving an item of type Category but checking the template.
- If it is a Category-Item, read the value of the product-type droplink and on the fly add this template to the insert-option of the Category item.
Your second problem with the check on related items can merely handled the same way by using the item:saving event. Not the item:saved event because you want to do the check before the item is saved so you can cancel the saving and display a messagebox through the Sitecore.Web.UI.Sheer.SheerResponse.Alert() method.
In the item:saving event you need to check if the current item has 1 or more referrers (items that link to this item) through the LinkDatabase method Globals.LinkDatabase.GetReferrers().
Using validation on this instead of the item:saving event is not usefull because the validation event only throws a warning and saves the item anyway.
Another good link with example code is this blog of John West.