0

I have the following code and after moving site to a live server, the img src is using the old domain, however, the anchor links have correct domain name. Any idea what the issue is?

                                {% for block in entry.threeHomepageImages.type('images') %}
                                    <div class="col">
                                        <div class="image-block">
                                            <div class="image">
                                                {% if block.image|length %}
                                                    <a href="{{ block.pageLink.first().getUrl() }}"><img src="{{ block.image.first.getUrl() }}" alt="{{ block.alt }}"></a>
                                                {% endif %}
                                            </div>
                                        </div>
                                        <h1><a href="{{ block.pageLink.first().getUrl() }}">{{ block.imageTitle }}</a></h1>
                                    </div>
                                {% endfor %}
3

Have you checked the path of the asset source the image is in? Sounds like that might still be the old server's path. Best practice is to use Environment-specific variables in your config file, and then use those in you Asset Source settings as well.

So, use {basePath}assets/site as your File System Path for instance (if you've used basePath as a config variable).

That way, it will adapt to whatever environment you're working on.

1
  • Duh. It was the asset url to folder. Thank you for the help.
    – frshjb373
    Sep 26 '14 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.