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

Helper updates for Tag Pages #2112

Closed
ErisDS opened this issue Feb 3, 2014 · 8 comments · Fixed by #2189
Closed

Helper updates for Tag Pages #2112

ErisDS opened this issue Feb 3, 2014 · 8 comments · Fixed by #2189
Assignees
Milestone

Comments

@ErisDS
Copy link
Member

ErisDS commented Feb 3, 2014

These changes require #2111 to make any sense, and will depend on changes to the urlFor function, so it is possibly worth considering #1833.

Tag helper update for tag pages

Once the feature for tag pages exists, the {{tags}} helper can be updated to output tags in an a tag by default, with an option to turn this off.

I propose the option could be:

{{tags autolink="false"}} but would like some feedback from the community on this

Url helper update for tag pages

Once the feature for tag pages exists, the {{url}} helper can be updated to support outputting URLs in the tag context.

This means that if someone wants to create a customised list of tags, rather than using the {{tags}} helper, they can do so by doing something like:

<ul>
{{#tags}}
   <li><a href="{{url}}>{{title}}</a></li>
{{/tags}}
</ul>
@halfdan
Copy link
Contributor

halfdan commented Feb 4, 2014

Raising my hand here :)

@JohnONolan
Copy link
Member

{{tags autolink="false"}}

Down to the letter, exactly what I was going to suggest. So... +1

@halfdan
Copy link
Contributor

halfdan commented Feb 13, 2014

@ErisDS Just to be sure: Isn't the last example supposed to read {{#each tags}} .. {{/each}} instead of {{#tags}} .. {{/tags}}?

@halfdan
Copy link
Contributor

halfdan commented Feb 13, 2014

Submitted the PR under the assumption that the second example was supposed to read:

<ul>
{{#each tags}}
   <li><a href="{{url}}>{{name}}</a></li>
{{/each}}
</ul>

halfdan added a commit to halfdan/Ghost that referenced this issue Feb 13, 2014
fixes TryGhost#2112
refs TryGhost#1833

- modified config.urlFor to handle tag pages

- modified {{#tags}} handlebars helper to autolink to
  tag pages. Additional autolink="false" parameter can
  be used to deactivate autolinking

- modified url handlebars helper to handle tags

- added isTag function to schema

- added unit test for additional urlFor functionality

- added unit test for {{#tags}} helper modifications

- added unit test for url handlebards helper
@ErisDS ErisDS modified the milestones: 0.4.2, 0.5 Mar 10, 2014
@Venomen
Copy link

Venomen commented Mar 20, 2014

You all forgot about "

a href="{{url}}">{{name}}

:)

@halfdan
Copy link
Contributor

halfdan commented Mar 20, 2014

@Venomen What did we forget?

@Venomen
Copy link

Venomen commented Mar 20, 2014

"""""""""
:)

@ErisDS
Copy link
Member Author

ErisDS commented Mar 20, 2014

I believe @Venomen is referring to the fact that both of our example snippets have a missing quote mark.

This is just an example and has no effect on the implementation.

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

Successfully merging a pull request may close this issue.

4 participants