Class AddSortLinkProcessor
java.lang.Object
org.broadleafcommerce.presentation.dialect.AbstractBroadleafAttributeModifierProcessor
org.broadleafcommerce.core.web.processor.AddSortLinkProcessor
- All Implemented Interfaces:
org.broadleafcommerce.presentation.dialect.BroadleafAttributeModifierProcessor,org.broadleafcommerce.presentation.dialect.BroadleafProcessor
@Component("blAddSortLinkProcessor")
@ConditionalOnTemplating
public class AddSortLinkProcessor
extends org.broadleafcommerce.presentation.dialect.AbstractBroadleafAttributeModifierProcessor
A Thymeleaf processor that generates a search query href that will reflect the current search criteria in addition to the requested sort string
This is intended to be used in an anchor tag:
<a blc:addsortlink="price">Sort By Price</a>
Produces:
<a class="asc" href="http://mysite.com/category?sort=price+asc">Sort By Price</a>
This sort link can then be picked up by the BroadleafCategoryController to actually translate search queries based
on that query parameter. If there is no sort active on the request then this will print out a link to sort ascending.
Otherwise the link will output the non-active sort (so that you can switch between them).
- Author:
- apazzolini
-
Field Summary
FieldsFields inherited from interface org.broadleafcommerce.presentation.dialect.BroadleafProcessor
DEFAULT_PRECEDENCE, DEFAULT_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.broadleafcommerce.presentation.model.BroadleafAttributeModifiergetModifiedAttributes(String tagName, Map<String, String> tagAttributes, String attributeName, String attributeValue, org.broadleafcommerce.presentation.model.BroadleafTemplateContext context) getName()intMethods inherited from class org.broadleafcommerce.presentation.dialect.AbstractBroadleafAttributeModifierProcessor
getPrefix, useSingleQuotes
-
Field Details
-
allowMultipleSorts
protected boolean allowMultipleSorts
-
-
Constructor Details
-
AddSortLinkProcessor
public AddSortLinkProcessor()
-
-
Method Details
-
getName
-
getPrecedence
public int getPrecedence()- Specified by:
getPrecedencein interfaceorg.broadleafcommerce.presentation.dialect.BroadleafProcessor- Overrides:
getPrecedencein classorg.broadleafcommerce.presentation.dialect.AbstractBroadleafAttributeModifierProcessor
-
getModifiedAttributes
-