GithubHelp home page GithubHelp logo

wn-locationtowns-plugin's Introduction

Location Town plugin for WinterCMS

This plugin is a fork of VojtaSvoboda.LocationTown, migrated to WinterCMS

Adds towns to states managed by Winter.Location plugin. Included:

  • component for state towns with pagination
  • component for Town detail
  • hooks for Winter.Sitemap
  • extends Winter State model

Required plugins: Winter.Location.

Tested with the latest stable WinterCMS 1.1.3.

Render Town detail

This component render town detail. Just create page Town-detail with slug /town-detail/:slug? and insert Town component:

Town component

To override Town detail template just create partial file /town/default.htm as copy of /plugins/planetadeleste/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 created above:

Towns component

To override Towns listing template just create partial file /towns/default.htm as copy of /plugins/planetadeleste/components/towns/default.htm and make own changes.

Add towns to sitemap

Just install Winter.Sitemap plugin and insert one town or all towns to sitemap:

Towns in sitemap

Services

List of available services provided by plugin:

locationtowns service

$towns = App::make('locationstown');
$town = $towns->findOneBySlug('praha');
$allTowns = $towns->all();
$townsByState = $towns->where('state_id', 285)->get();

Winter State extension

$state = \Winter\Location\Models\State::find('285');
$towns = $state->towns;

TODO

  • !!fix fixed URL path at Town:114 and Town:129 (there should by path set in component)
  • !filter only by active states in towns component
  • directly extend Winter.Location.State form to manage towns related to this state
  • run plugin without Winter.Location (only town management)
  • add select box 'country' to backend listing for filtrating states
  • it is not possible to do october:down
  • add import and export

Feel free to send pullrequest!

Contributing

Please send Pull Request to master branch.

License

LocationTown plugin is open-sourced software licensed under the MIT license same as OctoberCMS platform.

wn-locationtowns-plugin's People

Contributors

vojtasvoboda avatar alvaro-canepa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.