- component for state towns with pagination
- component for Town detail
- hooks for RainLab.Sitemap
- extends RainLab State model
Render Town detail
This component render town detail. Just create page Town-detail with slug
/town-detail/:slug? and insert Town component:
To override Town detail template just create partial file
/town/default.htm as copy
/plugins/vojtasvoboda/components/town/default.htm and make own changes.
Render list of Towns
Create page Towns with slug
/towns/:page? where page means paginating. Insert
component Towns. Set filter for State and select page for show Town detail
To override Towns listing template just create partial file
/towns/default.htm as copy
/plugins/vojtasvoboda/components/towns/default.htm and make own changes.
Add towns to sitemap
Just install RainLab.Sitemap plugin and insert one town or all towns to sitemap:
List of available services provided by plugin:
$towns = App::make('locationstowns'); $town = $towns->findOneBySlug('praha'); $allTowns = $towns->all(); $townsByState = $towns->where('state_id', 285)->get();
RainLab.Location State extension
Get all towns within state:
$state = \RainLab\Location\Models\State::find('285'); $towns = $state->towns;
If you want to extend some plugin and don't know how, check Brands extending examples repository, where you can find many examples which can be applied on every plugin including this one.
LocationTown plugin is open-sourced software licensed under the MIT license same as OctoberCMS platform.
Icon made by Freepik from www.flaticon.com.
Add composer.json, minor fixes for OctoberCMS stable release
Jul 12, 2016
Fix YAML config paths for last OctoberCMS build
Apr 11, 2016
Add cs_CZ locale
Feb 27, 2016
Make all fields and labels translatable
Feb 27, 2016
Fix backend form and listing labels
Feb 23, 2016
Add localization for Brazil Portuguese, thanks to Amanda Tresbach
Feb 22, 2016
First version of LocationTown
Jan 25, 2016