Skip to content

Conversation

@nick-denry
Copy link
Contributor

@nick-denry nick-denry commented Apr 2, 2018

I guess it is good to use another languages instead of fixed 'de' for the default map.

I'm not definitely sure if composition language is ok for the block view.

--

Set Google maps language to current compostion language instead of fixed 'de'.

Set Google maps language to the composition one instead of fixed 'de'.
Set Google maps language to the composition one instead of fixed 'de'.
@nick-denry nick-denry mentioned this pull request Apr 2, 2018
@nadar
Copy link
Contributor

nadar commented Apr 3, 2018

@nick-denry good point! yes the composition should be used, since 1.0.5 we should use Yii::$app->composition->langShortCode but your solution would work too.

You can close the issue #7 as this pull request is threated like an issue as well.

Maybe we should define the google maps i frame url inside the extraVars() so we don't mix between php and angular/js. And it would be more easy to maintain this in future.

Please also add a changelog entry here https://github.com/luyadev/luya-bootstrap3/blob/master/CHANGELOG.md.

Thank you for helping us making LUYA better! If you have any questions regarding issue, pr or changelog, just let me know.

Copy link
Contributor

@nadar nadar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Register an extra var like embedUrl which is resolved by a function like getEmbedUrl() in order to determine the iframe url (which is now done inside the view).

<? if ($this->cfgValue('snazzymapsUrl', false)): ?><?= $this->cfgValue('snazzymapsUrl', '') ?><? else: ?>https://maps.google.com/maps?f=q&source=s_q&hl=<?= \Yii::$app->composition['langShortCode']; ?>&geocode=&q=<?= $this->extraValue('address');?>&z=<?= $this->extraValue('zoom');?>&t=<?= $this->extraValue('maptype')?>&output=embed<? endif; ?>

@nadar
Copy link
Contributor

nadar commented Apr 4, 2018

@nick-denry regarding the extra var embed Url:

I just want to remove all this concant code from the view file. So we could contact and make the else if inside a method inside the block and deliver the result trough extraVars. So its easy to embed inside the admin and frontend.

public function extraVars()
{
    return ['embedUrl' => $this->getEmbedUrl()];
}

public function getEmbedUrl()
{
   if ..

  else 

   return 'the embed map url'
}

Do you know what i mean?

@nadar nadar merged commit fbb1af3 into luyadev:master May 7, 2018
nadar added a commit that referenced this pull request May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants