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

Have more than one cta button in header overlay #1461

Closed
Sciss opened this Issue Jan 9, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@Sciss

Sciss commented Jan 9, 2018

  • This is a question about using the theme.
  • This is a feature request.
  • I believe this to be a bug with the theme.
    • I have updated all gems with bundle update.
    • I have tested locally with bundle exec jekyll build.

Environment informations

  • Minimal Mistakes version: 4.9.0
  • Jekyll version: 3.6.2
  • GitHub Pages hosted: no
  • Operating system: Linux Debian

Hi! In my "old" web site I used multiple buttons in the index.md; it's straight forward in the body of the markdown. However, now I'm migrating, and I think I want to use the header overlay image; so my idea is to use the CTA option for buttons.

The question is: is there a way to have more than one cta_label / cta_url? If not, what would be the best approach to implement such layout? I attach a mock up of how I imagine the result.

three_cta_mock

@mmistakes

This comment has been minimized.

Show comment
Hide comment
@mmistakes

mmistakes Jan 10, 2018

Owner

No not currently, the overlay was designed for a single call to action button. You'll need to hack something together right now.

I could potentially treat it similar to one of my other themes, where you feed it an array of action buttons, but I'll have to give that some more thought.

Sample code would be something like:

{% if page.header.actions %}
  <p>
  {% for action in page.header.actions %}
    <a href="{{ action.url }}" class="btn btn--light-outline btn--large">{{ action.label }}</a>
  {% endfor %}
{% endif %}

And then you'd have some YAML like in the post/page:

header:
  actions:
    - label: "News"
      url: "/news/index.html"
    - label: "Contact"
      url: "/contact/index.html"
Owner

mmistakes commented Jan 10, 2018

No not currently, the overlay was designed for a single call to action button. You'll need to hack something together right now.

I could potentially treat it similar to one of my other themes, where you feed it an array of action buttons, but I'll have to give that some more thought.

Sample code would be something like:

{% if page.header.actions %}
  <p>
  {% for action in page.header.actions %}
    <a href="{{ action.url }}" class="btn btn--light-outline btn--large">{{ action.label }}</a>
  {% endfor %}
{% endif %}

And then you'd have some YAML like in the post/page:

header:
  actions:
    - label: "News"
      url: "/news/index.html"
    - label: "Contact"
      url: "/contact/index.html"

Sciss added a commit to Sciss/minimal-mistakes that referenced this issue Jan 10, 2018

@Sciss

This comment has been minimized.

Show comment
Hide comment
@Sciss

Sciss Jan 10, 2018

Brilliant that works (Sciss@7b7970e). Thanks so much!

Sciss commented Jan 10, 2018

Brilliant that works (Sciss@7b7970e). Thanks so much!

@lthurner

This comment has been minimized.

Show comment
Hide comment
@lthurner

lthurner Aug 20, 2018

+1 for adding this extension in the general layout

lthurner commented Aug 20, 2018

+1 for adding this extension in the general layout

@mmistakes mmistakes closed this in 68df0b6 Sep 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment