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

Category titles #51

Open
emanuele45 opened this issue Feb 24, 2016 · 1 comment
Open

Category titles #51

emanuele45 opened this issue Feb 24, 2016 · 1 comment

Comments

@emanuele45
Copy link
Contributor

This is a kind of shared issue between the addons server and Elk, but I'm filling in here because if there is anything to fix I feel it should start here.

In the server page in Elk, the category "title" is picked as the category... "shortname" (?) ucwords'ed:
https://github.com/elkarte/Elkarte/blob/development/sources/admin/PackageServers.controller.php#L180
and the name comes from the json at:
http://addons.elkarte.net/package.json
if I'm not wrong, generated with the template:
https://github.com/elkarte/addons/blob/gh-pages/package.json

Lurking here around, I noticed we have what I'd call a "full name" for the categories as well:
https://github.com/elkarte/addons/blob/gh-pages/categories/enhancement.html#L3 (the title parameter)

Do you think it would be possible to use that "full name" parameter as category name in the package manager page?

/me hopes something in this issue does make some sense... lol

ETA: for completeness sake, I was asked where the name comes from and noticed this possibility for improvement.

@Spuds
Copy link
Contributor

Spuds commented Feb 24, 2016

No I don't think you can use that. What you linked is in the front matter for that page view, its not "related" to the category at all, well past listing the items in that specific category. Categories are defined by the the front matter of the posts with the category: blabla tag

I think you can also define categories by creating directory's with a _post directory inside. So instead of everything being inside the root directory _posts, we could have a BBC directory with a _post directory inside of that and then add all the bbc addons there. Something to consider to help organize things.

Anyway back to the question! There are probably two ways to do what you want. One is to define variables in the main _config.yaml file ... like bbc: "BBC Code Extensions" Then you could access that in any page with site.bbc

The other (and really the same) way that should work is to make use of the pretty_cat.html file (Which should have the descriptive names improved, its similar to adding site variables, just easier to update).

So using that, updating the package.json template from "{{ category[0] }}" : [ to

{% capture cat %}{{ category[0] | downcase }}{% endcapture %}
{% include pretty_cat.html %}
"{{ cat }}" : [

Should do what you are suggesting.

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

2 participants