Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multistore absolute image URL in common/header.tpl #529

Closed
Urs-Bruelhart opened this issue Mar 10, 2013 · 4 comments
Closed

Multistore absolute image URL in common/header.tpl #529

Urs-Bruelhart opened this issue Mar 10, 2013 · 4 comments

Comments

@Urs-Bruelhart
Copy link
Contributor

The image source for the value ?php echo $logo is absolute set to the default store instead only relative:

Actually it is parsed like:
img src="http://main-store/image/data/logo-lfs-schweiz.png"

Better would be:
img src="/image/data/logo-lfs-schweiz.png"

@ghost
Copy link

ghost commented Mar 11, 2013

Nope ! CDN users would like to use full url.

@Khaleel
Copy link

Khaleel commented Mar 11, 2013

I agree. Ignore this about that URL. You don't know what your talking about. You could do

$image="//www.site.com/folder" and remove the HTTP for relative protocol detection. Our store is heavy in traffic therefore we use a custom CDN or Rackspace Cloud Files.

@Urs-Bruelhart
Copy link
Contributor Author

I am sorry, in this case it would be better to have the URL from the store instead of the main-store. Probably it was not clear enough explained.

@opencart
Copy link
Collaborator

this does not happen! maybe in older versions.

this code changes it:

    if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
        $server = $this->config->get('config_ssl');
    } else {
        $server = $this->config->get('config_url');
    }

    $this->data['base'] = $server;
    $this->data['description'] = $this->document->getDescription();
    $this->data['keywords'] = $this->document->getKeywords();
    $this->data['links'] = $this->document->getLinks();  
    $this->data['styles'] = $this->document->getStyles();
    $this->data['scripts'] = $this->document->getScripts();
    $this->data['lang'] = $this->language->get('code');
    $this->data['direction'] = $this->language->get('direction');
    $this->data['google_analytics'] = html_entity_decode($this->config->get('config_google_analytics'), ENT_QUOTES, 'UTF-8');
    $this->data['name'] = $this->config->get('config_name');

    if ($this->config->get('config_icon') && file_exists(DIR_IMAGE . $this->config->get('config_icon'))) {
        $this->data['icon'] = $server . 'image/' . $this->config->get('config_icon');
    } else {
        $this->data['icon'] = '';
    }

    if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) {
        $this->data['logo'] = $server . 'image/' . $this->config->get('config_logo');
    } else {
        $this->data['logo'] = '';
    }       

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

No branches or pull requests

2 participants