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

base_url returns only / #17

Open
JohnMica opened this issue Jun 15, 2017 · 5 comments
Open

base_url returns only / #17

JohnMica opened this issue Jun 15, 2017 · 5 comments

Comments

@JohnMica
Copy link
Contributor

Not sure where this is coming from, grav is at the latest, admin latests, plugins latest.
Archives seems to work ok
Archives plus just keeps returning / instead of the current url
What details do you want ? I can try to provide them.

It could be on my part, my theme is sort of updated, but not sure this is the case or not.

@Sommerregen
Copy link
Owner

Hi @JohnMica ,

which Archive Plus version are you using? Do you use the stable (master) release or the develop version? In case of the develop version, it may can break something. I just pushed something, but haven't tested it so far.

Otherwise can you provide me with a MWE (the line in the Twig file or an example that shows your issue)?

@JohnMica
Copy link
Contributor Author

JohnMica commented Jun 16, 2017

Using v1.3.2 of Archives-Plus and the twig lines are as it follows:

                    <a href="{{ base_url }}/{{ 'PLUGINS.ARCHIVE_PLUS.NAME'|t }}{{ config.system.param_sep }}{{ year|e('url') }}">
                        <span class="archive_year">{{ year }}</span>
                    </a>

    {% set short_month = 'PLUGINS.ARCHIVE_PLUS.SHORT_MONTHS' | ta(month - 1) %}
                                    <a href="{{ base_url }}/{{ 'PLUGINS.ARCHIVE_PLUS.NAME'|t }}{{ config.system.param_sep }}{{ (short_month ~ '_' ~ year)|lower|e('url') }}">
                                        <span class="archive_month">{{ 'PLUGINS.ARCHIVE_PLUS.MONTHS'|ta(month-1) }}
                                            {{ year }}</span>
                                    </a>

    {% if archive_plus.show_more %}
            <a class="button" href="{{ base_url }}/{{ 'PLUGINS.ARCHIVE_PLUS.NAME'|t }}{{ config.system.param_sep }}">{{ 'PLUGINS.ARCHIVE_PLUS.SHOW_MORE'|t }}</a>
        {% endif %}

hope this helps it's in the partial twig that comes with it.

@Sommerregen
Copy link
Owner

Ok, that helps a little bit. {{ base_url }} is taken from the theme, more precisely from Grav core. I don't know what you expect, but for nested pages the above only links to the "root". That is a common problem and it might be solved, if we use {{ page.url }} or something similar.

Can you tell me, what do you expect?

@JohnMica
Copy link
Contributor Author

nice, the expectation is when you click the archives to have the following behaviour:

  • click year - go to current page, filter by year published (or go to blog filter by year)

  • click month - go to current page, filter by year and month (or blog filter by year and month)

  • click article title - go to article link

In the case the archives are a page collection by themselves then go to that page and apply the filters as above.

I guess this is what I would understand as functionality for the archives.

the original archives does apply the filtering on the current page however, the dates are not translated - i could manually do that by using the localised to where the site is located, but it is not dynamic .

@Sommerregen
Copy link
Owner

Hi @JohnMica ,

thanks for your detailed explanation. I will mark this issue as enhancement here and I will implement your requested behaviour. As for now I have to make Archive Plus even with the Grav Team's Archive plugin as there were some new changes that should be also contained in this fork (like the recently added filters capabilities). I will then have a look how to improve this plugin even more 😄

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

No branches or pull requests

2 participants