thelia/selection-module
Composer 安装命令:
composer require thelia/selection-module
包简介
README 文档
README
This module allows you to create a selection of products or contents of similar themes (Best sellers, Best rated by women, .. for example). The selection will then be displayed as list of those products or contents.
Compatibility
- To use this module on Thelia 2.3.x, use the tag 1.1.9
Installation
Manually
- Copy the module into
<thelia_root>/local/modules/directory and be sure that the name of the module is Selection. - Activate it in your thelia administration panel
Composer
Add it in your main thelia composer.json file
composer require thelia/selection-module:~1.1.11
Usage
Once activated, a new button called "Selection" will appear in the tool menu on the left sidebar of the admin panel. Clicking on it will redirect you to the list of all the selections you've created so far.
Once on the page with all your selections you may :
- Create a new selection by clicking on the + button at the top right of the page.
- Toggle the visibility of your selection (whether people will see it or not) by clicking on the "Online" button in front of the selection you wish to make visible or invisible.
- Edit an already created selection by clicking on its name or on the cog button then on the pencil button in front of the selection you wish to edit.
- Delete a selection by clicking on the cog button then on the trash button in front of the selection you wish to delete.
You may then display your selection on your website by calling the selection_list loop.
Hook
This module has a single hook in the back office, adding the Selection button to the tools menu of the sidebar on the left, redirecting to the list of selection.
Loop
[selection_list]
This loop returns a list of selections. You can use it to display the selections you've created in your website.
Input arguments
| Variable | Description |
|---|---|
| id | A string containing the IDs of all the selections you wish to display. To get the ID of the current rewritten URL, use : $app->request->get('selection_id') in your template |
| code | A string containing one or more codes of the selections you wish to display. |
| exclude_code | A string containing one or more codes of the selections you wish to exclude from the loop results. |
| title | The title of the selection you wish to display |
| visible | Whether your selection will be visible or not. Default : true |
| position | The position of the selection you wish to display |
| exclude | A string containing the IDs of all the selections you wish not to display |
| order | A string with a value inside these values : 'id', 'id_reverse', 'alpha', 'alpha_reverse', 'manual', 'manual_reverse', 'visible', 'visible_reverse', 'created', 'created_reverse', 'updated', 'updated_reverse', 'random' |
| return_url | A boolean indicating if we want the url (cf BaseLoop) |
| without_container | A boolean indicating if we want to display selection that are not inside a container only |
| container_id | The container id to query only the selections inside that container |
Output arguments
| Variable | Description |
|---|---|
| SELECTION_ID | The ID of the current Selection |
| SELECTION_CODE | The code of the current Selection |
| SELECTION_TITLE | The title of the current Selection |
| SELECTION_DESCRIPTION | The description of the current Selection |
| SELECTION_CHAPO | The chapo of the current Selection |
| SELECTION_POSTSCRIPTUM | The postscriptum of the current Selection |
| SELECTION_VISIBLE | Whether the current selection is visible or not |
| SELECTION_POSITION | The position of the current selection |
| SELECTION_URL | The URL of the current selection |
| SELECTION_CONTAINER_ID | The id of the container associated to the current Selection |
Exemple
{loop name="selection_list" type="selection_list" visible=true id='1,4'}
This selection id : {$SELECTION_ID}
This selection title : {$SELECTION_TITLE}
This selection code : {$SELECTION_CODE}
This selection status : {$SELECTION_VISIBLE}
This selection description : {$SELECTION_DESCRIPTION}
This selection chapo : {$SELECTION_CHAPO}
This selection url : {$SELECTION_URL}
This selection postscriptum : {$SELECTION_POSTSCRIPTUM}
This selection position : {$SELECTION_POSITION}
{/loop}
[selection_image]
This loop returns the images related to a selection.
Input arguments
Input Arguments are extended by Thelia\Core\Templates\Loop\Image
Output arguments
Output Arguments are extended by Thelia\Core\Templates\Loop\Image
Exemple
{loop type="selection_image" name="selection_image" source="selection" source_id=$SELECTION_ID limit="1" visible="true"}
{/loop}
[selection_container]
This loop returns a list of selections containers. You can use it to display the selections containers you've created in your website.
Input arguments
| Variable | Description |
|---|---|
| id | A string containing the IDs of all the selections containers you wish to display. To get the ID of the current rewritten URL, use : $app->request->get('selection_id') in your template |
| code | A string containing one or more codes of the selection containers you wish to display. |
| exclude_code | A string containing one or more codes of the selection containers you wish to exclude from the loop results. |
| selection_id | The selection id to find |
| need_selection_count | boolean indicating if we want to have the number of selection inside this container |
| title | The title of the selection you wish to display |
| visible | Whether your selection will be visible or not. Default : true |
| position | The position of the selection you wish to display |
| exclude | A string containing the IDs of all the selections you wish not to display |
| order | A string with a value inside these values : 'id', 'id_reverse', 'alpha', 'alpha_reverse', 'manual', 'manual_reverse', 'visible', 'visible_reverse', 'created', 'created_reverse', 'updated', 'updated_reverse', 'random' |
| return_url | A boolean indicating if we want the url (cf BaseLoop) |
Output arguments
| Variable | Description |
|---|---|
| SELECTION_CONTAINER_ID | The ID of the current container |
| SELECTION_CONTAINER_TITLE | The title of the current container |
| SELECTION_CONTAINER_CODE | The code of the current container |
| SELECTION_CONTAINER_DESCRIPTION | The description of the current container |
| SELECTION_CONTAINER_CHAPO | The chapo of the current container |
| SELECTION_CONTAINER_POSTSCRIPTUM | The postscriptum of the current container |
| SELECTION_CONTAINER_VISIBLE | Whether the current container is visible or not |
| SELECTION_CONTAINER_POSITION | The position of the current container |
| SELECTION_CONTAINER_URL | The url of the current container |
| SELECTION_COUNT | The number of selections in the current container |
Exemple
{loop name="selection_container" type="selection_container" visible="*" backend_context="1" lang=$lang_id order=$selection_container_order}
{$SELECTION_CONTAINER_ID}<br>
{loop type="selection_image" name="selection_image" lang="$edit_language_id" source="selection" source_id=$SELECTION_CONTAINER_ID width="70" height="50" resize_mode="borders" limit="1" visible="true"}
<img class="img-thumbnail" src="{$IMAGE_URL nofilter}" href="{url path="admin/selection/container/update/%selectionContainerId" selectionContainerId=$SELECTION_CONTAINER_ID}">
{/loop}
{{$SELECTION_CONTAINER_ID}}<br>
{$SELECTION_CONTAINER_TITLE}<br>
{$SELECTION_CONTAINER_POSITION}<br>
{/loop}
thelia/selection-module 适用场景与选型建议
thelia/selection-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.36k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 04 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 thelia/selection-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 thelia/selection-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2018-04-06