Skip to content

ViieeS/gl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Select location(city/region/country) for NewsPuplisher (MODx Revolution)

NewsPulisher select location sample

  1. Create gl.php file in /core/components/newspublisher/tvs/ with following content:

    <?php
    $formTpl .= $this->_displaySimple($name,
    	'GeoLocationTpl', $this->textMaxlength);
  2. Create npGeoLocationTpl chunk with following content:

    [[!gl.modal?
    	&class=`glCity`
    	&tpl=`tpl.gl.input`
    	&frontendJs=`[[+assetsUrl]]js/web/custom.js`
    	&frontendCss=`[[+assetsUrl]]css/web/custom.css`
    ]]
    

    &frontendCss=`[[+assetsUrl]]css/web/custom.css` - optional for Bootstrap 3 theming

  3. Create a TV with name City and input type: Геолокации (gl)

  4. Call NewsPulisher snippet with City TV listed in &show property:

    [[!NewsPublisher?
    	&show=`pagetitle,description,City,..`
    	...
    ]]
    

GL - Geo Location (MODx Revolution)

<p>
    Ваш город:
    <span class="gl-current-select">[[!+gl.current.city.name_ru]]</span>
</p>

[[!gl.modal?
	&class=`glCity`
]]

<h5>Реальное местоположение</h5>
<code>
[[!+gl.real.city.name_ru]]<br>
[[!+gl.real.region.name_ru]]<br>
[[!+gl.real.country.name_ru]]<br>  
</code>


<h5>Выбранное местоположение</h5>
<code>
[[!+gl.current.city.name_ru]]<br>
[[!+gl.current.region.name_ru]]<br>
[[!+gl.current.country.name_ru]]<br>
</code>

<h5>Контакты</h5>
<code>
phone: [[!+gl.current.data.phone]]<br>
email: [[!+gl.current.data.email]]<br>
</code>

About

GeoLocation (MODX Revolution)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 57.7%
  • JavaScript 36.2%
  • CSS 5.2%
  • Smarty 0.9%