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

logo image #32

Open
zagwalker opened this issue Jul 21, 2019 · 4 comments
Open

logo image #32

zagwalker opened this issue Jul 21, 2019 · 4 comments

Comments

@zagwalker
Copy link

Hi,

Could not figure out is there any other method of implementing an image logo besides changing the code. Any suggestions?

Regards

@atomsmith
Copy link

I don't believe the theme offers any image logo features. For this reason and others, I used theme inheritance to do customization. In the inherited version of "templates\modular\footer.html.twig" I included the following block:

        <div class="footer-module large">
            <div class="logo">
                <img src="{{ page.find('/images').media[site.footer.logo].url }}" class="img-responsive img-centered" alt="{{ site.footer.logoalt }}">
                {% block social %}
                    {% include 'partials/social.html.twig' %}
                {% endblock %}

            </div>
            {% if site.footer.description %}
                <p>{{ site.footer.description }}</p>
            {% endif %}
        </div>

The logo and alternate text are defined in site.yaml:

footer:
    logo: my-logo.jpg
    logoalt: "Alternate text here"

The logo JPEG needs to be in the "pages\images" folder.

@zagwalker
Copy link
Author

Thanks a lot. I'll have a look on that.

@The-Steve
Copy link

The-Steve commented Aug 17, 2019

I don't believe the theme offers any image logo features. For this reason and others, I used theme inheritance to do customization. In the inherited version of "templates\modular\footer.html.twig" I included the following block:

        <div class="footer-module large">
            <div class="logo">
                <img src="{{ page.find('/images').media[site.footer.logo].url }}" class="img-responsive img-centered" alt="{{ site.footer.logoalt }}">
                {% block social %}
                    {% include 'partials/social.html.twig' %}
                {% endblock %}

            </div>
            {% if site.footer.description %}
                <p>{{ site.footer.description }}</p>
            {% endif %}
        </div>

The logo and alternate text are defined in site.yaml:

footer:
    logo: my-logo.jpg
    logoalt: "Alternate text here"

The logo JPEG needs to be in the "pages\images" folder.

@atomsmith, Thanks for this reply.

Slightly off-track, but for the same purpose, how exactly did you achieve "Template" inheritance? I was able to inherit the SCSS, but I am having a hard time inheriting the Deliver theme's templates.

The following just doesn't work.

{% extends "partials/base.html.twig" %}

{% block header %}
new header content here
{% endblock %}

{% extends "…/…/deliver/templates/partials/base.html.twig" %} This does not work either.

If it's possible, can you please write the steps that you followed while inheriting the templates. It would help a lot of us. Thanks in advance.

@atomsmith
Copy link

@The-Steve, I did not use template inheritance in the manner you are describing. Some of the things I wanted to adjust did not correspond neatly to blocks in the original theme. My process went something like:

  1. Use a browser's developer tools to find some unwanted aspect of the original theme.
  2. Decide that the change can't be accomplished in CSS alone.
  3. Find the block of Twig code responsible.
  4. Copy the enclosing Twig file from the base theme to the equivalent directory position in my theme.
  5. Edit the Twig to suit.

As an example, the original theme's "feature" blocks were not useful for the nonprofit organization website I was building. As I recall, just having the empty
<div class="feature-items"></div>
caused unwanted blank space on some of the pages. So my theme has a "features.html.twig" with that div completely deleted.

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

3 participants