perlkonig / grav-theme-knowledge-base Goto Github PK
View Code? Open in Web Editor NEWA basic knowledge base theme
Home Page: https://www.perlkonig.com/knowledge-base
License: MIT License
A basic knowledge base theme
Home Page: https://www.perlkonig.com/knowledge-base
License: MIT License
I (still) love this theme and have it in use.
I've had quite some trouble updating it from 1.5 to GRAV 1.6.26.
Eventually I've got it to work, and it is still works like a charm!
It would be great (for new users) if the skeleton could be updated to the latest GRAV 1.6.x version
So that it looks equally nice on desktop PC/mobile/tablets, etc.?
Thanks!
I am developing a website for books and poetry with this excellent theme, but when I list a category with many elements, I get a very long list
Is it possible to sort articles by title?
Thanks a lot for your wonderful theme that i have easily followed and implemented a knowledge base on a GRAV site.
Please. I need your help in excluding certain categories from the knowledge base. Because, I also have a blog, news and events section on the site. So i want only the knowledge base categories to appear in the knowledge base.
I understand that this is the loops that display the categories of the knowledge base
{% for cat in taxonomy.taxonomy['category']|keys|sort|slice(0,maxrows*2) %}
{% set node = node|merge([cat]) %}
{% if node|length == 2 %}
{% set rows = rows|merge([node]) %}
{% set node = [] %}
{% endif %}
{% endfor %}
I have tried modifying it to this to see if i can filter the categories but still not working
{% for cat in taxonomy.findTaxonomy({'category':['Housing','Programme']})|keys|sort|slice(0,maxrows*2) %}
{% set node = node|merge([cat]) %}
{% if node|length == 2 %}
{% set rows = rows|merge([node]) %}
{% set node = [] %}
{% endif %}
{% endfor %}
Thanks for your kind help.
Hello Aaron,
I am not sure if this is an issue on Knowledge Base theme, or generic configuration issue on my Grav CMS.
I have started to put content on my web site. So far only 1 topic per categories. And I have only 3 categories so far. When I click on any categories, e.g. Grav CMS, I got error 404. The URL of the missing content is for instance http://<my domain>/taxonomy?name=category&val=Grav%20CMS
.
So unlike on the demo page https://www.perlkonig.com/knowledge-base/
where I can access any categories, e.g. Topic 1, I get error 404 on my web site.
What could be the cause of this issue? Or is it because I missed installing any other plugins a part from the required ones? If so, which one please?
Thanks a lot in advance for your help.
Kind regards,
Anto
Firstly, thanks for a great theme!
But I wonder how to use the new cetegory page template. You write "Categories can now have landing pages" but how do I get that to work?
I would like to exclude the search bar and sidebar from some specific pages, e.g. http://<my domain/about. How would I be able to do that?
Is customising this theme using Theme Inheritance method the only way to achieve that?
Thanks a lot in advance
I'm trying to decipher why this is part of template item.html.twig
:
<section class="comments">
<h2>{{ 'COMMENTS'|t }}</h2>
</section>
Is there any reason for it? Is there any plugin this is dependable on? If so, could it please show it only when that plugin is available and enabled?
Thanks.
The menu items don't go to the next line when the width is smaller. The Website Title does however..
To prevent displaying 'Comments' at the bottom of an article when the comments plugin is not activated might I suggest adding a check at line 71 of item.html.twig:
{% if config.plugins.comments.enabled %}
<section class="comments">
<h2>{{ 'COMMENTS'|t }}</h2>
</section>
{% endif %}
My environment.
Grav v1.6.28
Theme : Knowledge Base v2.1.1
CentOS Linux release 7.9.2009 (Core)
PHP 7.3.25 (cli) (built: Nov 24 2020 11:10:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.25, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.25, Copyright (c) 1999-2018, by Zend Technologies
http://localhost/taxonomy?name=category&val=Orange
Error!
Woops. Looks like this page doesn't exist.
Hello.I love this theme. Please check when you have time.
thanks.
@Perlkonig Hi, any idea why I'm getting empty frontpage, please? Thanks.
I would like to be able to tell what to show on homepage, meaning how to list articles and which on homepage. I.e.:
Combobox with this options
Would it be possible?
Is there a compelling reason to display (again) all page.media.images at the end of a page?
item.html.twig:
<section class="content">
{{ page.content }}
<p></p>
{% for image in page.media.images %}
{{ image.cropResize(700, 400).html("title", "alt", "itemscreenshot") }}
{% endfor %}
</section>
Is it possible to define a frontmatter-variable to suppress this?
e.g. show_pagemedia
{% if page.header.show_pagemedia %}
{% for image in page.media.images %}
{{ image.cropResize(700, 400).html("title", "alt", "itemscreenshot") }}
{% endfor %}
{% endif %}
The last category is missing from list, when the number of categories is odd.
For example, say you have 5 categories, and only the first 4 are displayed, the 5th is missing. If you create a new category to make the total 6, all are displayed.
When inheriting from the knowledge-base
theme, one might wish to change the theme config in the derived theme, without touching the original. And while Grav apparently does not inherit a base theme's config, this can be achieved by copying over the param
section of user/themes/knowledge-base/knowledge-base.yaml
into the derived theme's config file (underneath or above the streams
section responsible for the inheritance).
However, knowledge-base
is accessing the theme config via config.themes['knowledge-base']
, using the hardcoded theme name. This is null
in a derived theme. Only config.themes['derived-theme']
(assuming the name of the child theme to be derived-them
) is defined there. This leads to at least two issues:
This issue has also been present in the deliver
theme, leading to this issue, for example. The last reply there also outlines the solution:
Add the following at the top of the base template:
{% set theme_config = attribute(config.themes, config.system.pages.theme) %}
This is already present in the knowledge-base\templates\partials\base.html.twig
, but never used.
theme_config
instead of config.themes['theme-name']
in all template files.theme_config
will evaluate to config.themes['knowledge-base']
if the theme is used directly (hence, everything works exactly as before) and to config.themes['derived-theme']
in a derived theme. As per Flavio Copes' reply linked above, this is how it should be done.
Implementing this is as trivial as a search and replace in the template files. However, I'm not sure if this could potentially break existing setups for users? I don't think it should, though. Also, I'm wondering why no other users have reported this issue, while there apparently are people who do inherit from knowledge-base
, as evident by this issue report. Shouldn't the sidebar be missing for them, amongst other issues? Maybe I am missing or confusing something here.
Side note: I think this is a bit of an issue with Grav. One would expect that if a specific config setting is not present in the derived theme's config, Grav would go looking in the base theme's config. This is what the tutorial about theme inheritance implies when it says "You can of course customize any part of the original base-theme". However, as per my testing as well as the forum link above, this seems not to be the case, making the whole them inheritance a bit inconsistent / counter-intuitive.
@Perlkonig Do you think it would be possible to make this theme more "optional", meaning On/Off switches which will show or hide parts of pages? I.e.:
etc.?
I'm trying to create inherited theme, but as I have submitted here getgrav/grav#1353 it doesn't seem to be working.
Any idea what could be wrong? Thank you.
When we use subdirectories in the HOME folder, the component Last articles of the sidebar doesn't work well. It tries to display the parents directories as an article, but not the articles in the subdirectories.
I see in the code that this is related to that line.
{% set articles = page.find(homeroute).children.order('date', 'desc') %}
But I don't have enough skills with twig & co to be able to propose a fully working PR.
i would like to add two front
type pages in my post? but it shows the same content when i have posted in a article?
For some reason that I couldn't figure out yet the related pages are not showing up. But there a quiet a few pages that contain the same tags and fit into the same category.
Did I configure the plugin wrong? Is there something missing in the theme that I should watch out for?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.