Can Custom Helpers or Apps Be Registered in Current Version of Ghost?


#1

Newbie Here with limited coding experience (i.e. javascript at the MOST basic of levels)

I am trying to split a tag name on a “:” as I would like to use internal tags to organize how my posts show up in a hierarchy. With just using tags, I cannot know for example if a tag is a country visited or the name of a trip and I would like to use that information logically for my site layout.

Tag1(T: Trip 1) Tag2(C:Country1) Tag3 (D:Destination1) Tag4(D:Destination2) … etc

So that I can layout pages like:

Home – most recent entries by T:Trip
Trips --T:Trip1
–T:Trip2
Countries Visited: – C:Country1
– etc.
Most Recent Destinations: – D:Destination1
–D:Destination2

This would be very easy if there were a “split” function in handlebars… but there is not so looking at github I found:

Handlebars-helpers which states it can be used in Ghost:

So I tried to put that anywhere of about 20 different places and realize its just not getting the helper functions registered.

I want to be able to do something like the following:

{{#posts}}

{{#foreach tags}}
   splitname:  {{split name ":"}}
{{/foreach}}

{{/posts}}

then do some matches on Splitname.

Any thoughts?

Thanks in advance… Bill


#2

Hey Bill,

This kind of splitting wont work with handlebars. But, I think I do have a solution. What you could do is tag the place, then tag that post with a 2nd tag of trip, country,etc. This way you can check the post to see which second tag it has to know where to categorize it. Does that make sense?

David


#3

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