Editon Theme bug on home page

Email signup text visible when user is logged in
-When logged OUT, email signup text is visible (this seems correct)
-When logged IN, email signup text is still visible (this seems correct)
-Expected that when logged OUT, email signup text visible and when logged IN, site description visible instead of email signup text

Steps to Reproduce

  1. Make sure email signup text and site description are populated
  2. Test site while logged in and while logged out to reproduce bug

Setup information

Ghost Version
Latest version of Ghost Pro

Browser & OS version
Reproducible in Chrome/Chromium/Firefox on Linux/Windows, iOS, etc.

Additional Notes
It appears from reading the code in cover.hbs that the logic for determining whether to display Site Description, Email Signup Text, or both (or neither) is incorrect.

1 Like

Thank you — I came here to post this bug. I saw it in every theme I checked.

1 Like

I almost want to just fork the Github repo for Edition, fix it, and then submit a merge request. However, maybe there is a better way for them to fix it globally. Guess we’ll see who is faster. :slight_smile:

For now I worked around this bug by not using a description nor email signup text; but it’s interesting to learn that you have observed it in other themes as well.

1 Like

I’d like to know accepting the repo maintainers are of PRs!

1 Like

Just to check - have you tried updating your version of the Edition theme to the latest?

I had done so the day I posted the bug, but I see now there may have been updates a day or two after that. I’ll try the latest and see!

Great, let me know how you get on.

As for contributing, there is some guidance in the README of our official themes.

This repo is synced automatically with TryGhost/Themes monorepo. If you’re looking to contribute or raise an issue, head over to the main repository TryGhost/Themes where our official themes are developed.

1 Like

Hi, I’m experiencing the bug on Ghost Pro w/ Casper v5.3.1 and Journal v1.0.0 and probably others too. Here you can see I’m logged in as an unpaid member, but still shown the Sign up link:

I described this bug in this GitHub Issue: Broken / wrong links when no paid plan is configured · Issue #154 · TryGhost/Themes · GitHub

1 Like

I updated to the latest following these instructions and the bug remains.

I think the bug is clear just from this section of code:

  <div class="cover-content">
        {{#if @site.description}}
            <div class="cover-description">
                {{#if @custom.email_signup_text}}
                    {{@custom.email_signup_text}}
                {{else}}
                    {{@site.description}}
                {{/if}}
            </div>
        {{/if}}

        {{#unless @member}}
            <form class="form-wrapper cover-form" data-members-form>
                <input class="auth-email" type="email" data-members-email placeholder="Your email address" required="true" autocomplete="false">

                <button class="form-button" type="submit" aria-label="Submit">
                    <span class="default">Subscribe</span>
                    <span class="loader">{{> "icons/loader"}}</span>
                    <span class="success">Email sent</span>
                </button>
            </form>
        {{/unless}}
    </div>

In my testing today after upgrading to latest, it does exactly what is described in the code:

  1. If Site Description and Email Signup Text are populated, it shows Email signup text while logged in or not
  2. If Email signup text only is populated, it shows nothing while logged in or not
  3. If Site Description only is populated, it shows description while logged in or not

Back to the code: it seems to say exactly that. It does test for membership, and hides the email address field if logged in (correctly); but I think it should also be hiding the Email signup text based on that test.

I’m unsure what the behaviour “should” be for displaying Site Description; it could logically be shown instead of the Email signup text, but it could also potentially be displayed above or below the Email signup text.

1 Like

Hmm - so I guess, with the Creator/$25 plan, we could fix these bugs on a theme-by-theme basis, uploading them as custom themes?

That is true; but we could also just fix them in the repo and do a PR. :slight_smile:

1 Like

This is a very quick fix which seems to work, although not necessarily formatted as one would like. It checks whether site.description is populated and displays it if so. It also checks whether custom.email_signup_text is populated and displays it so, unless the user is not a member.

I think the basic logic is sound, but that someone more skilled than I at Handlebars, CSS, and Ghost should probably do the needful. :slight_smile:

<div class="cover-content">
            <div class="cover-description">
                {{#if @site.description}}
                    {{@site.description}}
                {{/if}}
                {{#unless @member}}
                    {{#if @custom.email_signup_text}}
                        <br>{{@custom.email_signup_text}}
                    {{/if}}
                {{/unless}}
            </div>
        {{#unless @member}}
            <form class="form-wrapper cover-form" data-members-form>
                <input class="auth-email" type="email" data-members-email placeholder="Your email address" required="true" autocomplete="false">

                <button class="form-button" type="submit" aria-label="Submit">
                    <span class="default">Subscribe</span>
                    <span class="loader">{{> "icons/loader"}}</span>
                    <span class="success">Email sent</span>
                </button>
            </form>
        {{/unless}}
    </div>
1 Like

Interesting. But for me, I was planning up upgrading to the more expensive Ghost(Pro) after I successfully test it … not as a way for me to hack it into working condition. :stuck_out_tongue:

This has me considering self-hosting — although this is an area I wanted to buy, not build.

Your logic looks good to me.

On the upside, I’m impressed with how quickly the Ghost repo maintainers merge in PR’s.

But on the downside, I’m a little disappointed with the lack of UI / integration tests for this kind of thing. (I couldn’t find one, but maybe it’s set up somewhere.)

I also like to refactor branching out of templates in my code, and use polymorphic templates. So for example, I’d have a completely separate template that runs when the user is signed in. And sub-templates like maybe_show_signup_form. So the result would be short templates that read from top to bottom without if’s.

I think that the coding style in use here and lack of tests will result in these bugs re-occurring from time to time.

1 Like

FYI, I’ve found a workaround for the Dawn theme: hiding elements via Javascript. I can inject this into the site footer:

<script>
    $('button.members-upgrade').css('display', 'none')
</script>

This works for my issue of seeing links to “upgrade” even though I don’t have paid plans set up.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.